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

/**
 * Represents a server.
 *
 * @extends models['TrackedResource']
 */
class Server extends models['TrackedResource'] {
  /**
   * Create a Server.
   * @property {object} [sku] The SKU (pricing tier) of the server.
   * @property {string} [sku.name] The name of the sku, typically, tier +
   * family + cores, e.g. B_Gen4_1, GP_Gen5_8.
   * @property {string} [sku.tier] The tier of the particular SKU, e.g. Basic.
   * Possible values include: 'Basic', 'GeneralPurpose', 'MemoryOptimized'
   * @property {number} [sku.capacity] The scale up/out capacity, representing
   * server's compute units.
   * @property {string} [sku.size] The size code, to be interpreted by resource
   * as appropriate.
   * @property {string} [sku.family] The family of hardware.
   * @property {string} [administratorLogin] The administrator's login name of
   * a server. Can only be specified when the server is being created (and is
   * required for creation).
   * @property {string} [version] Server version. Possible values include:
   * '9.5', '9.6', '10', '10.0', '10.2'
   * @property {string} [sslEnforcement] Enable ssl enforcement or not when
   * connect to server. Possible values include: 'Enabled', 'Disabled'
   * @property {string} [userVisibleState] A state of a server that is visible
   * to user. Possible values include: 'Ready', 'Dropping', 'Disabled'
   * @property {string} [fullyQualifiedDomainName] The fully qualified domain
   * name of a server.
   * @property {date} [earliestRestoreDate] Earliest restore point creation
   * time (ISO8601 format)
   * @property {object} [storageProfile] Storage profile of a server.
   * @property {number} [storageProfile.backupRetentionDays] Backup retention
   * days for the server.
   * @property {string} [storageProfile.geoRedundantBackup] Enable
   * Geo-redundant or not for server backup. Possible values include:
   * 'Enabled', 'Disabled'
   * @property {number} [storageProfile.storageMB] Max storage allowed for a
   * server.
   * @property {string} [replicationRole] The replication role of the server.
   * @property {string} [masterServerId] The master server id of a replica
   * server.
   * @property {number} [replicaCapacity] The maximum number of replicas that a
   * master server can have.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Server
   *
   * @returns {object} metadata of Server
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Server',
      type: {
        name: 'Composite',
        className: 'Server',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          administratorLogin: {
            required: false,
            serializedName: 'properties.administratorLogin',
            type: {
              name: 'String'
            }
          },
          version: {
            required: false,
            serializedName: 'properties.version',
            type: {
              name: 'String'
            }
          },
          sslEnforcement: {
            required: false,
            serializedName: 'properties.sslEnforcement',
            type: {
              name: 'Enum',
              allowedValues: [ 'Enabled', 'Disabled' ]
            }
          },
          userVisibleState: {
            required: false,
            serializedName: 'properties.userVisibleState',
            type: {
              name: 'String'
            }
          },
          fullyQualifiedDomainName: {
            required: false,
            serializedName: 'properties.fullyQualifiedDomainName',
            type: {
              name: 'String'
            }
          },
          earliestRestoreDate: {
            required: false,
            serializedName: 'properties.earliestRestoreDate',
            type: {
              name: 'DateTime'
            }
          },
          storageProfile: {
            required: false,
            serializedName: 'properties.storageProfile',
            type: {
              name: 'Composite',
              className: 'StorageProfile'
            }
          },
          replicationRole: {
            required: false,
            serializedName: 'properties.replicationRole',
            type: {
              name: 'String'
            }
          },
          masterServerId: {
            required: false,
            serializedName: 'properties.masterServerId',
            type: {
              name: 'String'
            }
          },
          replicaCapacity: {
            required: false,
            serializedName: 'properties.replicaCapacity',
            constraints: {
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = Server;
