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

/**
 * A frontend endpoint used for routing.
 *
 * @extends models['SubResource']
 */
class FrontendEndpoint extends models['SubResource'] {
  /**
   * Create a FrontendEndpoint.
   * @member {string} [hostName] The host name of the frontendEndpoint. Must be
   * a domain name.
   * @member {string} [sessionAffinityEnabledState] Whether to allow session
   * affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible
   * values include: 'Enabled', 'Disabled'
   * @member {number} [sessionAffinityTtlSeconds] UNUSED. This field will be
   * ignored. The TTL to use in seconds for session affinity, if applicable.
   * @member {object} [webApplicationFirewallPolicyLink] Defines the Web
   * Application Firewall policy for each host (if applicable)
   * @member {string} [webApplicationFirewallPolicyLink.id] Resource ID.
   * @member {string} [resourceState] Resource status. Possible values include:
   * 'Creating', 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Deleting'
   * @member {string} [customHttpsProvisioningState] Provisioning status of
   * Custom Https of the frontendEndpoint. Possible values include: 'Enabling',
   * 'Enabled', 'Disabling', 'Disabled', 'Failed'
   * @member {string} [customHttpsProvisioningSubstate] Provisioning substate
   * shows the progress of custom HTTPS enabling/disabling process step by
   * step. Possible values include: 'SubmittingDomainControlValidationRequest',
   * 'PendingDomainControlValidationREquestApproval',
   * 'DomainControlValidationRequestApproved',
   * 'DomainControlValidationRequestRejected',
   * 'DomainControlValidationRequestTimedOut', 'IssuingCertificate',
   * 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate',
   * 'CertificateDeleted'
   * @member {object} [customHttpsConfiguration] The configuration specifying
   * how to enable HTTPS
   * @member {string} [customHttpsConfiguration.certificateSource] Defines the
   * source of the SSL certificate. Possible values include: 'AzureKeyVault',
   * 'FrontDoor'
   * @member {string} [customHttpsConfiguration.protocolType] Defines the TLS
   * extension protocol that is used for secure delivery. Possible values
   * include: 'ServerNameIndication'
   * @member {object} [customHttpsConfiguration.vault] The Key Vault containing
   * the SSL certificate
   * @member {string} [customHttpsConfiguration.vault.id] Resource ID.
   * @member {string} [customHttpsConfiguration.secretName] The name of the Key
   * Vault secret representing the full certificate PFX
   * @member {string} [customHttpsConfiguration.secretVersion] The version of
   * the Key Vault secret representing the full certificate PFX
   * @member {string} [customHttpsConfiguration.certificateType] Defines the
   * type of the certificate used for secure connections to a frontendEndpoint.
   * Possible values include: 'Dedicated'
   * @member {string} [name] Resource name.
   * @member {string} [type] Resource type.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of FrontendEndpoint
   *
   * @returns {object} metadata of FrontendEndpoint
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'FrontendEndpoint',
      type: {
        name: 'Composite',
        className: 'FrontendEndpoint',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          hostName: {
            required: false,
            serializedName: 'properties.hostName',
            type: {
              name: 'String'
            }
          },
          sessionAffinityEnabledState: {
            required: false,
            serializedName: 'properties.sessionAffinityEnabledState',
            type: {
              name: 'String'
            }
          },
          sessionAffinityTtlSeconds: {
            required: false,
            serializedName: 'properties.sessionAffinityTtlSeconds',
            type: {
              name: 'Number'
            }
          },
          webApplicationFirewallPolicyLink: {
            required: false,
            serializedName: 'properties.webApplicationFirewallPolicyLink',
            type: {
              name: 'Composite',
              className: 'FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink'
            }
          },
          resourceState: {
            required: false,
            serializedName: 'properties.resourceState',
            type: {
              name: 'String'
            }
          },
          customHttpsProvisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.customHttpsProvisioningState',
            type: {
              name: 'String'
            }
          },
          customHttpsProvisioningSubstate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.customHttpsProvisioningSubstate',
            type: {
              name: 'String'
            }
          },
          customHttpsConfiguration: {
            required: false,
            readOnly: true,
            serializedName: 'properties.customHttpsConfiguration',
            type: {
              name: 'Composite',
              className: 'CustomHttpsConfiguration'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = FrontendEndpoint;
