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

/**
 * Backend address of a frontDoor load balancer.
 *
 */
class Backend {
  /**
   * Create a Backend.
   * @member {string} [address] Location of the backend (IP address or FQDN)
   * @member {number} [httpPort] The HTTP TCP port number. Must be between 1
   * and 65535.
   * @member {number} [httpsPort] The HTTPS TCP port number. Must be between 1
   * and 65535.
   * @member {string} [enabledState] Whether to enable use of this backend.
   * Permitted values are 'Enabled' or 'Disabled'. Possible values include:
   * 'Enabled', 'Disabled'
   * @member {number} [priority] Priority to use for load balancing. Higher
   * priorities will not be used for load balancing if any lower priority
   * backend is healthy.
   * @member {number} [weight] Weight of this endpoint for load balancing
   * purposes.
   * @member {string} [backendHostHeader] The value to use as the host header
   * sent to the backend. If blank or unspecified, this defaults to the
   * incoming host.
   */
  constructor() {
  }

  /**
   * Defines the metadata of Backend
   *
   * @returns {object} metadata of Backend
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'Backend',
      type: {
        name: 'Composite',
        className: 'Backend',
        modelProperties: {
          address: {
            required: false,
            serializedName: 'address',
            type: {
              name: 'String'
            }
          },
          httpPort: {
            required: false,
            serializedName: 'httpPort',
            constraints: {
              InclusiveMaximum: 65535,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          httpsPort: {
            required: false,
            serializedName: 'httpsPort',
            constraints: {
              InclusiveMaximum: 65535,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          enabledState: {
            required: false,
            serializedName: 'enabledState',
            type: {
              name: 'String'
            }
          },
          priority: {
            required: false,
            serializedName: 'priority',
            constraints: {
              InclusiveMaximum: 5,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          weight: {
            required: false,
            serializedName: 'weight',
            constraints: {
              InclusiveMaximum: 1000,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          },
          backendHostHeader: {
            required: false,
            serializedName: 'backendHostHeader',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = Backend;
