Class: OCI::ApmSynthetics::Models::RequestAuthenticationDetails
- Inherits:
-
Object
- Object
- OCI::ApmSynthetics::Models::RequestAuthenticationDetails
- Defined in:
- lib/oci/apm_synthetics/models/request_authentication_details.rb
Overview
Details for request HTTP authentication.
Constant Summary collapse
- OAUTH_SCHEME_ENUM =
[ OAUTH_SCHEME_NONE = 'NONE'.freeze, OAUTH_SCHEME_BASIC = 'BASIC'.freeze, OAUTH_SCHEME_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
- AUTH_REQUEST_METHOD_ENUM =
[ AUTH_REQUEST_METHOD_GET = 'GET'.freeze, AUTH_REQUEST_METHOD_POST = 'POST'.freeze, AUTH_REQUEST_METHOD_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#auth_headers ⇒ Array<OCI::ApmSynthetics::Models::Header>
List of authentication headers.
-
#auth_request_method ⇒ String
Request method.
-
#auth_request_post_body ⇒ String
Request post body.
-
#auth_token ⇒ String
Authentication token.
-
#auth_url ⇒ String
URL to get authentication token.
-
#auth_user_name ⇒ String
User name for authentication.
-
#auth_user_password ⇒ String
User password for authentication.
-
#oauth_scheme ⇒ String
Request HTTP OAuth scheme.
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 = {}) ⇒ RequestAuthenticationDetails
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 = {}) ⇒ RequestAuthenticationDetails
Initializes the object
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 103 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.oauth_scheme = attributes[:'oauthScheme'] if attributes[:'oauthScheme'] self.oauth_scheme = "NONE" if oauth_scheme.nil? && !attributes.key?(:'oauthScheme') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :oauthScheme and :oauth_scheme' if attributes.key?(:'oauthScheme') && attributes.key?(:'oauth_scheme') self.oauth_scheme = attributes[:'oauth_scheme'] if attributes[:'oauth_scheme'] self.oauth_scheme = "NONE" if oauth_scheme.nil? && !attributes.key?(:'oauthScheme') && !attributes.key?(:'oauth_scheme') # rubocop:disable Style/StringLiterals self.auth_user_name = attributes[:'authUserName'] if attributes[:'authUserName'] raise 'You cannot provide both :authUserName and :auth_user_name' if attributes.key?(:'authUserName') && attributes.key?(:'auth_user_name') self.auth_user_name = attributes[:'auth_user_name'] if attributes[:'auth_user_name'] self.auth_user_password = attributes[:'authUserPassword'] if attributes[:'authUserPassword'] raise 'You cannot provide both :authUserPassword and :auth_user_password' if attributes.key?(:'authUserPassword') && attributes.key?(:'auth_user_password') self.auth_user_password = attributes[:'auth_user_password'] if attributes[:'auth_user_password'] self.auth_token = attributes[:'authToken'] if attributes[:'authToken'] raise 'You cannot provide both :authToken and :auth_token' if attributes.key?(:'authToken') && attributes.key?(:'auth_token') self.auth_token = attributes[:'auth_token'] if attributes[:'auth_token'] self.auth_url = attributes[:'authUrl'] if attributes[:'authUrl'] raise 'You cannot provide both :authUrl and :auth_url' if attributes.key?(:'authUrl') && attributes.key?(:'auth_url') self.auth_url = attributes[:'auth_url'] if attributes[:'auth_url'] self.auth_headers = attributes[:'authHeaders'] if attributes[:'authHeaders'] raise 'You cannot provide both :authHeaders and :auth_headers' if attributes.key?(:'authHeaders') && attributes.key?(:'auth_headers') self.auth_headers = attributes[:'auth_headers'] if attributes[:'auth_headers'] self.auth_request_method = attributes[:'authRequestMethod'] if attributes[:'authRequestMethod'] self.auth_request_method = "GET" if auth_request_method.nil? && !attributes.key?(:'authRequestMethod') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :authRequestMethod and :auth_request_method' if attributes.key?(:'authRequestMethod') && attributes.key?(:'auth_request_method') self.auth_request_method = attributes[:'auth_request_method'] if attributes[:'auth_request_method'] self.auth_request_method = "GET" if auth_request_method.nil? && !attributes.key?(:'authRequestMethod') && !attributes.key?(:'auth_request_method') # rubocop:disable Style/StringLiterals self.auth_request_post_body = attributes[:'authRequestPostBody'] if attributes[:'authRequestPostBody'] raise 'You cannot provide both :authRequestPostBody and :auth_request_post_body' if attributes.key?(:'authRequestPostBody') && attributes.key?(:'auth_request_post_body') self.auth_request_post_body = attributes[:'auth_request_post_body'] if attributes[:'auth_request_post_body'] end |
Instance Attribute Details
#auth_headers ⇒ Array<OCI::ApmSynthetics::Models::Header>
List of authentication headers. Example: [{\"headerName\": \"content-type\", \"headerValue\":\"json\"}]
47 48 49 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 47 def auth_headers @auth_headers end |
#auth_request_method ⇒ String
Request method.
51 52 53 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 51 def auth_request_method @auth_request_method end |
#auth_request_post_body ⇒ String
Request post body.
55 56 57 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 55 def auth_request_post_body @auth_request_post_body end |
#auth_token ⇒ String
Authentication token.
38 39 40 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 38 def auth_token @auth_token end |
#auth_url ⇒ String
URL to get authentication token.
42 43 44 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 42 def auth_url @auth_url end |
#auth_user_name ⇒ String
User name for authentication.
30 31 32 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 30 def auth_user_name @auth_user_name end |
#auth_user_password ⇒ String
User password for authentication.
34 35 36 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 34 def auth_user_password @auth_user_password end |
#oauth_scheme ⇒ String
Request HTTP OAuth scheme.
26 27 28 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 26 def oauth_scheme @oauth_scheme end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 58 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'oauth_scheme': :'oauthScheme', 'auth_user_name': :'authUserName', 'auth_user_password': :'authUserPassword', 'auth_token': :'authToken', 'auth_url': :'authUrl', 'auth_headers': :'authHeaders', 'auth_request_method': :'authRequestMethod', 'auth_request_post_body': :'authRequestPostBody' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 74 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'oauth_scheme': :'String', 'auth_user_name': :'String', 'auth_user_password': :'String', 'auth_token': :'String', 'auth_url': :'String', 'auth_headers': :'Array<OCI::ApmSynthetics::Models::Header>', 'auth_request_method': :'String', 'auth_request_post_body': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 195 def ==(other) return true if equal?(other) self.class == other.class && oauth_scheme == other.oauth_scheme && auth_user_name == other.auth_user_name && auth_user_password == other.auth_user_password && auth_token == other.auth_token && auth_url == other.auth_url && auth_headers == other.auth_headers && auth_request_method == other.auth_request_method && auth_request_post_body == other.auth_request_post_body end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 232 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
212 213 214 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 212 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
221 222 223 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 221 def hash [oauth_scheme, auth_user_name, auth_user_password, auth_token, auth_url, auth_headers, auth_request_method, auth_request_post_body].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
265 266 267 268 269 270 271 272 273 274 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 265 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
259 260 261 |
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 259 def to_s to_hash.to_s end |