/*
 * 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 managed instance.
 *
 * @extends models['TrackedResource']
 */
class ManagedInstance extends models['TrackedResource'] {
  /**
   * Create a ManagedInstance.
   * @property {object} [identity] The Azure Active Directory identity of the
   * managed instance.
   * @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 {object} [sku] Managed instance 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} [fullyQualifiedDomainName] The fully qualified domain
   * name of the managed instance.
   * @property {string} [administratorLogin] Administrator username for the
   * managed instance. Can only be specified when the managed instance is being
   * created (and is required for creation).
   * @property {string} [administratorLoginPassword] The administrator login
   * password (required for managed instance creation).
   * @property {string} [subnetId] Subnet resource ID for the managed instance.
   * @property {string} [state] The state of the managed instance.
   * @property {string} [licenseType] The license type. Possible values are
   * 'LicenseIncluded' and 'BasePrice'.
   * @property {number} [vCores] The number of VCores.
   * @property {number} [storageSizeInGB] The maximum storage size in GB.
   * @property {string} [collation] Collation of the managed instance.
   * @property {string} [dnsZone] The Dns Zone that the managed instance is in.
   * @property {string} [dnsZonePartner] The resource id of another managed
   * instance whose DNS zone this managed instance will share after creation.
   * @property {boolean} [publicDataEndpointEnabled] Whether or not the public
   * data endpoint is enabled.
   * @property {string} [proxyOverride] Connection type used for connecting to
   * the instance. Possible values include: 'Proxy', 'Redirect', 'Default'
   * @property {string} [timezoneId] Id of the timezone. Allowed values are
   * timezones supported by Windows.
   * Windows keeps details on supported timezones, including the id, in
   * registry under
   * KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones.
   * You can get those registry values via SQL Server by querying SELECT name
   * AS timezone_id FROM sys.time_zone_info.
   * List of Ids can also be obtained by executing
   * [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell.
   * An example of valid timezone id is "Pacific Standard Time" or "W. Europe
   * Standard Time".
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ManagedInstance
   *
   * @returns {object} metadata of ManagedInstance
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ManagedInstance',
      type: {
        name: 'Composite',
        className: 'ManagedInstance',
        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'
            }
          },
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'Sku'
            }
          },
          fullyQualifiedDomainName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.fullyQualifiedDomainName',
            type: {
              name: 'String'
            }
          },
          administratorLogin: {
            required: false,
            serializedName: 'properties.administratorLogin',
            type: {
              name: 'String'
            }
          },
          administratorLoginPassword: {
            required: false,
            serializedName: 'properties.administratorLoginPassword',
            type: {
              name: 'String'
            }
          },
          subnetId: {
            required: false,
            serializedName: 'properties.subnetId',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          licenseType: {
            required: false,
            serializedName: 'properties.licenseType',
            type: {
              name: 'String'
            }
          },
          vCores: {
            required: false,
            serializedName: 'properties.vCores',
            type: {
              name: 'Number'
            }
          },
          storageSizeInGB: {
            required: false,
            serializedName: 'properties.storageSizeInGB',
            type: {
              name: 'Number'
            }
          },
          collation: {
            required: false,
            serializedName: 'properties.collation',
            type: {
              name: 'String'
            }
          },
          dnsZone: {
            required: false,
            readOnly: true,
            serializedName: 'properties.dnsZone',
            type: {
              name: 'String'
            }
          },
          dnsZonePartner: {
            required: false,
            serializedName: 'properties.dnsZonePartner',
            type: {
              name: 'String'
            }
          },
          publicDataEndpointEnabled: {
            required: false,
            serializedName: 'properties.publicDataEndpointEnabled',
            type: {
              name: 'Boolean'
            }
          },
          proxyOverride: {
            required: false,
            serializedName: 'properties.proxyOverride',
            type: {
              name: 'String'
            }
          },
          timezoneId: {
            required: false,
            serializedName: 'properties.timezoneId',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ManagedInstance;
