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

/**
 * Autoscale notification.
 *
 */
class AutoscaleNotification {
  /**
   * Create a AutoscaleNotification.
   * @property {object} [email] the email notification.
   * @property {boolean} [email.sendToSubscriptionAdministrator] a value
   * indicating whether to send email to subscription administrator.
   * @property {boolean} [email.sendToSubscriptionCoAdministrators] a value
   * indicating whether to send email to subscription co-administrators.
   * @property {array} [email.customEmails] the custom e-mails list. This value
   * can be null or empty, in which case this attribute will be ignored.
   * @property {array} [webhooks] the collection of webhook notifications.
   */
  constructor() {
  }

  /**
   * Defines the metadata of AutoscaleNotification
   *
   * @returns {object} metadata of AutoscaleNotification
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AutoscaleNotification',
      type: {
        name: 'Composite',
        className: 'AutoscaleNotification',
        modelProperties: {
          operation: {
            required: true,
            isConstant: true,
            serializedName: 'operation',
            defaultValue: 'Scale',
            type: {
              name: 'String'
            }
          },
          email: {
            required: false,
            serializedName: 'email',
            type: {
              name: 'Composite',
              className: 'EmailNotification'
            }
          },
          webhooks: {
            required: false,
            serializedName: 'webhooks',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'WebhookNotificationElementType',
                  type: {
                    name: 'Composite',
                    className: 'WebhookNotification'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = AutoscaleNotification;
