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

/**
 * Defines web application firewall policy.
 *
 * @extends models['Resource']
 */
class WebApplicationFirewallPolicy1 extends models['Resource'] {
  /**
   * Create a WebApplicationFirewallPolicy1.
   * @member {object} [policySettings] Describes  policySettings for policy
   * @member {string} [policySettings.enabledState] describes if the policy is
   * in enabled state or disabled state. Possible values include: 'Disabled',
   * 'Enabled'
   * @member {string} [policySettings.mode] Describes if it is in detection
   * mode  or prevention mode at policy level. Possible values include:
   * 'Prevention', 'Detection'
   * @member {object} [customRules] Describes custom rules inside the policy
   * @member {array} [customRules.rules] List of rules
   * @member {object} [managedRules] Describes managed rules inside the policy
   * @member {array} [managedRules.ruleSets] List of rules
   * @member {string} [provisioningState] Provisioning state of the
   * WebApplicationFirewallPolicy.
   * @member {string} [resourceState] Resource status of the policy. Possible
   * values include: 'Creating', 'Enabling', 'Enabled', 'Disabling',
   * 'Disabled', 'Deleting'
   * @member {string} [etag] Gets a unique read-only string that changes
   * whenever the resource is updated.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of WebApplicationFirewallPolicy1
   *
   * @returns {object} metadata of WebApplicationFirewallPolicy1
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'WebApplicationFirewallPolicy',
      type: {
        name: 'Composite',
        className: 'WebApplicationFirewallPolicy1',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            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'
                  }
              }
            }
          },
          policySettings: {
            required: false,
            serializedName: 'properties.policySettings',
            type: {
              name: 'Composite',
              className: 'PolicySettings'
            }
          },
          customRules: {
            required: false,
            serializedName: 'properties.customRules',
            type: {
              name: 'Composite',
              className: 'CustomRules'
            }
          },
          managedRules: {
            required: false,
            serializedName: 'properties.managedRules',
            type: {
              name: 'Composite',
              className: 'ManagedRuleSets'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          resourceState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.resourceState',
            type: {
              name: 'String'
            }
          },
          etag: {
            required: false,
            serializedName: 'etag',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = WebApplicationFirewallPolicy1;
