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

const models = require('./index');

/**
 * Class representing a Traffic Manager profile.
 *
 * @extends models['TrackedResource']
 */
class Profile extends models['TrackedResource'] {
  /**
   * Create a Profile.
   * @member {string} [profileStatus] The status of the Traffic Manager
   * profile. Possible values include: 'Enabled', 'Disabled'
   * @member {string} [trafficRoutingMethod] The traffic routing method of the
   * Traffic Manager profile. Possible values include: 'Performance',
   * 'Priority', 'Weighted', 'Geographic', 'MultiValue', 'Subnet'
   * @member {object} [dnsConfig] The DNS settings of the Traffic Manager
   * profile.
   * @member {string} [dnsConfig.relativeName] The relative DNS name provided
   * by this Traffic Manager profile. This value is combined with the DNS
   * domain name used by Azure Traffic Manager to form the fully-qualified
   * domain name (FQDN) of the profile.
   * @member {string} [dnsConfig.fqdn] The fully-qualified domain name (FQDN)
   * of the Traffic Manager profile. This is formed from the concatenation of
   * the RelativeName with the DNS domain used by Azure Traffic Manager.
   * @member {number} [dnsConfig.ttl] The DNS Time-To-Live (TTL), in seconds.
   * This informs the local DNS resolvers and DNS clients how long to cache DNS
   * responses provided by this Traffic Manager profile.
   * @member {object} [monitorConfig] The endpoint monitoring settings of the
   * Traffic Manager profile.
   * @member {string} [monitorConfig.profileMonitorStatus] The profile-level
   * monitoring status of the Traffic Manager profile. Possible values include:
   * 'CheckingEndpoints', 'Online', 'Degraded', 'Disabled', 'Inactive'
   * @member {string} [monitorConfig.protocol] The protocol (HTTP, HTTPS or
   * TCP) used to probe for endpoint health. Possible values include: 'HTTP',
   * 'HTTPS', 'TCP'
   * @member {number} [monitorConfig.port] The TCP port used to probe for
   * endpoint health.
   * @member {string} [monitorConfig.path] The path relative to the endpoint
   * domain name used to probe for endpoint health.
   * @member {number} [monitorConfig.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} [monitorConfig.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} [monitorConfig.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} [monitorConfig.customHeaders] List of custom headers.
   * @member {array} [monitorConfig.expectedStatusCodeRanges] List of expected
   * status code ranges.
   * @member {array} [endpoints] The list of endpoints in the Traffic Manager
   * profile.
   * @member {string} [trafficViewEnrollmentStatus] Indicates whether Traffic
   * View is 'Enabled' or 'Disabled' for the Traffic Manager profile. Null,
   * indicates 'Disabled'. Enabling this feature will increase the cost of the
   * Traffic Manage profile. Possible values include: 'Enabled', 'Disabled'
   * @member {number} [maxReturn] Maximum number of endpoints to be returned
   * for MultiValue routing type.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of Profile
   *
   * @returns {object} metadata of Profile
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Profile',
      type: {
        name: 'Composite',
        className: 'Profile',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          profileStatus: {
            required: false,
            serializedName: 'properties.profileStatus',
            type: {
              name: 'String'
            }
          },
          trafficRoutingMethod: {
            required: false,
            serializedName: 'properties.trafficRoutingMethod',
            type: {
              name: 'String'
            }
          },
          dnsConfig: {
            required: false,
            serializedName: 'properties.dnsConfig',
            type: {
              name: 'Composite',
              className: 'DnsConfig'
            }
          },
          monitorConfig: {
            required: false,
            serializedName: 'properties.monitorConfig',
            type: {
              name: 'Composite',
              className: 'MonitorConfig'
            }
          },
          endpoints: {
            required: false,
            serializedName: 'properties.endpoints',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'EndpointElementType',
                  type: {
                    name: 'Composite',
                    className: 'Endpoint'
                  }
              }
            }
          },
          trafficViewEnrollmentStatus: {
            required: false,
            serializedName: 'properties.trafficViewEnrollmentStatus',
            type: {
              name: 'String'
            }
          },
          maxReturn: {
            required: false,
            serializedName: 'properties.maxReturn',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = Profile;
