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

/**
 * App Service plan.
 *
 * @extends models['Resource']
 */
class AppServicePlan extends models['Resource'] {
  /**
   * Create a AppServicePlan.
   * @member {string} [workerTierName] Target worker tier assigned to the App
   * Service plan.
   * @member {string} [status] App Service plan status. Possible values
   * include: 'Ready', 'Pending', 'Creating'
   * @member {string} [subscription] App Service plan subscription.
   * @member {string} [adminSiteName] App Service plan administration site.
   * @member {object} [hostingEnvironmentProfile] Specification for the App
   * Service Environment to use for the App Service plan.
   * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App
   * Service Environment.
   * @member {string} [hostingEnvironmentProfile.name] Name of the App Service
   * Environment.
   * @member {string} [hostingEnvironmentProfile.type] Resource type of the App
   * Service Environment.
   * @member {number} [maximumNumberOfWorkers] Maximum number of instances that
   * can be assigned to this App Service plan.
   * @member {string} [geoRegion] Geographical location for the App Service
   * plan.
   * @member {boolean} [perSiteScaling] If <code>true</code>, apps assigned to
   * this App Service plan can be scaled independently.
   * If <code>false</code>, apps assigned to this App Service plan will scale
   * to all instances of the plan. Default value: false .
   * @member {number} [maximumElasticWorkerCount] Maximum number of total
   * workers allowed for this ElasticScaleEnabled App Service Plan
   * @member {number} [numberOfSites] Number of apps assigned to this App
   * Service plan.
   * @member {boolean} [isSpot] If <code>true</code>, this App Service Plan
   * owns spot instances.
   * @member {date} [spotExpirationTime] The time when the server farm expires.
   * Valid only if it is a spot server farm.
   * @member {date} [freeOfferExpirationTime] The time when the server farm
   * free offer expires.
   * @member {string} [resourceGroup] Resource group of the App Service plan.
   * @member {boolean} [reserved] If Linux app service plan <code>true</code>,
   * <code>false</code> otherwise. Default value: false .
   * @member {boolean} [isXenon] Obsolete: If Hyper-V container app service
   * plan <code>true</code>, <code>false</code> otherwise. Default value: false
   * .
   * @member {boolean} [hyperV] If Hyper-V container app service plan
   * <code>true</code>, <code>false</code> otherwise. Default value: false .
   * @member {number} [targetWorkerCount] Scaling worker count.
   * @member {number} [targetWorkerSizeId] Scaling worker size ID.
   * @member {string} [provisioningState] Provisioning state of the App Service
   * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled',
   * 'InProgress', 'Deleting'
   * @member {object} [sku]
   * @member {string} [sku.name] Name of the resource SKU.
   * @member {string} [sku.tier] Service tier of the resource SKU.
   * @member {string} [sku.size] Size specifier of the resource SKU.
   * @member {string} [sku.family] Family code of the resource SKU.
   * @member {number} [sku.capacity] Current number of instances assigned to
   * the resource.
   * @member {object} [sku.skuCapacity] Min, max, and default scale values of
   * the SKU.
   * @member {number} [sku.skuCapacity.minimum] Minimum number of workers for
   * this App Service plan SKU.
   * @member {number} [sku.skuCapacity.maximum] Maximum number of workers for
   * this App Service plan SKU.
   * @member {number} [sku.skuCapacity.default] Default number of workers for
   * this App Service plan SKU.
   * @member {string} [sku.skuCapacity.scaleType] Available scale
   * configurations for an App Service plan.
   * @member {array} [sku.locations] Locations of the SKU.
   * @member {array} [sku.capabilities] Capabilities of the SKU, e.g., is
   * traffic manager enabled?
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AppServicePlan
   *
   * @returns {object} metadata of AppServicePlan
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AppServicePlan',
      type: {
        name: 'Composite',
        className: 'AppServicePlan',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          workerTierName: {
            required: false,
            serializedName: 'properties.workerTierName',
            type: {
              name: 'String'
            }
          },
          status: {
            required: false,
            readOnly: true,
            serializedName: 'properties.status',
            type: {
              name: 'Enum',
              allowedValues: [ 'Ready', 'Pending', 'Creating' ]
            }
          },
          subscription: {
            required: false,
            readOnly: true,
            serializedName: 'properties.subscription',
            type: {
              name: 'String'
            }
          },
          adminSiteName: {
            required: false,
            serializedName: 'properties.adminSiteName',
            type: {
              name: 'String'
            }
          },
          hostingEnvironmentProfile: {
            required: false,
            serializedName: 'properties.hostingEnvironmentProfile',
            type: {
              name: 'Composite',
              className: 'HostingEnvironmentProfile'
            }
          },
          maximumNumberOfWorkers: {
            required: false,
            readOnly: true,
            serializedName: 'properties.maximumNumberOfWorkers',
            type: {
              name: 'Number'
            }
          },
          geoRegion: {
            required: false,
            readOnly: true,
            serializedName: 'properties.geoRegion',
            type: {
              name: 'String'
            }
          },
          perSiteScaling: {
            required: false,
            serializedName: 'properties.perSiteScaling',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          maximumElasticWorkerCount: {
            required: false,
            serializedName: 'properties.maximumElasticWorkerCount',
            type: {
              name: 'Number'
            }
          },
          numberOfSites: {
            required: false,
            readOnly: true,
            serializedName: 'properties.numberOfSites',
            type: {
              name: 'Number'
            }
          },
          isSpot: {
            required: false,
            serializedName: 'properties.isSpot',
            type: {
              name: 'Boolean'
            }
          },
          spotExpirationTime: {
            required: false,
            serializedName: 'properties.spotExpirationTime',
            type: {
              name: 'DateTime'
            }
          },
          freeOfferExpirationTime: {
            required: false,
            serializedName: 'properties.freeOfferExpirationTime',
            type: {
              name: 'DateTime'
            }
          },
          resourceGroup: {
            required: false,
            readOnly: true,
            serializedName: 'properties.resourceGroup',
            type: {
              name: 'String'
            }
          },
          reserved: {
            required: false,
            serializedName: 'properties.reserved',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          isXenon: {
            required: false,
            serializedName: 'properties.isXenon',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          hyperV: {
            required: false,
            serializedName: 'properties.hyperV',
            defaultValue: false,
            type: {
              name: 'Boolean'
            }
          },
          targetWorkerCount: {
            required: false,
            serializedName: 'properties.targetWorkerCount',
            type: {
              name: 'Number'
            }
          },
          targetWorkerSizeId: {
            required: false,
            serializedName: 'properties.targetWorkerSizeId',
            type: {
              name: 'Number'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'Enum',
              allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ]
            }
          },
          sku: {
            required: false,
            serializedName: 'sku',
            type: {
              name: 'Composite',
              className: 'SkuDescription'
            }
          }
        }
      }
    };
  }
}

module.exports = AppServicePlan;
