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 =
rubocop:disable Metrics/LineLength
[ 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_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
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 77 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: Matches if the request includes an HTTP header field whose name and value correspond to data specified in the ‘value` field with a separating colon. Example: `host:test.example.com` where `host` is the name of the field and `test.example.com` is the value of the host field. Comparison is independently applied to every header field whose name is a case insensitive match, and the value is required to be case-sensitive identical.
-
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`
43 44 45 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 43 def condition @condition end |
#value ⇒ String
[Required] The criteria value.
47 48 49 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 47 def value @value end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
50 51 52 53 54 55 56 57 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 50 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'condition': :'condition', 'value': :'value' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
60 61 62 63 64 65 66 67 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 60 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.
110 111 112 113 114 115 116 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 110 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
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 141 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
121 122 123 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 121 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
130 131 132 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 130 def hash [condition, value].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
174 175 176 177 178 179 180 181 182 183 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 174 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
168 169 170 |
# File 'lib/oci/waas/models/access_rule_criteria.rb', line 168 def to_s to_hash.to_s end |