Class: OCI::Waas::Models::AccessRuleCriteria
- Inherits:
-
Object
- Object
- OCI::Waas::Models::AccessRuleCriteria
- Defined in:
- lib/oci/waas/models/access_rule_criteria.rb
Overview
AccessRuleCriteria model.
Constant Summary collapse
- CONDITION_ENUM =
[ CONDITION_URL_IS = 'URL_IS'.freeze, CONDITION_URL_IS_NOT = 'URL_IS_NOT'.freeze, CONDITION_URL_STARTS_WITH = 'URL_STARTS_WITH'.freeze, CONDITION_URL_PART_ENDS_WITH = 'URL_PART_ENDS_WITH'.freeze, CONDITION_URL_PART_CONTAINS = 'URL_PART_CONTAINS'.freeze, CONDITION_URL_REGEX = 'URL_REGEX'.freeze, CONDITION_IP_IS = 'IP_IS'.freeze, CONDITION_IP_IS_NOT = 'IP_IS_NOT'.freeze, CONDITION_HTTP_HEADER_CONTAINS = 'HTTP_HEADER_CONTAINS'.freeze, CONDITION_IP_IN_LIST = 'IP_IN_LIST'.freeze, CONDITION_IP_NOT_IN_LIST = 'IP_NOT_IN_LIST'.freeze, CONDITION_HTTP_METHOD_IS = 'HTTP_METHOD_IS'.freeze, CONDITION_HTTP_METHOD_IS_NOT = 'HTTP_METHOD_IS_NOT'.freeze, CONDITION_COUNTRY_IS = 'COUNTRY_IS'.freeze, CONDITION_COUNTRY_IS_NOT = 'COUNTRY_IS_NOT'.freeze, CONDITION_USER_AGENT_IS = 'USER_AGENT_IS'.freeze, CONDITION_USER_AGENT_IS_NOT = 'USER_AGENT_IS_NOT'.freeze, CONDITION_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#condition ⇒ String
[Required] The criteria the access rule uses to determine if action should be taken on a request.
-
#value ⇒ String
[Required] The criteria value.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AccessRuleCriteria
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ AccessRuleCriteria
Initializes the object
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 101 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.condition = attributes[:'condition'] if attributes[:'condition'] self.value = attributes[:'value'] if attributes[:'value'] end |
Instance Attribute Details
#condition ⇒ String
[Required] The criteria the access rule uses to determine if action should be taken on a request.
-
URL_IS: Matches if the concatenation of request URL path and query is identical to the contents of the ‘value` field.
-
URL_IS_NOT: Matches if the concatenation of request URL path and query is not identical to the contents of the ‘value` field.
-
URL_STARTS_WITH: Matches if the concatenation of request URL path and query starts with the contents of the ‘value` field.
-
URL_PART_ENDS_WITH: Matches if the concatenation of request URL path and query ends with the contents of the ‘value` field.
-
URL_PART_CONTAINS: Matches if the concatenation of request URL path and query contains the contents of the ‘value` field.
-
URL_REGEX: Matches if the request is described by the regular expression in the ‘value` field.
-
IP_IS: Matches if the request originates from an IP address in the ‘value` field.
-
IP_IS_NOT: Matches if the request does not originate from an IP address in the ‘value` field.
-
HTTP_HEADER_CONTAINS: The HTTP_HEADER_CONTAINS criteria is defined using a compound value separated by a colon: a header field name and a header field value. ‘host:test.example.com` is an example of a criteria value where `host` is the header field name and `test.example.com` is the header field value. A request matches when the header field name is a case insensitive match and the header field value is a case insensitive, substring match.
Example: With a criteria value of ‘host:test.example.com`, where `host` is the name of the field and `test.example.com` is the value of the host field, a request with the header values, `Host: www.test.example.com` will match, where as a request with header values of `host: www.example.com` or `host: test.sub.example.com` will not match.
-
IP_IN_LIST: Matches if the request originates from one of the IP addresses contained in the referenced address list. The ‘value` in this case is OCID of the address list.
-
IP_NOT_IN_LIST: Matches if the request does not originate from any IP address contained in the referenced address list. The ‘value` field in this case is OCID of the address list.
-
HTTP_METHOD_IS: Matches if the request method corresponds to the ‘value` field. The list of available methods: `GET`, `HEAD`, `POST`, `PUT`, `DELETE`, `CONNECT`, `OPTIONS`, `TRACE`, `PATCH`
-
HTTP_METHOD_IS_NOT: Matches if the request method does not correspond to the ‘value` field. The list of available methods: `GET`, `HEAD`, `POST`, `PUT`, `DELETE`, `CONNECT`, `OPTIONS`, `TRACE`, `PATCH`
-
COUNTRY_IS: Matches if the request originates from a country in the ‘value` field. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see [ISO’s website](www.iso.org/obp/ui/#search/code/).
-
COUNTRY_IS_NOT: Matches if the request does not originate from a country in the ‘value` field. Country codes are in ISO 3166-1 alpha-2 format. For a list of codes, see [ISO’s website](www.iso.org/obp/ui/#search/code/).
-
USER_AGENT_IS: Matches if the requesting user agent is identical to the contents of the ‘value` field. Example: `Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0`
-
USER_AGENT_IS_NOT: Matches if the requesting user agent is not identical to the contents of the ‘value` field. Example: `Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0`
67 68 69 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 67 def condition @condition end |
#value ⇒ String
[Required] The criteria value.
71 72 73 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 71 def value @value end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
74 75 76 77 78 79 80 81 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 74 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'condition': :'condition', 'value': :'value' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
84 85 86 87 88 89 90 91 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 84 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'condition': :'String', 'value': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
132 133 134 135 136 137 138 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 132 def ==(other) return true if equal?(other) self.class == other.class && condition == other.condition && value == other.value end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 163 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
143 144 145 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 143 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
152 153 154 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 152 def hash [condition, value].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
196 197 198 199 200 201 202 203 204 205 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 196 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
190 191 192 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 190 def to_s to_hash.to_s end |