/*
 * 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 backup copy.
 *
 * @extends models['RecoveryPoint']
 */
class IaasVMRecoveryPoint extends models['RecoveryPoint'] {
  /**
   * Create a IaasVMRecoveryPoint.
   * @member {string} [recoveryPointType] Type of the backup copy.
   * @member {date} [recoveryPointTime] Time at which this backup copy was
   * created.
   * @member {string} [recoveryPointAdditionalInfo] Additional information
   * associated with this backup copy.
   * @member {string} [sourceVMStorageType] Storage type of the VM whose backup
   * copy is created.
   * @member {boolean} [isSourceVMEncrypted] Identifies whether the VM was
   * encrypted when the backup copy is created.
   * @member {object} [keyAndSecret] Required details for recovering an
   * encrypted VM. Applicable only when IsSourceVMEncrypted is true.
   * @member {object} [keyAndSecret.kekDetails] KEK is encryption key for BEK.
   * @member {string} [keyAndSecret.kekDetails.keyUrl] Key is KEK.
   * @member {string} [keyAndSecret.kekDetails.keyVaultId] Key Vault ID where
   * this Key is stored.
   * @member {string} [keyAndSecret.kekDetails.keyBackupData] KEK data.
   * @member {object} [keyAndSecret.bekDetails] BEK is bitlocker encrpytion
   * key.
   * @member {string} [keyAndSecret.bekDetails.secretUrl] Secret is BEK.
   * @member {string} [keyAndSecret.bekDetails.secretVaultId] ID of the Key
   * Vault where this Secret is stored.
   * @member {string} [keyAndSecret.bekDetails.secretData] BEK data.
   * @member {string} [keyAndSecret.encryptionMechanism] Encryption mechanism:
   * None/ SinglePass/ DoublePass
   * @member {boolean} [isInstantIlrSessionActive] Is the session to recover
   * items from this backup copy still active.
   * @member {array} [recoveryPointTierDetails] Recovery point tier
   * information.
   * @member {boolean} [isManagedVirtualMachine] Whether VM is with Managed
   * Disks
   * @member {string} [virtualMachineSize] Virtual Machine Size
   * @member {boolean} [originalStorageAccountOption] Original Storage Account
   * Option
   * @member {string} [osType] OS type
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of IaasVMRecoveryPoint
   *
   * @returns {object} metadata of IaasVMRecoveryPoint
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'IaasVMRecoveryPoint',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'objectType',
          clientName: 'objectType'
        },
        uberParent: 'RecoveryPoint',
        className: 'IaasVMRecoveryPoint',
        modelProperties: {
          objectType: {
            required: true,
            serializedName: 'objectType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          recoveryPointType: {
            required: false,
            serializedName: 'recoveryPointType',
            type: {
              name: 'String'
            }
          },
          recoveryPointTime: {
            required: false,
            serializedName: 'recoveryPointTime',
            type: {
              name: 'DateTime'
            }
          },
          recoveryPointAdditionalInfo: {
            required: false,
            serializedName: 'recoveryPointAdditionalInfo',
            type: {
              name: 'String'
            }
          },
          sourceVMStorageType: {
            required: false,
            serializedName: 'sourceVMStorageType',
            type: {
              name: 'String'
            }
          },
          isSourceVMEncrypted: {
            required: false,
            serializedName: 'isSourceVMEncrypted',
            type: {
              name: 'Boolean'
            }
          },
          keyAndSecret: {
            required: false,
            serializedName: 'keyAndSecret',
            type: {
              name: 'Composite',
              className: 'KeyAndSecretDetails'
            }
          },
          isInstantIlrSessionActive: {
            required: false,
            serializedName: 'isInstantIlrSessionActive',
            type: {
              name: 'Boolean'
            }
          },
          recoveryPointTierDetails: {
            required: false,
            serializedName: 'recoveryPointTierDetails',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'RecoveryPointTierInformationElementType',
                  type: {
                    name: 'Composite',
                    className: 'RecoveryPointTierInformation'
                  }
              }
            }
          },
          isManagedVirtualMachine: {
            required: false,
            serializedName: 'isManagedVirtualMachine',
            type: {
              name: 'Boolean'
            }
          },
          virtualMachineSize: {
            required: false,
            serializedName: 'virtualMachineSize',
            type: {
              name: 'String'
            }
          },
          originalStorageAccountOption: {
            required: false,
            serializedName: 'originalStorageAccountOption',
            type: {
              name: 'Boolean'
            }
          },
          osType: {
            required: false,
            serializedName: 'osType',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = IaasVMRecoveryPoint;
