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

/**
 * AzureWorkload SQL -specific restore. Specifically for full/diff restore
 *
 * @extends models['AzureWorkloadRestoreRequest']
 */
class AzureWorkloadSQLRestoreRequest extends models['AzureWorkloadRestoreRequest'] {
  /**
   * Create a AzureWorkloadSQLRestoreRequest.
   * @member {boolean} [shouldUseAlternateTargetLocation] Default option set to
   * true. If this is set to false, alternate data directory must be provided
   * @member {boolean} [isNonRecoverable] SQL specific property where user can
   * chose to set no-recovery when restore operation is tried
   * @member {object} [targetInfo] Details of target database
   * @member {string} [targetInfo.overwriteOption] Can Overwrite if Target
   * DataBase already exists. Possible values include: 'Invalid',
   * 'FailOnConflict', 'Overwrite'
   * @member {string} [targetInfo.containerId] Resource Id name of the
   * container in which Target DataBase resides
   * @member {string} [targetInfo.databaseName] Database name
   * InstanceName/DataBaseName for SQL or System/DbName for SAP Hana
   * @member {array} [alternateDirectoryPaths] Data directory details
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AzureWorkloadSQLRestoreRequest
   *
   * @returns {object} metadata of AzureWorkloadSQLRestoreRequest
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AzureWorkloadSQLRestoreRequest',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'objectType',
          clientName: 'objectType'
        },
        uberParent: 'RestoreRequest',
        className: 'AzureWorkloadSQLRestoreRequest',
        modelProperties: {
          objectType: {
            required: true,
            serializedName: 'objectType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          recoveryType: {
            required: false,
            serializedName: 'recoveryType',
            type: {
              name: 'String'
            }
          },
          sourceResourceId: {
            required: false,
            serializedName: 'sourceResourceId',
            type: {
              name: 'String'
            }
          },
          propertyBag: {
            required: false,
            serializedName: 'propertyBag',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          shouldUseAlternateTargetLocation: {
            required: false,
            serializedName: 'shouldUseAlternateTargetLocation',
            type: {
              name: 'Boolean'
            }
          },
          isNonRecoverable: {
            required: false,
            serializedName: 'isNonRecoverable',
            type: {
              name: 'Boolean'
            }
          },
          targetInfo: {
            required: false,
            serializedName: 'targetInfo',
            type: {
              name: 'Composite',
              className: 'TargetRestoreInfo'
            }
          },
          alternateDirectoryPaths: {
            required: false,
            serializedName: 'alternateDirectoryPaths',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'SQLDataDirectoryMappingElementType',
                  type: {
                    name: 'Composite',
                    className: 'SQLDataDirectoryMapping'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = AzureWorkloadSQLRestoreRequest;
