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

/**
 * The autoscale setting resource.
 *
 * @extends models['Resource']
 */
class AutoscaleSettingResource extends models['Resource'] {
  /**
   * Create a AutoscaleSettingResource.
   * @property {array} profiles the collection of automatic scaling profiles
   * that specify different scaling parameters for different time periods. A
   * maximum of 20 profiles can be specified.
   * @property {array} [notifications] the collection of notifications.
   * @property {boolean} [enabled] the enabled flag. Specifies whether
   * automatic scaling is enabled for the resource. The default value is
   * 'true'. Default value: true .
   * @property {string} [autoscaleSettingResourceName] the name of the
   * autoscale setting.
   * @property {string} [targetResourceUri] the resource identifier of the
   * resource that the autoscale setting should be added to.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AutoscaleSettingResource
   *
   * @returns {object} metadata of AutoscaleSettingResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AutoscaleSettingResource',
      type: {
        name: 'Composite',
        className: 'AutoscaleSettingResource',
        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'
                  }
              }
            }
          },
          profiles: {
            required: true,
            serializedName: 'properties.profiles',
            constraints: {
              MaxItems: 20
            },
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AutoscaleProfileElementType',
                  type: {
                    name: 'Composite',
                    className: 'AutoscaleProfile'
                  }
              }
            }
          },
          notifications: {
            required: false,
            serializedName: 'properties.notifications',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AutoscaleNotificationElementType',
                  type: {
                    name: 'Composite',
                    className: 'AutoscaleNotification'
                  }
              }
            }
          },
          enabled: {
            required: false,
            serializedName: 'properties.enabled',
            defaultValue: true,
            type: {
              name: 'Boolean'
            }
          },
          autoscaleSettingResourceName: {
            required: false,
            serializedName: 'properties.name',
            type: {
              name: 'String'
            }
          },
          targetResourceUri: {
            required: false,
            serializedName: 'properties.targetResourceUri',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = AutoscaleSettingResource;
