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

/**
 * IP security restriction on an app.
 *
 */
class IpSecurityRestriction {
  /**
   * Create a IpSecurityRestriction.
   * @member {string} ipAddress IP address the security restriction is valid
   * for.
   * It can be in form of pure ipv4 address (required SubnetMask property) or
   * CIDR notation such as ipv4/mask (leading bit match). For CIDR,
   * SubnetMask property must not be specified.
   * @member {string} [subnetMask] Subnet mask for the range of IP addresses
   * the restriction is valid for.
   * @member {string} [action] Allow or Deny access for this IP range.
   * @member {string} [tag] Defines what this IP filter will be used for. This
   * is to support IP filtering on proxies. Possible values include: 'Default',
   * 'XffProxy'
   * @member {number} [priority] Priority of IP restriction rule.
   * @member {string} [name] IP restriction rule name.
   * @member {string} [description] IP restriction rule description.
   */
  constructor() {
  }

  /**
   * Defines the metadata of IpSecurityRestriction
   *
   * @returns {object} metadata of IpSecurityRestriction
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'IpSecurityRestriction',
      type: {
        name: 'Composite',
        className: 'IpSecurityRestriction',
        modelProperties: {
          ipAddress: {
            required: true,
            serializedName: 'ipAddress',
            type: {
              name: 'String'
            }
          },
          subnetMask: {
            required: false,
            serializedName: 'subnetMask',
            type: {
              name: 'String'
            }
          },
          action: {
            required: false,
            serializedName: 'action',
            type: {
              name: 'String'
            }
          },
          tag: {
            required: false,
            serializedName: 'tag',
            type: {
              name: 'Enum',
              allowedValues: [ 'Default', 'XffProxy' ]
            }
          },
          priority: {
            required: false,
            serializedName: 'priority',
            type: {
              name: 'Number'
            }
          },
          name: {
            required: false,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          description: {
            required: false,
            serializedName: 'description',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = IpSecurityRestriction;
