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

/**
 * @summary The configuration for compute nodes in a pool based on the Azure
 * Virtual Machines infrastructure.
  *
 */
class VirtualMachineConfiguration {
  /**
   * Create a VirtualMachineConfiguration.
   * @property {object} imageReference A reference to the Azure Virtual
   * Machines Marketplace Image or the custom Virtual Machine Image to use.
   * @property {string} [imageReference.publisher] For example, Canonical or
   * MicrosoftWindowsServer.
   * @property {string} [imageReference.offer] For example, UbuntuServer or
   * WindowsServer.
   * @property {string} [imageReference.sku] For example, 18.04-LTS or
   * 2019-Datacenter.
   * @property {string} [imageReference.version] A value of 'latest' can be
   * specified to select the latest version of an image. If omitted, the
   * default is 'latest'.
   * @property {string} [imageReference.id] This property is mutually exclusive
   * with other properties. The Shared Image Gallery image must have replicas
   * in the same region as the Azure Batch account. For information about the
   * firewall settings for the Batch node agent to communicate with the Batch
   * service see
   * https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
   * @property {string} nodeAgentSkuId The SKU of the Batch node agent to be
   * provisioned on compute nodes in the pool. The Batch node agent is a
   * program that runs on each node in the pool, and provides the
   * command-and-control interface between the node and the Batch service.
   * There are different implementations of the node agent, known as SKUs, for
   * different operating systems. You must specify a node agent SKU which
   * matches the selected image reference. To get the list of supported node
   * agent SKUs along with their list of verified image references, see the
   * 'List supported node agent SKUs' operation.
   * @property {object} [windowsConfiguration] Windows operating system
   * settings on the virtual machine. This property must not be specified if
   * the imageReference specifies a Linux OS image.
   * @property {boolean} [windowsConfiguration.enableAutomaticUpdates] If
   * omitted, the default value is true.
   * @property {array} [dataDisks] The configuration for data disks attached to
   * the compute nodes in the pool. This property must be specified if the
   * compute nodes in the pool need to have empty data disks attached to them.
   * @property {string} [licenseType] The type of on-premises license to be
   * used when deploying the operating system. This only applies to images that
   * contain the Windows operating system, and should only be used when you
   * hold valid on-premises licenses for the nodes which will be deployed. If
   * omitted, no on-premises licensing discount is applied. Values are:
   *
   * Windows_Server - The on-premises license is for Windows Server.
   * Windows_Client - The on-premises license is for Windows Client.
   * @property {object} [containerConfiguration] The container configuration
   * for the pool. If specified, setup is performed on each node in the pool to
   * allow tasks to run in containers. All regular tasks and job manager tasks
   * run on this pool must specify the containerSettings property, and all
   * other tasks may specify it.
   * @property {array} [containerConfiguration.containerImageNames] This is the
   * full image reference, as would be specified to "docker pull". An image
   * will be sourced from the default Docker registry unless the image is fully
   * qualified with an alternative registry.
   * @property {array} [containerConfiguration.containerRegistries] If any
   * images must be downloaded from a private registry which requires
   * credentials, then those credentials must be provided here.
   * @property {object} [diskEncryptionConfiguration] The disk encryption
   * configuration for the pool. If specified, encryption is performed on each
   * node in the pool during node provisioning.
   * @property {array} [diskEncryptionConfiguration.targets] On Linux pool,
   * only "TemporaryDisk" is supported; on Windows pool, "OsDisk" and
   * "TemporaryDisk" must be specified.
   */
  constructor() {
  }

  /**
   * Defines the metadata of VirtualMachineConfiguration
   *
   * @returns {object} metadata of VirtualMachineConfiguration
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'VirtualMachineConfiguration',
      type: {
        name: 'Composite',
        className: 'VirtualMachineConfiguration',
        modelProperties: {
          imageReference: {
            required: true,
            serializedName: 'imageReference',
            type: {
              name: 'Composite',
              className: 'ImageReference'
            }
          },
          nodeAgentSkuId: {
            required: true,
            serializedName: 'nodeAgentSkuId',
            type: {
              name: 'String'
            }
          },
          windowsConfiguration: {
            required: false,
            serializedName: 'windowsConfiguration',
            type: {
              name: 'Composite',
              className: 'WindowsConfiguration'
            }
          },
          dataDisks: {
            required: false,
            serializedName: 'dataDisks',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DataDiskElementType',
                  type: {
                    name: 'Composite',
                    className: 'DataDisk'
                  }
              }
            }
          },
          licenseType: {
            required: false,
            serializedName: 'licenseType',
            type: {
              name: 'String'
            }
          },
          containerConfiguration: {
            required: false,
            serializedName: 'containerConfiguration',
            type: {
              name: 'Composite',
              className: 'ContainerConfiguration'
            }
          },
          diskEncryptionConfiguration: {
            required: false,
            serializedName: 'diskEncryptionConfiguration',
            type: {
              name: 'Composite',
              className: 'DiskEncryptionConfiguration'
            }
          }
        }
      }
    };
  }
}

module.exports = VirtualMachineConfiguration;
