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

/**
 * Describes the parameters for monitoring an upgrade in Monitored mode.
 *
 */
class MonitoringPolicyDescription {
  /**
   * Create a MonitoringPolicyDescription.
   * @property {string} [failureAction] The compensating action to perform when
   * a Monitored upgrade encounters monitoring policy or health policy
   * violations.
   * Invalid indicates the failure action is invalid. Rollback specifies that
   * the upgrade will start rolling back automatically.
   * Manual indicates that the upgrade will switch to UnmonitoredManual upgrade
   * mode. Possible values include: 'Invalid', 'Rollback', 'Manual'
   * @property {string} [healthCheckWaitDurationInMilliseconds] The amount of
   * time to wait after completing an upgrade domain before applying health
   * policies. It is first interpreted as a string representing an ISO 8601
   * duration. If that fails, then it is interpreted as a number representing
   * the total number of milliseconds.
   * @property {string} [healthCheckStableDurationInMilliseconds] The amount of
   * time that the application or cluster must remain healthy before the
   * upgrade proceeds to the next upgrade domain. It is first interpreted as a
   * string representing an ISO 8601 duration. If that fails, then it is
   * interpreted as a number representing the total number of milliseconds.
   * @property {string} [healthCheckRetryTimeoutInMilliseconds] The amount of
   * time to retry health evaluation when the application or cluster is
   * unhealthy before FailureAction is executed. It is first interpreted as a
   * string representing an ISO 8601 duration. If that fails, then it is
   * interpreted as a number representing the total number of milliseconds.
   * @property {string} [upgradeTimeoutInMilliseconds] The amount of time the
   * overall upgrade has to complete before FailureAction is executed. It is
   * first interpreted as a string representing an ISO 8601 duration. If that
   * fails, then it is interpreted as a number representing the total number of
   * milliseconds.
   * @property {string} [upgradeDomainTimeoutInMilliseconds] The amount of time
   * each upgrade domain has to complete before FailureAction is executed. It
   * is first interpreted as a string representing an ISO 8601 duration. If
   * that fails, then it is interpreted as a number representing the total
   * number of milliseconds.
   */
  constructor() {
  }

  /**
   * Defines the metadata of MonitoringPolicyDescription
   *
   * @returns {object} metadata of MonitoringPolicyDescription
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MonitoringPolicyDescription',
      type: {
        name: 'Composite',
        className: 'MonitoringPolicyDescription',
        modelProperties: {
          failureAction: {
            required: false,
            serializedName: 'FailureAction',
            type: {
              name: 'String'
            }
          },
          healthCheckWaitDurationInMilliseconds: {
            required: false,
            serializedName: 'HealthCheckWaitDurationInMilliseconds',
            type: {
              name: 'String'
            }
          },
          healthCheckStableDurationInMilliseconds: {
            required: false,
            serializedName: 'HealthCheckStableDurationInMilliseconds',
            type: {
              name: 'String'
            }
          },
          healthCheckRetryTimeoutInMilliseconds: {
            required: false,
            serializedName: 'HealthCheckRetryTimeoutInMilliseconds',
            type: {
              name: 'String'
            }
          },
          upgradeTimeoutInMilliseconds: {
            required: false,
            serializedName: 'UpgradeTimeoutInMilliseconds',
            type: {
              name: 'String'
            }
          },
          upgradeDomainTimeoutInMilliseconds: {
            required: false,
            serializedName: 'UpgradeDomainTimeoutInMilliseconds',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = MonitoringPolicyDescription;
