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

/**
 * Description of a restore request.
 *
 * @extends models['ProxyOnlyResource']
 */
class RestoreRequest extends models['ProxyOnlyResource'] {
  /**
   * Create a RestoreRequest.
   * @member {string} storageAccountUrl SAS URL to the container.
   * @member {string} [blobName] Name of a blob which contains the backup.
   * @member {boolean} overwrite <code>true</code> if the restore operation can
   * overwrite target app; otherwise, <code>false</code>. <code>true</code> is
   * needed if trying to restore over an existing app.
   * @member {string} [siteName] Name of an app.
   * @member {array} [databases] Collection of databases which should be
   * restored. This list has to match the list of databases included in the
   * backup.
   * @member {boolean} [ignoreConflictingHostNames] Changes a logic when
   * restoring an app with custom domains. <code>true</code> to remove custom
   * domains automatically. If <code>false</code>, custom domains are added to
   * the app's object when it is being restored, but that might fail due to
   * conflicts during the operation. Default value: false .
   * @member {boolean} [ignoreDatabases] Ignore the databases and only restore
   * the site content. Default value: false .
   * @member {string} [appServicePlan] Specify app service plan that will own
   * restored site.
   * @member {string} [operationType] Operation type. Possible values include:
   * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value:
   * 'Default' .
   * @member {boolean} [adjustConnectionStrings] <code>true</code> if
   * SiteConfig.ConnectionStrings should be set in new app; otherwise,
   * <code>false</code>.
   * @member {string} [hostingEnvironment] App Service Environment name, if
   * needed (only when restoring an app to an App Service Environment).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of RestoreRequest
   *
   * @returns {object} metadata of RestoreRequest
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'RestoreRequest',
      type: {
        name: 'Composite',
        className: 'RestoreRequest',
        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'
            }
          },
          storageAccountUrl: {
            required: true,
            serializedName: 'properties.storageAccountUrl',
            type: {
              name: 'String'
            }
          },
          blobName: {
            required: false,
            serializedName: 'properties.blobName',
            type: {
              name: 'String'
            }
          },
          overwrite: {
            required: true,
            serializedName: 'properties.overwrite',
            type: {
              name: 'Boolean'
            }
          },
          siteName: {
            required: false,
            serializedName: 'properties.siteName',
            type: {
              name: 'String'
            }
          },
          databases: {
            required: false,
            serializedName: 'properties.databases',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DatabaseBackupSettingElementType',
                  type: {
                    name: 'Composite',
                    className: 'DatabaseBackupSetting'
                  }
              }
            }
          },
          ignoreConflictingHostNames: {
            required: false,
            serializedName: 'properties.ignoreConflictingHostNames',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          ignoreDatabases: {
            required: false,
            serializedName: 'properties.ignoreDatabases',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          appServicePlan: {
            required: false,
            serializedName: 'properties.appServicePlan',
            type: {
              name: 'String'
            }
          },
          operationType: {
            required: false,
            serializedName: 'properties.operationType',
            defaultValue: 'Default',
            type: {
              name: 'Enum',
              allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' ]
            }
          },
          adjustConnectionStrings: {
            required: false,
            serializedName: 'properties.adjustConnectionStrings',
            type: {
              name: 'Boolean'
            }
          },
          hostingEnvironment: {
            required: false,
            serializedName: 'properties.hostingEnvironment',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = RestoreRequest;
