/*
 * 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';

/**
 * Parameters supplied to the Create operation.
 *
 */
class BatchAccountCreateParameters {
  /**
   * Create a BatchAccountCreateParameters.
   * @property {string} location The region in which to create the account.
   * @property {object} [tags] The user-specified tags associated with the
   * account.
   * @property {object} [autoStorage] The properties related to the
   * auto-storage account.
   * @property {string} [autoStorage.storageAccountId] The resource ID of the
   * storage account to be used for auto-storage account.
   * @property {string} [poolAllocationMode] The allocation mode to use for
   * creating pools in the Batch account. The pool allocation mode also affects
   * how clients may authenticate to the Batch Service API. If the mode is
   * BatchService, clients may authenticate using access keys or Azure Active
   * Directory. If the mode is UserSubscription, clients must use Azure Active
   * Directory. The default is BatchService. Possible values include:
   * 'BatchService', 'UserSubscription'
   * @property {object} [keyVaultReference] A reference to the Azure key vault
   * associated with the Batch account.
   * @property {string} [keyVaultReference.id] The resource ID of the Azure key
   * vault associated with the Batch account.
   * @property {string} [keyVaultReference.url] The URL of the Azure key vault
   * associated with the Batch account.
   * @property {string} [publicNetworkAccess] The network access type for
   * accessing Azure Batch account. If not specified, the default value is
   * 'enabled'. Possible values include: 'Enabled', 'Disabled'. Default value:
   * 'Enabled' .
   * @property {object} [encryption] The encryption configuration for the Batch
   * account. Configures how customer data is encrypted inside the Batch
   * account. By default, accounts are encrypted using a Microsoft managed key.
   * For additional control, a customer-managed key can be used instead.
   * @property {string} [encryption.keySource] Type of the key source. Possible
   * values include: 'Microsoft.Batch', 'Microsoft.KeyVault'
   * @property {object} [encryption.keyVaultProperties] Additional details when
   * using Microsoft.KeyVault
   * @property {string} [encryption.keyVaultProperties.keyIdentifier] Full path
   * to the versioned secret. Example
   * https://mykeyvault.vault.azure.net/keys/testkey/6e34a81fef704045975661e297a4c053.
   * To be usable the following prerequisites must be met:
   *
   * The Batch Account has a System Assigned identity
   * The account identity has been granted Key/Get, Key/Unwrap and Key/Wrap
   * permissions
   * The KeyVault has soft-delete and purge protection enabled
   * @property {object} [identity] The identity of the Batch account.
   * @property {string} [identity.principalId] The principal id of the Batch
   * account. This property will only be provided for a system assigned
   * identity.
   * @property {string} [identity.tenantId] The tenant id associated with the
   * Batch account. This property will only be provided for a system assigned
   * identity.
   * @property {string} [identity.type] The type of identity used for the Batch
   * account. Possible values include: 'SystemAssigned', 'None'
   */
  constructor() {
  }

  /**
   * Defines the metadata of BatchAccountCreateParameters
   *
   * @returns {object} metadata of BatchAccountCreateParameters
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BatchAccountCreateParameters',
      type: {
        name: 'Composite',
        className: 'BatchAccountCreateParameters',
        modelProperties: {
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          autoStorage: {
            required: false,
            serializedName: 'properties.autoStorage',
            type: {
              name: 'Composite',
              className: 'AutoStorageBaseProperties'
            }
          },
          poolAllocationMode: {
            required: false,
            serializedName: 'properties.poolAllocationMode',
            type: {
              name: 'Enum',
              allowedValues: [ 'BatchService', 'UserSubscription' ]
            }
          },
          keyVaultReference: {
            required: false,
            serializedName: 'properties.keyVaultReference',
            type: {
              name: 'Composite',
              className: 'KeyVaultReference'
            }
          },
          publicNetworkAccess: {
            required: false,
            serializedName: 'properties.publicNetworkAccess',
            defaultValue: 'Enabled',
            type: {
              name: 'Enum',
              allowedValues: [ 'Enabled', 'Disabled' ]
            }
          },
          encryption: {
            required: false,
            serializedName: 'properties.encryption',
            type: {
              name: 'Composite',
              className: 'EncryptionProperties'
            }
          },
          identity: {
            required: false,
            serializedName: 'identity',
            type: {
              name: 'Composite',
              className: 'BatchAccountIdentity'
            }
          }
        }
      }
    };
  }
}

module.exports = BatchAccountCreateParameters;
