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

/**
 * An Azure SQL Database server.
 *
 * @extends models['TrackedResource']
 */
class Server extends models['TrackedResource'] {
  /**
   * Create a Server.
   * @property {object} [identity] The Azure Active Directory identity of the
   * server.
   * @property {uuid} [identity.principalId] The Azure Active Directory
   * principal id.
   * @property {string} [identity.type] The identity type. Set this to
   * 'SystemAssigned' in order to automatically create and assign an Azure
   * Active Directory principal for the resource. Possible values include:
   * 'SystemAssigned'
   * @property {uuid} [identity.tenantId] The Azure Active Directory tenant id.
   * @property {string} [kind] Kind of sql server. This is metadata used for
   * the Azure portal experience.
   * @property {string} [administratorLogin] Administrator username for the
   * server. Once created it cannot be changed.
   * @property {string} [administratorLoginPassword] The administrator login
   * password (required for server creation).
   * @property {string} [version] The version of the server.
   * @property {string} [state] The state of the server.
   * @property {string} [fullyQualifiedDomainName] The fully qualified domain
   * name of the server.
   */
  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'
                  }
              }
            }
          },
          identity: {
            required: false,
            serializedName: 'identity',
            type: {
              name: 'Composite',
              className: 'ResourceIdentity'
            }
          },
          kind: {
            required: false,
            readOnly: true,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          administratorLogin: {
            required: false,
            serializedName: 'properties.administratorLogin',
            type: {
              name: 'String'
            }
          },
          administratorLoginPassword: {
            required: false,
            serializedName: 'properties.administratorLoginPassword',
            type: {
              name: 'String'
            }
          },
          version: {
            required: false,
            serializedName: 'properties.version',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          fullyQualifiedDomainName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.fullyQualifiedDomainName',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Server;
