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

/**
 * Connection draining allows open connections to a backend server to be active
 * for a specified time after the backend server got removed from the
 * configuration.
 *
 */
class ApplicationGatewayConnectionDraining {
  /**
   * Create a ApplicationGatewayConnectionDraining.
   * @property {boolean} enabled Whether connection draining is enabled or not.
   * @property {number} drainTimeoutInSec The number of seconds connection
   * draining is active. Acceptable values are from 1 second to 3600 seconds.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ApplicationGatewayConnectionDraining
   *
   * @returns {object} metadata of ApplicationGatewayConnectionDraining
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayConnectionDraining',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayConnectionDraining',
        modelProperties: {
          enabled: {
            required: true,
            serializedName: 'enabled',
            type: {
              name: 'Boolean'
            }
          },
          drainTimeoutInSec: {
            required: true,
            serializedName: 'drainTimeoutInSec',
            constraints: {
              InclusiveMaximum: 3600,
              InclusiveMinimum: 1
            },
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationGatewayConnectionDraining;
