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

/**
 * Details about app recovery operation.
 *
 * @extends models['ProxyOnlyResource']
 */
class SnapshotRestoreRequest extends models['ProxyOnlyResource'] {
  /**
   * Create a SnapshotRestoreRequest.
   * @member {string} [snapshotTime] Point in time in which the app restore
   * should be done, formatted as a DateTime string.
   * @member {object} [recoverySource] Optional. Specifies the web app that
   * snapshot contents will be retrieved from.
   * If empty, the targeted web app will be used as the source.
   * @member {string} [recoverySource.location] Geographical location of the
   * source web app, e.g. SouthEastAsia, SouthCentralUS
   * @member {string} [recoverySource.id] ARM resource ID of the source app.
   * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}
   * for production slots and
   * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName}
   * for other slots.
   * @member {boolean} overwrite If <code>true</code> the restore operation can
   * overwrite source app; otherwise, <code>false</code>.
   * @member {boolean} [recoverConfiguration] If true, site configuration, in
   * addition to content, will be reverted.
   * @member {boolean} [ignoreConflictingHostNames] If true, custom hostname
   * conflicts will be ignored when recovering to a target web app.
   * This setting is only necessary when RecoverConfiguration is enabled.
   * @member {boolean} [useDRSecondary] If true, the snapshot is retrieved from
   * DRSecondary endpoint.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SnapshotRestoreRequest
   *
   * @returns {object} metadata of SnapshotRestoreRequest
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SnapshotRestoreRequest',
      type: {
        name: 'Composite',
        className: 'SnapshotRestoreRequest',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          snapshotTime: {
            required: false,
            serializedName: 'properties.snapshotTime',
            type: {
              name: 'String'
            }
          },
          recoverySource: {
            required: false,
            serializedName: 'properties.recoverySource',
            type: {
              name: 'Composite',
              className: 'SnapshotRecoverySource'
            }
          },
          overwrite: {
            required: true,
            serializedName: 'properties.overwrite',
            type: {
              name: 'Boolean'
            }
          },
          recoverConfiguration: {
            required: false,
            serializedName: 'properties.recoverConfiguration',
            type: {
              name: 'Boolean'
            }
          },
          ignoreConflictingHostNames: {
            required: false,
            serializedName: 'properties.ignoreConflictingHostNames',
            type: {
              name: 'Boolean'
            }
          },
          useDRSecondary: {
            required: false,
            serializedName: 'properties.useDRSecondary',
            type: {
              name: 'Boolean'
            }
          }
        }
      }
    };
  }
}

module.exports = SnapshotRestoreRequest;
