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

/**
 * A database resource.
 *
 */
class DatabaseUpdate {
  /**
   * Create a DatabaseUpdate.
   * @property {object} [sku] The name and tier of the SKU.
   * @property {string} [sku.name] The name of the SKU. Ex - P3. It is
   * typically a letter+number code
   * @property {string} [sku.tier] This field is required to be implemented by
   * the Resource Provider if the service has more than one tier, but is not
   * required on a PUT.
   * @property {string} [sku.size] The SKU size. When the name field is the
   * combination of tier and some other value, this would be the standalone
   * code.
   * @property {string} [sku.family] If the service has different generations
   * of hardware, for the same SKU, then that can be captured here.
   * @property {number} [sku.capacity] If the SKU supports scale out/in then
   * the capacity integer should be included. If scale out/in is not possible
   * for the resource this may be omitted.
   * @property {string} [createMode] Specifies the mode of database creation.
   *
   * Default: regular database creation.
   *
   * Copy: creates a database as a copy of an existing database.
   * sourceDatabaseId must be specified as the resource ID of the source
   * database.
   *
   * Secondary: creates a database as a secondary replica of an existing
   * database. sourceDatabaseId must be specified as the resource ID of the
   * existing primary database.
   *
   * PointInTimeRestore: Creates a database by restoring a point in time backup
   * of an existing database. sourceDatabaseId must be specified as the
   * resource ID of the existing database, and restorePointInTime must be
   * specified.
   *
   * Recovery: Creates a database by restoring a geo-replicated backup.
   * sourceDatabaseId must be specified as the recoverable database resource ID
   * to restore.
   *
   * Restore: Creates a database by restoring a backup of a deleted database.
   * sourceDatabaseId must be specified. If sourceDatabaseId is the database's
   * original resource ID, then sourceDatabaseDeletionDate must be specified.
   * Otherwise sourceDatabaseId must be the restorable dropped database
   * resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime
   * may also be specified to restore from an earlier point in time.
   *
   * RestoreLongTermRetentionBackup: Creates a database by restoring from a
   * long term retention vault. recoveryServicesRecoveryPointResourceId must be
   * specified as the recovery point resource ID.
   *
   * Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for
   * DataWarehouse edition. Possible values include: 'Default', 'Copy',
   * 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery',
   * 'RestoreExternalBackup', 'RestoreExternalBackupSecondary',
   * 'RestoreLongTermRetentionBackup', 'OnlineSecondary'
   * @property {string} [collation] The collation of the database.
   * @property {number} [maxSizeBytes] The max size of the database expressed
   * in bytes.
   * @property {string} [sampleName] The name of the sample schema to apply
   * when creating this database. Possible values include: 'AdventureWorksLT',
   * 'WideWorldImportersStd', 'WideWorldImportersFull'
   * @property {string} [elasticPoolId] The resource identifier of the elastic
   * pool containing this database.
   * @property {string} [sourceDatabaseId] The resource identifier of the
   * source database associated with create operation of this database.
   * @property {string} [status] The status of the database. Possible values
   * include: 'Online', 'Restoring', 'RecoveryPending', 'Recovering',
   * 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode',
   * 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary',
   * 'Pausing', 'Paused', 'Resuming', 'Scaling'
   * @property {uuid} [databaseId] The ID of the database.
   * @property {date} [creationDate] The creation date of the database (ISO8601
   * format).
   * @property {string} [currentServiceObjectiveName] The current service level
   * objective name of the database.
   * @property {string} [requestedServiceObjectiveName] The requested service
   * level objective name of the database.
   * @property {string} [defaultSecondaryLocation] The default secondary region
   * for this database.
   * @property {string} [failoverGroupId] Failover Group resource identifier
   * that this database belongs to.
   * @property {date} [restorePointInTime] Specifies the point in time (ISO8601
   * format) of the source database that will be restored to create the new
   * database.
   * @property {date} [sourceDatabaseDeletionDate] Specifies the time that the
   * database was deleted.
   * @property {string} [recoveryServicesRecoveryPointId] The resource
   * identifier of the recovery point associated with create operation of this
   * database.
   * @property {string} [longTermRetentionBackupResourceId] The resource
   * identifier of the long term retention backup associated with create
   * operation of this database.
   * @property {string} [recoverableDatabaseId] The resource identifier of the
   * recoverable database associated with create operation of this database.
   * @property {string} [restorableDroppedDatabaseId] The resource identifier
   * of the restorable dropped database associated with create operation of
   * this database.
   * @property {string} [catalogCollation] Collation of the metadata catalog.
   * Possible values include: 'DATABASE_DEFAULT',
   * 'SQL_Latin1_General_CP1_CI_AS'
   * @property {boolean} [zoneRedundant] Whether or not this database is zone
   * redundant, which means the replicas of this database will be spread across
   * multiple availability zones.
   * @property {string} [licenseType] The license type to apply for this
   * database. Possible values include: 'LicenseIncluded', 'BasePrice'
   * @property {number} [maxLogSizeBytes] The max log size for this database.
   * @property {date} [earliestRestoreDate] This records the earliest start
   * date and time that restore is available for this database (ISO8601
   * format).
   * @property {string} [readScale] The state of read-only routing. If enabled,
   * connections that have application intent set to readonly in their
   * connection string may be routed to a readonly secondary replica in the
   * same region. Possible values include: 'Enabled', 'Disabled'
   * @property {object} [currentSku] The name and tier of the SKU.
   * @property {string} [currentSku.name] The name of the SKU. Ex - P3. It is
   * typically a letter+number code
   * @property {string} [currentSku.tier] This field is required to be
   * implemented by the Resource Provider if the service has more than one
   * tier, but is not required on a PUT.
   * @property {string} [currentSku.size] The SKU size. When the name field is
   * the combination of tier and some other value, this would be the standalone
   * code.
   * @property {string} [currentSku.family] If the service has different
   * generations of hardware, for the same SKU, then that can be captured here.
   * @property {number} [currentSku.capacity] If the SKU supports scale out/in
   * then the capacity integer should be included. If scale out/in is not
   * possible for the resource this may be omitted.
   * @property {object} [tags] Resource tags.
   */
  constructor() {
  }

  /**
   * Defines the metadata of DatabaseUpdate
   *
   * @returns {object} metadata of DatabaseUpdate
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'DatabaseUpdate',
      type: {
        name: 'Composite',
        className: 'DatabaseUpdate',
        modelProperties: {
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          createMode: {
            required: false,
            serializedName: 'properties.createMode',
            type: {
              name: 'String'
            }
          },
          collation: {
            required: false,
            serializedName: 'properties.collation',
            type: {
              name: 'String'
            }
          },
          maxSizeBytes: {
            required: false,
            serializedName: 'properties.maxSizeBytes',
            type: {
              name: 'Number'
            }
          },
          sampleName: {
            required: false,
            serializedName: 'properties.sampleName',
            type: {
              name: 'String'
            }
          },
          elasticPoolId: {
            required: false,
            serializedName: 'properties.elasticPoolId',
            type: {
              name: 'String'
            }
          },
          sourceDatabaseId: {
            required: false,
            serializedName: 'properties.sourceDatabaseId',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'properties.status',
            type: {
              name: 'String'
            }
          },
          databaseId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.databaseId',
            type: {
              name: 'String'
            }
          },
          creationDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.creationDate',
            type: {
              name: 'DateTime'
            }
          },
          currentServiceObjectiveName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.currentServiceObjectiveName',
            type: {
              name: 'String'
            }
          },
          requestedServiceObjectiveName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.requestedServiceObjectiveName',
            type: {
              name: 'String'
            }
          },
          defaultSecondaryLocation: {
            required: false,
            readOnly: true,
            serializedName: 'properties.defaultSecondaryLocation',
            type: {
              name: 'String'
            }
          },
          failoverGroupId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.failoverGroupId',
            type: {
              name: 'String'
            }
          },
          restorePointInTime: {
            required: false,
            serializedName: 'properties.restorePointInTime',
            type: {
              name: 'DateTime'
            }
          },
          sourceDatabaseDeletionDate: {
            required: false,
            serializedName: 'properties.sourceDatabaseDeletionDate',
            type: {
              name: 'DateTime'
            }
          },
          recoveryServicesRecoveryPointId: {
            required: false,
            serializedName: 'properties.recoveryServicesRecoveryPointId',
            type: {
              name: 'String'
            }
          },
          longTermRetentionBackupResourceId: {
            required: false,
            serializedName: 'properties.longTermRetentionBackupResourceId',
            type: {
              name: 'String'
            }
          },
          recoverableDatabaseId: {
            required: false,
            serializedName: 'properties.recoverableDatabaseId',
            type: {
              name: 'String'
            }
          },
          restorableDroppedDatabaseId: {
            required: false,
            serializedName: 'properties.restorableDroppedDatabaseId',
            type: {
              name: 'String'
            }
          },
          catalogCollation: {
            required: false,
            serializedName: 'properties.catalogCollation',
            type: {
              name: 'String'
            }
          },
          zoneRedundant: {
            required: false,
            serializedName: 'properties.zoneRedundant',
            type: {
              name: 'Boolean'
            }
          },
          licenseType: {
            required: false,
            serializedName: 'properties.licenseType',
            type: {
              name: 'String'
            }
          },
          maxLogSizeBytes: {
            required: false,
            readOnly: true,
            serializedName: 'properties.maxLogSizeBytes',
            type: {
              name: 'Number'
            }
          },
          earliestRestoreDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.earliestRestoreDate',
            type: {
              name: 'DateTime'
            }
          },
          readScale: {
            required: false,
            serializedName: 'properties.readScale',
            type: {
              name: 'String'
            }
          },
          currentSku: {
            required: false,
            readOnly: true,
            serializedName: 'properties.currentSku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = DatabaseUpdate;
