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

/**
 * IaaS VM workload-specific restore.
 *
 * @extends models['RestoreRequest']
 */
class IaasVMRestoreRequest extends models['RestoreRequest'] {
  /**
   * Create a IaasVMRestoreRequest.
   * @member {string} [recoveryPointId] ID of the backup copy to be recovered.
   * @member {string} [recoveryType] Type of this recovery. Possible values
   * include: 'Invalid', 'OriginalLocation', 'AlternateLocation',
   * 'RestoreDisks'
   * @member {string} [sourceResourceId] Fully qualified ARM ID of the VM which
   * is being recovered.
   * @member {string} [targetVirtualMachineId] This is the complete ARM Id of
   * the VM that will be created.
   * For e.g.
   * /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm}
   * @member {string} [targetResourceGroupId] This is the ARM Id of the
   * resource group that you want to create for this Virtual machine and other
   * artifacts.
   * For e.g. /subscriptions/{subId}/resourcegroups/{rg}
   * @member {string} [storageAccountId] Fully qualified ARM ID of the storage
   * account to which the VM has to be restored.
   * @member {string} [virtualNetworkId] This is the virtual network Id of the
   * vnet that will be attached to the virtual machine.
   * User will be validated for join action permissions in the linked access.
   * @member {string} [subnetId] Subnet ID, is the subnet ID associated with
   * the to be restored VM. For Classic VMs it would be
   * {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager VMs it
   * would be ARM resource ID used to represent
   * the subnet.
   * @member {string} [targetDomainNameId] Fully qualified ARM ID of the domain
   * name to be associated to the VM being restored. This applies only to
   * Classic
   * Virtual Machines.
   * @member {string} [region] Region in which the virtual machine is restored.
   * @member {string} [affinityGroup] Affinity group associated to VM to be
   * restored. Used only for Classic Compute Virtual Machines.
   * @member {boolean} [createNewCloudService] Should a new cloud service be
   * created while restoring the VM. If this is false, VM will be restored to
   * the same
   * cloud service as it was at the time of backup.
   * @member {boolean} [originalStorageAccountOption] Original Storage Account
   * Option
   * @member {object} [encryptionDetails] Details needed if the VM was
   * encrypted at the time of backup.
   * @member {boolean} [encryptionDetails.encryptionEnabled] Identifies whether
   * this backup copy represents an encrypted VM at the time of backup.
   * @member {string} [encryptionDetails.kekUrl] Key Url.
   * @member {string} [encryptionDetails.secretKeyUrl] Secret Url.
   * @member {string} [encryptionDetails.kekVaultId] ID of Key Vault where KEK
   * is stored.
   * @member {string} [encryptionDetails.secretKeyVaultId] ID of Key Vault
   * where Secret is stored.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of IaasVMRestoreRequest
   *
   * @returns {object} metadata of IaasVMRestoreRequest
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'IaasVMRestoreRequest',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'objectType',
          clientName: 'objectType'
        },
        uberParent: 'RestoreRequest',
        className: 'IaasVMRestoreRequest',
        modelProperties: {
          objectType: {
            required: true,
            serializedName: 'objectType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          recoveryPointId: {
            required: false,
            serializedName: 'recoveryPointId',
            type: {
              name: 'String'
            }
          },
          recoveryType: {
            required: false,
            serializedName: 'recoveryType',
            type: {
              name: 'String'
            }
          },
          sourceResourceId: {
            required: false,
            serializedName: 'sourceResourceId',
            type: {
              name: 'String'
            }
          },
          targetVirtualMachineId: {
            required: false,
            serializedName: 'targetVirtualMachineId',
            type: {
              name: 'String'
            }
          },
          targetResourceGroupId: {
            required: false,
            serializedName: 'targetResourceGroupId',
            type: {
              name: 'String'
            }
          },
          storageAccountId: {
            required: false,
            serializedName: 'storageAccountId',
            type: {
              name: 'String'
            }
          },
          virtualNetworkId: {
            required: false,
            serializedName: 'virtualNetworkId',
            type: {
              name: 'String'
            }
          },
          subnetId: {
            required: false,
            serializedName: 'subnetId',
            type: {
              name: 'String'
            }
          },
          targetDomainNameId: {
            required: false,
            serializedName: 'targetDomainNameId',
            type: {
              name: 'String'
            }
          },
          region: {
            required: false,
            serializedName: 'region',
            type: {
              name: 'String'
            }
          },
          affinityGroup: {
            required: false,
            serializedName: 'affinityGroup',
            type: {
              name: 'String'
            }
          },
          createNewCloudService: {
            required: false,
            serializedName: 'createNewCloudService',
            type: {
              name: 'Boolean'
            }
          },
          originalStorageAccountOption: {
            required: false,
            serializedName: 'originalStorageAccountOption',
            type: {
              name: 'Boolean'
            }
          },
          encryptionDetails: {
            required: false,
            serializedName: 'encryptionDetails',
            type: {
              name: 'Composite',
              className: 'EncryptionDetails'
            }
          }
        }
      }
    };
  }
}

module.exports = IaasVMRestoreRequest;
