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

/**
 * Description of NetworkRuleSet resource.
 *
 * @extends models['Resource']
 */
class NetworkRuleSet extends models['Resource'] {
  /**
   * Create a NetworkRuleSet.
   * @property {string} [defaultAction] Default Action for Network Rule Set.
   * Possible values include: 'Allow', 'Deny'
   * @property {array} [virtualNetworkRules] List VirtualNetwork Rules
   * @property {array} [ipRules] List of IpRules
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of NetworkRuleSet
   *
   * @returns {object} metadata of NetworkRuleSet
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'NetworkRuleSet',
      type: {
        name: 'Composite',
        className: 'NetworkRuleSet',
        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'
            }
          },
          defaultAction: {
            required: false,
            serializedName: 'properties.defaultAction',
            type: {
              name: 'String'
            }
          },
          virtualNetworkRules: {
            required: false,
            serializedName: 'properties.virtualNetworkRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'NWRuleSetVirtualNetworkRulesElementType',
                  type: {
                    name: 'Composite',
                    className: 'NWRuleSetVirtualNetworkRules'
                  }
              }
            }
          },
          ipRules: {
            required: false,
            serializedName: 'properties.ipRules',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'NWRuleSetIpRulesElementType',
                  type: {
                    name: 'Composite',
                    className: 'NWRuleSetIpRules'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = NetworkRuleSet;
