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

/**
 * Application gateway web application firewall configuration.
 *
 */
class ApplicationGatewayWebApplicationFirewallConfiguration {
  /**
   * Create a ApplicationGatewayWebApplicationFirewallConfiguration.
   * @property {boolean} enabled Whether the web application firewall is
   * enabled or not.
   * @property {string} firewallMode Web application firewall mode. Possible
   * values include: 'Detection', 'Prevention'
   * @property {string} ruleSetType The type of the web application firewall
   * rule set. Possible values are: 'OWASP'.
   * @property {string} ruleSetVersion The version of the rule set type.
   * @property {array} [disabledRuleGroups] The disabled rule groups.
   * @property {boolean} [requestBodyCheck] Whether allow WAF to check request
   * Body.
   * @property {number} [maxRequestBodySize] Maximum request body size for WAF.
   * @property {number} [maxRequestBodySizeInKb] Maximum request body size in
   * Kb for WAF.
   * @property {number} [fileUploadLimitInMb] Maximum file upload size in Mb
   * for WAF.
   * @property {array} [exclusions] The exclusion list.
   */
  constructor() {
  }

  /**
   * Defines the metadata of ApplicationGatewayWebApplicationFirewallConfiguration
   *
   * @returns {object} metadata of ApplicationGatewayWebApplicationFirewallConfiguration
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayWebApplicationFirewallConfiguration',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayWebApplicationFirewallConfiguration',
        modelProperties: {
          enabled: {
            required: true,
            serializedName: 'enabled',
            type: {
              name: 'Boolean'
            }
          },
          firewallMode: {
            required: true,
            serializedName: 'firewallMode',
            type: {
              name: 'String'
            }
          },
          ruleSetType: {
            required: true,
            serializedName: 'ruleSetType',
            type: {
              name: 'String'
            }
          },
          ruleSetVersion: {
            required: true,
            serializedName: 'ruleSetVersion',
            type: {
              name: 'String'
            }
          },
          disabledRuleGroups: {
            required: false,
            serializedName: 'disabledRuleGroups',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationGatewayFirewallDisabledRuleGroupElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationGatewayFirewallDisabledRuleGroup'
                  }
              }
            }
          },
          requestBodyCheck: {
            required: false,
            serializedName: 'requestBodyCheck',
            type: {
              name: 'Boolean'
            }
          },
          maxRequestBodySize: {
            required: false,
            serializedName: 'maxRequestBodySize',
            constraints: {
              InclusiveMaximum: 128,
              InclusiveMinimum: 8
            },
            type: {
              name: 'Number'
            }
          },
          maxRequestBodySizeInKb: {
            required: false,
            serializedName: 'maxRequestBodySizeInKb',
            constraints: {
              InclusiveMaximum: 128,
              InclusiveMinimum: 8
            },
            type: {
              name: 'Number'
            }
          },
          fileUploadLimitInMb: {
            required: false,
            serializedName: 'fileUploadLimitInMb',
            constraints: {
              InclusiveMinimum: 0
            },
            type: {
              name: 'Number'
            }
          },
          exclusions: {
            required: false,
            serializedName: 'exclusions',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationGatewayFirewallExclusionElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationGatewayFirewallExclusion'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationGatewayWebApplicationFirewallConfiguration;
