Class: OCI::ApmSynthetics::Models::RequestAuthenticationDetails

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RequestAuthenticationDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :oauth_scheme (String)

    The value to assign to the #oauth_scheme property

  • :auth_user_name (String)

    The value to assign to the #auth_user_name property

  • :auth_user_password (String)

    The value to assign to the #auth_user_password property

  • :auth_token (String)

    The value to assign to the #auth_token property

  • :auth_url (String)

    The value to assign to the #auth_url property

  • :auth_headers (Array<OCI::ApmSynthetics::Models::Header>)

    The value to assign to the #auth_headers property

  • :auth_request_method (String)

    The value to assign to the #auth_request_method property

  • :auth_request_post_body (String)

    The value to assign to the #auth_request_post_body property



102
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
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 102

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_headersArray<OCI::ApmSynthetics::Models::Header>

List of authentication headers. Example: `["content-type", "headerValue":"json"]`

Returns:

  • (Array<OCI::ApmSynthetics::Models::Header>)


46
47
48
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 46

def auth_headers
  @auth_headers
end

#auth_request_methodString

Request method.

Returns:

  • (String)


50
51
52
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 50

def auth_request_method
  @auth_request_method
end

#auth_request_post_bodyString

Request post body.

Returns:

  • (String)


54
55
56
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 54

def auth_request_post_body
  @auth_request_post_body
end

#auth_tokenString

Authentication token.

Returns:

  • (String)


37
38
39
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 37

def auth_token
  @auth_token
end

#auth_urlString

URL to get authetication token.

Returns:

  • (String)


41
42
43
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 41

def auth_url
  @auth_url
end

#auth_user_nameString

Username for authentication.

Returns:

  • (String)


29
30
31
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 29

def auth_user_name
  @auth_user_name
end

#auth_user_passwordString

User password for authentication.

Returns:

  • (String)


33
34
35
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 33

def auth_user_password
  @auth_user_password
end

#oauth_schemeString

Request http oauth scheme.

Returns:

  • (String)


25
26
27
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 25

def oauth_scheme
  @oauth_scheme
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 57

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_typesObject

Attribute type mapping.



73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 73

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.

Parameters:

  • other (Object)

    the other object to be compared



194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 194

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 231

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


211
212
213
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 211

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



220
221
222
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 220

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_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



264
265
266
267
268
269
270
271
272
273
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 264

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



258
259
260
# File 'lib/oci/apm_synthetics/models/request_authentication_details.rb', line 258

def to_s
  to_hash.to_s
end