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

/**
 * Http listener of an application gateway.
 *
 * @extends models['SubResource']
 */
class ApplicationGatewayHttpListener extends models['SubResource'] {
  /**
   * Create a ApplicationGatewayHttpListener.
   * @property {object} [frontendIPConfiguration] Frontend IP configuration
   * resource of an application gateway.
   * @property {string} [frontendIPConfiguration.id] Resource ID.
   * @property {object} [frontendPort] Frontend port resource of an application
   * gateway.
   * @property {string} [frontendPort.id] Resource ID.
   * @property {string} [protocol] Protocol of the HTTP listener. Possible
   * values include: 'Http', 'Https'
   * @property {string} [hostName] Host name of HTTP listener.
   * @property {object} [sslCertificate] SSL certificate resource of an
   * application gateway.
   * @property {string} [sslCertificate.id] Resource ID.
   * @property {boolean} [requireServerNameIndication] Applicable only if
   * protocol is https. Enables SNI for multi-hosting.
   * @property {string} [provisioningState] Provisioning state of the HTTP
   * listener resource. Possible values are: 'Updating', 'Deleting', and
   * 'Failed'.
   * @property {array} [customErrorConfigurations] Custom error configurations
   * of the HTTP listener.
   * @property {string} [name] Name of the HTTP listener that is unique within
   * an Application Gateway.
   * @property {string} [etag] A unique read-only string that changes whenever
   * the resource is updated.
   * @property {string} [type] Type of the resource.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicationGatewayHttpListener
   *
   * @returns {object} metadata of ApplicationGatewayHttpListener
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayHttpListener',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayHttpListener',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          frontendIPConfiguration: {
            required: false,
            serializedName: 'properties.frontendIPConfiguration',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          frontendPort: {
            required: false,
            serializedName: 'properties.frontendPort',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          protocol: {
            required: false,
            serializedName: 'properties.protocol',
            type: {
              name: 'String'
            }
          },
          hostName: {
            required: false,
            serializedName: 'properties.hostName',
            type: {
              name: 'String'
            }
          },
          sslCertificate: {
            required: false,
            serializedName: 'properties.sslCertificate',
            type: {
              name: 'Composite',
              className: 'SubResource'
            }
          },
          requireServerNameIndication: {
            required: false,
            serializedName: 'properties.requireServerNameIndication',
            type: {
              name: 'Boolean'
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          customErrorConfigurations: {
            required: false,
            serializedName: 'properties.customErrorConfigurations',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationGatewayCustomErrorElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationGatewayCustomError'
                  }
              }
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationGatewayHttpListener;
