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

/**
 * Class containing endpoint monitoring settings in a Traffic Manager profile.
 *
 */
class MonitorConfig {
  /**
   * Create a MonitorConfig.
   * @member {string} [profileMonitorStatus] The profile-level monitoring
   * status of the Traffic Manager profile. Possible values include:
   * 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive'
   * @member {string} [protocol] The protocol (HTTP, HTTPS or TCP) used to
   * probe for endpoint health. Possible values include: 'HTTP', 'HTTPS', 'TCP'
   * @member {number} [port] The TCP port used to probe for endpoint health.
   * @member {string} [path] The path relative to the endpoint domain name used
   * to probe for endpoint health.
   * @member {number} [intervalInSeconds] The monitor interval for endpoints in
   * this profile. This is the interval at which Traffic Manager will check the
   * health of each endpoint in this profile.
   * @member {number} [timeoutInSeconds] The monitor timeout for endpoints in
   * this profile. This is the time that Traffic Manager allows endpoints in
   * this profile to response to the health check.
   * @member {number} [toleratedNumberOfFailures] The number of consecutive
   * failed health check that Traffic Manager tolerates before declaring an
   * endpoint in this profile Degraded after the next failed health check.
   * @member {array} [customHeaders] List of custom headers.
   * @member {array} [expectedStatusCodeRanges] List of expected status code
   * ranges.
   */
  constructor() {
  }

  /**
   * Defines the metadata of MonitorConfig
   *
   * @returns {object} metadata of MonitorConfig
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'MonitorConfig',
      type: {
        name: 'Composite',
        className: 'MonitorConfig',
        modelProperties: {
          profileMonitorStatus: {
            required: false,
            serializedName: 'profileMonitorStatus',
            type: {
              name: 'String'
            }
          },
          protocol: {
            required: false,
            serializedName: 'protocol',
            type: {
              name: 'String'
            }
          },
          port: {
            required: false,
            serializedName: 'port',
            type: {
              name: 'Number'
            }
          },
          path: {
            required: false,
            serializedName: 'path',
            type: {
              name: 'String'
            }
          },
          intervalInSeconds: {
            required: false,
            serializedName: 'intervalInSeconds',
            type: {
              name: 'Number'
            }
          },
          timeoutInSeconds: {
            required: false,
            serializedName: 'timeoutInSeconds',
            type: {
              name: 'Number'
            }
          },
          toleratedNumberOfFailures: {
            required: false,
            serializedName: 'toleratedNumberOfFailures',
            type: {
              name: 'Number'
            }
          },
          customHeaders: {
            required: false,
            serializedName: 'customHeaders',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MonitorConfigCustomHeadersItemElementType',
                  type: {
                    name: 'Composite',
                    className: 'MonitorConfigCustomHeadersItem'
                  }
              }
            }
          },
          expectedStatusCodeRanges: {
            required: false,
            serializedName: 'expectedStatusCodeRanges',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'MonitorConfigExpectedStatusCodeRangesItemElementType',
                  type: {
                    name: 'Composite',
                    className: 'MonitorConfigExpectedStatusCodeRangesItem'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = MonitorConfig;
