Class: OCI::Audit::Models::Request
- Inherits:
-
Object
- Object
- OCI::Audit::Models::Request
- Defined in:
- lib/oci/audit/models/request.rb
Overview
A container object for request attributes.
Example:
-----
{
\"id\": \"<unique_ID>\",
\"path\": \"/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\",
\"action\": \"GET\",
\"parameters\": {},
\"headers\": {
\"opc-principal\": [
\"{\\\"tenantId\\\":\\\"ocid1.tenancy.oc1..<unique_ID>\\\",\\\"subjectId\\\":\\\"ocid1.user.oc1..<unique_ID>\\\",\\\"claims\\\":[{\\\"key\\\":\\\"pstype\\\",\\\"value\\\":\\\"natv\\\",\\\"issuer\\\":\\\"authService.oracle.com\\\"},{\\\"key\\\":\\\"h_host\\\",\\\"value\\\":\\\"iaas.r2.oracleiaas.com\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_opc-request-id\\\",\\\"value\\\":\\\"<unique_ID>\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"ptype\\\",\\\"value\\\":\\\"user\\\",\\\"issuer\\\":\\\"authService.oracle.com\\\"},{\\\"key\\\":\\\"h_date\\\",\\\"value\\\":\\\"Wed, 18 Sep 2019 00:10:58 UTC\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_accept\\\",\\\"value\\\":\\\"application/json\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"authorization\\\",\\\"value\\\":\\\"Signature headers=\\\\\\\"date (request-target) host accept opc-request-id\\\\\\\",keyId=\\\\\\\"ocid1.tenancy.oc1..<unique_ID>/ocid1.user.oc1..<unique_ID>/8c:b4:5f:18:e7:ec:db:08:b8:fa:d2:2a:7d:11:76:ac\\\\\\\",algorithm=\\\\\\\"rsa-pss-sha256\\\\\\\",signature=\\\\\\\"<unique_ID>\\\\\\\",version=\\\\\\\"1\\\\\\\"\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_(request-target)\\\",\\\"value\\\":\\\"get /20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\\\",\\\"issuer\\\":\\\"h\\\"}]}\"
],
\"Accept\": [
\"application/json\"
],
\"X-Oracle-Auth-Client-CN\": [
\"splat-proxy-se-02302.node.ad2.r2\"
],
\"X-Forwarded-Host\": [
\"compute-api.svc.ad1.r2\"
],
\"Connection\": [
\"close\"
],
\"User-Agent\": [
\"Jersey/2.23 (HttpUrlConnection 1.8.0_212)\"
],
\"X-Forwarded-For\": [
\"172.24.80.88\"
],
\"X-Real-IP\": [
\"172.24.80.88\"
],
\"oci-original-url\": [
\"https://iaas.r2.oracleiaas.com/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\"
],
\"opc-request-id\": [
\"<unique_ID>\"
],
\"Date\": [
\"Wed, 18 Sep 2019 00:10:58 UTC\"
]
}
}
-----
Instance Attribute Summary collapse
-
#action ⇒ String
The HTTP method of the request.
-
#headers ⇒ Hash<String, Array<String>>
The HTTP header fields and values in the request.
-
#id ⇒ String
The opc-request-id of the request.
-
#parameters ⇒ Hash<String, Array<String>>
The parameters supplied by the caller during this operation.
-
#path ⇒ String
The full path of the API request.
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 = {}) ⇒ Request
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 = {}) ⇒ Request
Initializes the object
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/oci/audit/models/request.rb', line 162 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.id = attributes[:'id'] if attributes[:'id'] self.path = attributes[:'path'] if attributes[:'path'] self.action = attributes[:'action'] if attributes[:'action'] self.parameters = attributes[:'parameters'] if attributes[:'parameters'] self.headers = attributes[:'headers'] if attributes[:'headers'] end |
Instance Attribute Details
#action ⇒ String
The HTTP method of the request.
Example: ‘GET`
73 74 75 |
# File 'lib/oci/audit/models/request.rb', line 73 def action @action end |
#headers ⇒ Hash<String, Array<String>>
The HTTP header fields and values in the request.
Example:
-----
{
\"opc-principal\": [
\"{\\\"tenantId\\\":\\\"ocid1.tenancy.oc1..<unique_ID>\\\",\\\"subjectId\\\":\\\"ocid1.user.oc1..<unique_ID>\\\",\\\"claims\\\":[{\\\"key\\\":\\\"pstype\\\",\\\"value\\\":\\\"natv\\\",\\\"issuer\\\":\\\"authService.oracle.com\\\"},{\\\"key\\\":\\\"h_host\\\",\\\"value\\\":\\\"iaas.r2.oracleiaas.com\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_opc-request-id\\\",\\\"value\\\":\\\"<unique_ID>\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"ptype\\\",\\\"value\\\":\\\"user\\\",\\\"issuer\\\":\\\"authService.oracle.com\\\"},{\\\"key\\\":\\\"h_date\\\",\\\"value\\\":\\\"Wed, 18 Sep 2019 00:10:58 UTC\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_accept\\\",\\\"value\\\":\\\"application/json\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"authorization\\\",\\\"value\\\":\\\"Signature headers=\\\\\\\"date (request-target) host accept opc-request-id\\\\\\\",keyId=\\\\\\\"ocid1.tenancy.oc1..<unique_ID>/ocid1.user.oc1..<unique_ID>/8c:b4:5f:18:e7:ec:db:08:b8:fa:d2:2a:7d:11:76:ac\\\\\\\",algorithm=\\\\\\\"rsa-pss-sha256\\\\\\\",signature=\\\\\\\"<unique_ID>\\\\\\\",version=\\\\\\\"1\\\\\\\"\\\",\\\"issuer\\\":\\\"h\\\"},{\\\"key\\\":\\\"h_(request-target)\\\",\\\"value\\\":\\\"get /20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\\\",\\\"issuer\\\":\\\"h\\\"}]}\"
],
\"Accept\": [
\"application/json\"
],
\"X-Oracle-Auth-Client-CN\": [
\"splat-proxy-se-02302.node.ad2.r2\"
],
\"X-Forwarded-Host\": [
\"compute-api.svc.ad1.r2\"
],
\"Connection\": [
\"close\"
],
\"User-Agent\": [
\"Jersey/2.23 (HttpUrlConnection 1.8.0_212)\"
],
\"X-Forwarded-For\": [
\"172.24.80.88\"
],
\"X-Real-IP\": [
\"172.24.80.88\"
],
\"oci-original-url\": [
\"https://iaas.r2.oracleiaas.com/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>\"
],
\"opc-request-id\": [
\"<unique_ID>\"
],
\"Date\": [
\"Wed, 18 Sep 2019 00:10:58 UTC\"
]
}
-----
123 124 125 |
# File 'lib/oci/audit/models/request.rb', line 123 def headers @headers end |
#id ⇒ String
The opc-request-id of the request.
59 60 61 |
# File 'lib/oci/audit/models/request.rb', line 59 def id @id end |
#parameters ⇒ Hash<String, Array<String>>
The parameters supplied by the caller during this operation.
78 79 80 |
# File 'lib/oci/audit/models/request.rb', line 78 def parameters @parameters end |
#path ⇒ String
The full path of the API request.
Example: ‘/20160918/instances/ocid1.instance.oc1.phx.<unique_ID>`
66 67 68 |
# File 'lib/oci/audit/models/request.rb', line 66 def path @path end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/oci/audit/models/request.rb', line 126 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'path': :'path', 'action': :'action', 'parameters': :'parameters', 'headers': :'headers' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/oci/audit/models/request.rb', line 139 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'path': :'String', 'action': :'String', 'parameters': :'Hash<String, Array<String>>', 'headers': :'Hash<String, Array<String>>' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
186 187 188 189 190 191 192 193 194 195 |
# File 'lib/oci/audit/models/request.rb', line 186 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && path == other.path && action == other.action && parameters == other.parameters && headers == other.headers end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/oci/audit/models/request.rb', line 220 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
200 201 202 |
# File 'lib/oci/audit/models/request.rb', line 200 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
209 210 211 |
# File 'lib/oci/audit/models/request.rb', line 209 def hash [id, path, action, parameters, headers].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
253 254 255 256 257 258 259 260 261 262 |
# File 'lib/oci/audit/models/request.rb', line 253 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
247 248 249 |
# File 'lib/oci/audit/models/request.rb', line 247 def to_s to_hash.to_s end |