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

/**
 * Rules that can be defined for auto-heal.
 *
 */
class AutoHealRules {
  /**
   * Create a AutoHealRules.
   * @member {object} [triggers] Conditions that describe when to execute the
   * auto-heal actions.
   * @member {object} [triggers.requests] A rule based on total requests.
   * @member {number} [triggers.requests.count] Request Count.
   * @member {string} [triggers.requests.timeInterval] Time interval.
   * @member {number} [triggers.privateBytesInKB] A rule based on private
   * bytes.
   * @member {array} [triggers.statusCodes] A rule based on status codes.
   * @member {object} [triggers.slowRequests] A rule based on request execution
   * time.
   * @member {string} [triggers.slowRequests.timeTaken] Time taken.
   * @member {number} [triggers.slowRequests.count] Request Count.
   * @member {string} [triggers.slowRequests.timeInterval] Time interval.
   * @member {object} [actions] Actions to be executed when a rule is
   * triggered.
   * @member {string} [actions.actionType] Predefined action to be taken.
   * Possible values include: 'Recycle', 'LogEvent', 'CustomAction'
   * @member {object} [actions.customAction] Custom action to be taken.
   * @member {string} [actions.customAction.exe] Executable to be run.
   * @member {string} [actions.customAction.parameters] Parameters for the
   * executable.
   * @member {string} [actions.minProcessExecutionTime] Minimum time the
   * process must execute
   * before taking the action
   */
  constructor() {
  }

  /**
   * Defines the metadata of AutoHealRules
   *
   * @returns {object} metadata of AutoHealRules
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AutoHealRules',
      type: {
        name: 'Composite',
        className: 'AutoHealRules',
        modelProperties: {
          triggers: {
            required: false,
            serializedName: 'triggers',
            type: {
              name: 'Composite',
              className: 'AutoHealTriggers'
            }
          },
          actions: {
            required: false,
            serializedName: 'actions',
            type: {
              name: 'Composite',
              className: 'AutoHealActions'
            }
          }
        }
      }
    };
  }
}

module.exports = AutoHealRules;
