/*
 * 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 web application firewall rule set.
 *
 * @extends models['Resource']
 */
class ApplicationGatewayFirewallRuleSet extends models['Resource'] {
  /**
   * Create a ApplicationGatewayFirewallRuleSet.
   * @property {string} [provisioningState] The provisioning state of the web
   * application firewall rule set.
   * @property {string} ruleSetType The type of the web application firewall
   * rule set.
   * @property {string} ruleSetVersion The version of the web application
   * firewall rule set type.
   * @property {array} ruleGroups The rule groups of the web application
   * firewall rule set.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicationGatewayFirewallRuleSet
   *
   * @returns {object} metadata of ApplicationGatewayFirewallRuleSet
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationGatewayFirewallRuleSet',
      type: {
        name: 'Composite',
        className: 'ApplicationGatewayFirewallRuleSet',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          location: {
            required: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          provisioningState: {
            required: false,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          ruleSetType: {
            required: true,
            serializedName: 'properties.ruleSetType',
            type: {
              name: 'String'
            }
          },
          ruleSetVersion: {
            required: true,
            serializedName: 'properties.ruleSetVersion',
            type: {
              name: 'String'
            }
          },
          ruleGroups: {
            required: true,
            serializedName: 'properties.ruleGroups',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'ApplicationGatewayFirewallRuleGroupElementType',
                  type: {
                    name: 'Composite',
                    className: 'ApplicationGatewayFirewallRuleGroup'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationGatewayFirewallRuleSet;
