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

const models = require('./index');

/**
 * Contains information about an Azure Batch account.
 *
 * @extends models['Resource']
 */
class BatchAccount extends models['Resource'] {
  /**
   * Create a BatchAccount.
   * @property {string} [accountEndpoint] The account endpoint used to interact
   * with the Batch service.
   * @property {string} [provisioningState] The provisioned state of the
   * resource. Possible values include: 'Invalid', 'Creating', 'Deleting',
   * 'Succeeded', 'Failed', 'Cancelled'
   * @property {string} [poolAllocationMode] The allocation mode to use for
   * creating pools in the Batch account. 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 interface type for
   * accessing Azure Batch service and Batch account operations. If not
   * specified, the default value is 'enabled'. Possible values include:
   * 'Enabled', 'Disabled'. Default value: 'Enabled' .
   * @property {array} [privateEndpointConnections] List of private endpoint
   * connections associated with the Batch account
   * @property {object} [autoStorage] The properties and status of any
   * auto-storage account associated with the Batch account.
   * @property {date} [autoStorage.lastKeySync] The UTC time at which storage
   * keys were last synchronized with the Batch account.
   * @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 {number} [dedicatedCoreQuota] The dedicated core quota for the
   * Batch account. For accounts with PoolAllocationMode set to
   * UserSubscription, quota is managed on the subscription so this value is
   * not returned.
   * @property {number} [lowPriorityCoreQuota] The low-priority core quota for
   * the Batch account. For accounts with PoolAllocationMode set to
   * UserSubscription, quota is managed on the subscription so this value is
   * not returned.
   * @property {array} [dedicatedCoreQuotaPerVMFamily] A list of the dedicated
   * core quota per Virtual Machine family for the Batch account. For accounts
   * with PoolAllocationMode set to UserSubscription, quota is managed on the
   * subscription so this value is not returned.
   * @property {boolean} [dedicatedCoreQuotaPerVMFamilyEnforced] A value
   * indicating whether the core quota for the Batch Account is enforced per
   * Virtual Machine family or not. Batch is transitioning its core quota
   * system for dedicated cores to be enforced per Virtual Machine family.
   * During this transitional phase, the dedicated core quota per Virtual
   * Machine family may not yet be enforced. If this flag is false, dedicated
   * core quota is enforced via the old dedicatedCoreQuota property on the
   * account and does not consider Virtual Machine family. If this flag is
   * true, dedicated core quota is enforced via the
   * dedicatedCoreQuotaPerVMFamily property on the account, and the old
   * dedicatedCoreQuota does not apply.
   * @property {number} [poolQuota] The pool quota for the Batch account.
   * @property {number} [activeJobAndJobScheduleQuota] The active job and job
   * schedule quota for the Batch account.
   * @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() {
    super();
  }

  /**
   * Defines the metadata of BatchAccount
   *
   * @returns {object} metadata of BatchAccount
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'BatchAccount',
      type: {
        name: 'Composite',
        className: 'BatchAccount',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            readOnly: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            readOnly: true,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          accountEndpoint: {
            required: false,
            readOnly: true,
            serializedName: 'properties.accountEndpoint',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            nullable: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Cancelled' ]
            }
          },
          poolAllocationMode: {
            required: false,
            readOnly: true,
            serializedName: 'properties.poolAllocationMode',
            type: {
              name: 'Enum',
              allowedValues: [ 'BatchService', 'UserSubscription' ]
            }
          },
          keyVaultReference: {
            required: false,
            readOnly: true,
            serializedName: 'properties.keyVaultReference',
            type: {
              name: 'Composite',
              className: 'KeyVaultReference'
            }
          },
          publicNetworkAccess: {
            required: false,
            readOnly: true,
            serializedName: 'properties.publicNetworkAccess',
            defaultValue: 'Enabled',
            type: {
              name: 'Enum',
              allowedValues: [ 'Enabled', 'Disabled' ]
            }
          },
          privateEndpointConnections: {
            required: false,
            nullable: true,
            readOnly: true,
            serializedName: 'properties.privateEndpointConnections',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'PrivateEndpointConnectionElementType',
                  type: {
                    name: 'Composite',
                    className: 'PrivateEndpointConnection'
                  }
              }
            }
          },
          autoStorage: {
            required: false,
            readOnly: true,
            serializedName: 'properties.autoStorage',
            type: {
              name: 'Composite',
              className: 'AutoStorageProperties'
            }
          },
          encryption: {
            required: false,
            readOnly: true,
            serializedName: 'properties.encryption',
            type: {
              name: 'Composite',
              className: 'EncryptionProperties'
            }
          },
          dedicatedCoreQuota: {
            required: false,
            nullable: true,
            readOnly: true,
            serializedName: 'properties.dedicatedCoreQuota',
            type: {
              name: 'Number'
            }
          },
          lowPriorityCoreQuota: {
            required: false,
            nullable: true,
            readOnly: true,
            serializedName: 'properties.lowPriorityCoreQuota',
            type: {
              name: 'Number'
            }
          },
          dedicatedCoreQuotaPerVMFamily: {
            required: false,
            nullable: true,
            readOnly: true,
            serializedName: 'properties.dedicatedCoreQuotaPerVMFamily',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'VirtualMachineFamilyCoreQuotaElementType',
                  type: {
                    name: 'Composite',
                    className: 'VirtualMachineFamilyCoreQuota'
                  }
              }
            }
          },
          dedicatedCoreQuotaPerVMFamilyEnforced: {
            required: false,
            nullable: false,
            readOnly: true,
            serializedName: 'properties.dedicatedCoreQuotaPerVMFamilyEnforced',
            type: {
              name: 'Boolean'
            }
          },
          poolQuota: {
            required: false,
            nullable: false,
            readOnly: true,
            serializedName: 'properties.poolQuota',
            type: {
              name: 'Number'
            }
          },
          activeJobAndJobScheduleQuota: {
            required: false,
            nullable: false,
            readOnly: true,
            serializedName: 'properties.activeJobAndJobScheduleQuota',
            type: {
              name: 'Number'
            }
          },
          identity: {
            required: false,
            serializedName: 'identity',
            type: {
              name: 'Composite',
              className: 'BatchAccountIdentity'
            }
          }
        }
      }
    };
  }
}

module.exports = BatchAccount;
