/*
 * 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 elastic pool.
 *
 * @extends models['TrackedResource']
 */
class ElasticPool extends models['TrackedResource'] {
  /**
   * Create a ElasticPool.
   * @property {object} [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} [kind] Kind of elastic pool. This is metadata used for
   * the Azure portal experience.
   * @property {string} [state] The state of the elastic pool. Possible values
   * include: 'Creating', 'Ready', 'Disabled'
   * @property {date} [creationDate] The creation date of the elastic pool
   * (ISO8601 format).
   * @property {number} [maxSizeBytes] The storage limit for the database
   * elastic pool in bytes.
   * @property {object} [perDatabaseSettings] The per database settings for the
   * elastic pool.
   * @property {number} [perDatabaseSettings.minCapacity] The minimum capacity
   * all databases are guaranteed.
   * @property {number} [perDatabaseSettings.maxCapacity] The maximum capacity
   * any one database can consume.
   * @property {boolean} [zoneRedundant] Whether or not this elastic pool is
   * zone redundant, which means the replicas of this elastic pool will be
   * spread across multiple availability zones.
   * @property {string} [licenseType] The license type to apply for this
   * elastic pool. Possible values include: 'LicenseIncluded', 'BasePrice'
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ElasticPool
   *
   * @returns {object} metadata of ElasticPool
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ElasticPool',
      type: {
        name: 'Composite',
        className: 'ElasticPool',
        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'
            }
          },
          kind: {
            required: false,
            readOnly: true,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          state: {
            required: false,
            readOnly: true,
            serializedName: 'properties.state',
            type: {
              name: 'String'
            }
          },
          creationDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.creationDate',
            type: {
              name: 'DateTime'
            }
          },
          maxSizeBytes: {
            required: false,
            serializedName: 'properties.maxSizeBytes',
            type: {
              name: 'Number'
            }
          },
          perDatabaseSettings: {
            required: false,
            serializedName: 'properties.perDatabaseSettings',
            type: {
              name: 'Composite',
              className: 'ElasticPoolPerDatabaseSettings'
            }
          },
          zoneRedundant: {
            required: false,
            serializedName: 'properties.zoneRedundant',
            type: {
              name: 'Boolean'
            }
          },
          licenseType: {
            required: false,
            serializedName: 'properties.licenseType',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ElasticPool;
