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

/**
 * Describes azure managed provider.
 *
 * @extends models['ManagedRuleSet']
 */
class AzureManagedRuleSet extends models['ManagedRuleSet'] {
  /**
   * Create a AzureManagedRuleSet.
   * @member {array} [ruleGroupOverrides] List of azure managed provider
   * override configuration (optional)
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of AzureManagedRuleSet
   *
   * @returns {object} metadata of AzureManagedRuleSet
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AzureManagedRuleSet',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'ruleSetType',
          clientName: 'ruleSetType'
        },
        uberParent: 'ManagedRuleSet',
        className: 'AzureManagedRuleSet',
        modelProperties: {
          priority: {
            required: false,
            serializedName: 'priority',
            type: {
              name: 'Number'
            }
          },
          version: {
            required: false,
            serializedName: 'version',
            type: {
              name: 'Number'
            }
          },
          ruleSetType: {
            required: true,
            serializedName: 'ruleSetType',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          ruleGroupOverrides: {
            required: false,
            serializedName: 'ruleGroupOverrides',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'AzureManagedOverrideRuleGroupElementType',
                  type: {
                    name: 'Composite',
                    className: 'AzureManagedOverrideRuleGroup'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = AzureManagedRuleSet;
