/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

/**
 * Credentials to access a container image in a private repository.
 *
 */
class PrivateRegistryCredentials {
  /**
   * Create a PrivateRegistryCredentials.
   * @member {string} username User name. User name to login to the repository.
   * @member {string} [password] Password. User password to login to the docker
   * repository. One of password or passwordSecretReference must be specified.
   * @member {object} [passwordSecretReference] Password secret reference.
   * KeyVault Secret storing the password. Users can store their secrets in
   * Azure KeyVault and pass it to the Batch AI service to integrate with
   * KeyVault. One of password or passwordSecretReference must be specified.
   * @member {object} [passwordSecretReference.sourceVault] Fully qualified
   * resource indentifier of the Key Vault.
   * @member {string} [passwordSecretReference.sourceVault.id] The ID of the
   * resource
   * @member {string} [passwordSecretReference.secretUrl] The URL referencing a
   * secret in the Key Vault.
   */
  constructor() {
  }

  /**
   * Defines the metadata of PrivateRegistryCredentials
   *
   * @returns {object} metadata of PrivateRegistryCredentials
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'PrivateRegistryCredentials',
      type: {
        name: 'Composite',
        className: 'PrivateRegistryCredentials',
        modelProperties: {
          username: {
            required: true,
            serializedName: 'username',
            type: {
              name: 'String'
            }
          },
          password: {
            required: false,
            serializedName: 'password',
            type: {
              name: 'String'
            }
          },
          passwordSecretReference: {
            required: false,
            serializedName: 'passwordSecretReference',
            type: {
              name: 'Composite',
              className: 'KeyVaultSecretReference'
            }
          }
        }
      }
    };
  }
}

module.exports = PrivateRegistryCredentials;
