# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::Web::Mgmt::V2020_09_01
  module Models
    #
    # IP security restriction on an app.
    #
    class IpSecurityRestriction

      include MsRestAzure

      # @return [String] 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.
      attr_accessor :ip_address

      # @return [String] Subnet mask for the range of IP addresses the
      # restriction is valid for.
      attr_accessor :subnet_mask

      # @return [String] Virtual network resource id
      attr_accessor :vnet_subnet_resource_id

      # @return [Integer] (internal) Vnet traffic tag
      attr_accessor :vnet_traffic_tag

      # @return [Integer] (internal) Subnet traffic tag
      attr_accessor :subnet_traffic_tag

      # @return [String] Allow or Deny access for this IP range.
      attr_accessor :action

      # @return [IpFilterTag] Defines what this IP filter will be used for.
      # This is to support IP filtering on proxies. Possible values include:
      # 'Default', 'XffProxy', 'ServiceTag'
      attr_accessor :tag

      # @return [Integer] Priority of IP restriction rule.
      attr_accessor :priority

      # @return [String] IP restriction rule name.
      attr_accessor :name

      # @return [String] IP restriction rule description.
      attr_accessor :description

      # @return [Hash{String => Array<String>}] IP restriction rule headers.
      # X-Forwarded-Host
      # (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples).
      # The matching logic is ..
      # - If the property is null or empty (default), all hosts(or lack of) are
      # allowed.
      # - A value is compared using ordinal-ignore-case (excluding port
      # number).
      # - Subdomain wildcards are permitted but don't match the root domain.
      # For example, *.contoso.com matches the subdomain foo.contoso.com
      # but not the root domain contoso.com or multi-level foo.bar.contoso.com
      # - Unicode host names are allowed but are converted to Punycode for
      # matching.
      #
      # X-Forwarded-For
      # (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples).
      # The matching logic is ..
      # - If the property is null or empty (default), any forwarded-for chains
      # (or lack of) are allowed.
      # - If any address (excluding port number) in the chain (comma separated)
      # matches the CIDR defined by the property.
      #
      # X-Azure-FDID and X-FD-HealthProbe.
      # The matching logic is exact match.
      attr_accessor :headers


      #
      # Mapper for IpSecurityRestriction class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'IpSecurityRestriction',
          type: {
            name: 'Composite',
            class_name: 'IpSecurityRestriction',
            model_properties: {
              ip_address: {
                client_side_validation: true,
                required: false,
                serialized_name: 'ipAddress',
                type: {
                  name: 'String'
                }
              },
              subnet_mask: {
                client_side_validation: true,
                required: false,
                serialized_name: 'subnetMask',
                type: {
                  name: 'String'
                }
              },
              vnet_subnet_resource_id: {
                client_side_validation: true,
                required: false,
                serialized_name: 'vnetSubnetResourceId',
                type: {
                  name: 'String'
                }
              },
              vnet_traffic_tag: {
                client_side_validation: true,
                required: false,
                serialized_name: 'vnetTrafficTag',
                type: {
                  name: 'Number'
                }
              },
              subnet_traffic_tag: {
                client_side_validation: true,
                required: false,
                serialized_name: 'subnetTrafficTag',
                type: {
                  name: 'Number'
                }
              },
              action: {
                client_side_validation: true,
                required: false,
                serialized_name: 'action',
                type: {
                  name: 'String'
                }
              },
              tag: {
                client_side_validation: true,
                required: false,
                serialized_name: 'tag',
                type: {
                  name: 'String'
                }
              },
              priority: {
                client_side_validation: true,
                required: false,
                serialized_name: 'priority',
                type: {
                  name: 'Number'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              description: {
                client_side_validation: true,
                required: false,
                serialized_name: 'description',
                type: {
                  name: 'String'
                }
              },
              headers: {
                client_side_validation: true,
                required: false,
                serialized_name: 'headers',
                type: {
                  name: 'Dictionary',
                  value: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'ArrayElementType',
                      type: {
                        name: 'Sequence',
                        element: {
                            client_side_validation: true,
                            required: false,
                            serialized_name: 'StringElementType',
                            type: {
                              name: 'String'
                            }
                        }
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
