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

/**
 * Triggers for auto-heal.
 *
 */
class AutoHealTriggers {
  /**
   * Create a AutoHealTriggers.
   * @member {object} [requests] A rule based on total requests.
   * @member {number} [requests.count] Request Count.
   * @member {string} [requests.timeInterval] Time interval.
   * @member {number} [privateBytesInKB] A rule based on private bytes.
   * @member {array} [statusCodes] A rule based on status codes.
   * @member {object} [slowRequests] A rule based on request execution time.
   * @member {string} [slowRequests.timeTaken] Time taken.
   * @member {number} [slowRequests.count] Request Count.
   * @member {string} [slowRequests.timeInterval] Time interval.
   */
  constructor() {
  }

  /**
   * Defines the metadata of AutoHealTriggers
   *
   * @returns {object} metadata of AutoHealTriggers
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AutoHealTriggers',
      type: {
        name: 'Composite',
        className: 'AutoHealTriggers',
        modelProperties: {
          requests: {
            required: false,
            serializedName: 'requests',
            type: {
              name: 'Composite',
              className: 'RequestsBasedTrigger'
            }
          },
          privateBytesInKB: {
            required: false,
            serializedName: 'privateBytesInKB',
            type: {
              name: 'Number'
            }
          },
          statusCodes: {
            required: false,
            serializedName: 'statusCodes',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StatusCodesBasedTriggerElementType',
                  type: {
                    name: 'Composite',
                    className: 'StatusCodesBasedTrigger'
                  }
              }
            }
          },
          slowRequests: {
            required: false,
            serializedName: 'slowRequests',
            type: {
              name: 'Composite',
              className: 'SlowRequestsBasedTrigger'
            }
          }
        }
      }
    };
  }
}

module.exports = AutoHealTriggers;
