Class: OCI::IdentityDataPlane::Models::CredentialAuthenticatorInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/identity_data_plane/models/credential_authenticator_info.rb

Overview

CredentialAuthenticatorInfo model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ CredentialAuthenticatorInfo

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :raw_credential (String)

    The value to assign to the #raw_credential property

  • :user_id (String)

    The value to assign to the #user_id property

  • :tenant_id (String)

    The value to assign to the #tenant_id property

  • :user_name (String)

    The value to assign to the #user_name property

  • :tenant_name (String)

    The value to assign to the #tenant_name property

  • :credential_identifier (String)

    The value to assign to the #credential_identifier property

  • :credential_list (Array<String>)

    The value to assign to the #credential_list property

  • :service (String)

    The value to assign to the #service property

  • :client_id (String)

    The value to assign to the #client_id property



95
96
97
98
99
100
101
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
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 95

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.raw_credential = attributes[:'rawCredential'] if attributes[:'rawCredential']

  raise 'You cannot provide both :rawCredential and :raw_credential' if attributes.key?(:'rawCredential') && attributes.key?(:'raw_credential')

  self.raw_credential = attributes[:'raw_credential'] if attributes[:'raw_credential']

  self.user_id = attributes[:'userId'] if attributes[:'userId']

  raise 'You cannot provide both :userId and :user_id' if attributes.key?(:'userId') && attributes.key?(:'user_id')

  self.user_id = attributes[:'user_id'] if attributes[:'user_id']

  self.tenant_id = attributes[:'tenantId'] if attributes[:'tenantId']

  raise 'You cannot provide both :tenantId and :tenant_id' if attributes.key?(:'tenantId') && attributes.key?(:'tenant_id')

  self.tenant_id = attributes[:'tenant_id'] if attributes[:'tenant_id']

  self.user_name = attributes[:'userName'] if attributes[:'userName']

  raise 'You cannot provide both :userName and :user_name' if attributes.key?(:'userName') && attributes.key?(:'user_name')

  self.user_name = attributes[:'user_name'] if attributes[:'user_name']

  self.tenant_name = attributes[:'tenantName'] if attributes[:'tenantName']

  raise 'You cannot provide both :tenantName and :tenant_name' if attributes.key?(:'tenantName') && attributes.key?(:'tenant_name')

  self.tenant_name = attributes[:'tenant_name'] if attributes[:'tenant_name']

  self.credential_identifier = attributes[:'credentialIdentifier'] if attributes[:'credentialIdentifier']

  raise 'You cannot provide both :credentialIdentifier and :credential_identifier' if attributes.key?(:'credentialIdentifier') && attributes.key?(:'credential_identifier')

  self.credential_identifier = attributes[:'credential_identifier'] if attributes[:'credential_identifier']

  self.credential_list = attributes[:'credentialList'] if attributes[:'credentialList']

  raise 'You cannot provide both :credentialList and :credential_list' if attributes.key?(:'credentialList') && attributes.key?(:'credential_list')

  self.credential_list = attributes[:'credential_list'] if attributes[:'credential_list']

  self.service = attributes[:'service'] if attributes[:'service']

  self.client_id = attributes[:'clientId'] if attributes[:'clientId']

  raise 'You cannot provide both :clientId and :client_id' if attributes.key?(:'clientId') && attributes.key?(:'client_id')

  self.client_id = attributes[:'client_id'] if attributes[:'client_id']
end

Instance Attribute Details

#client_idString

[Required] The id of the client.

Returns:

  • (String)


44
45
46
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 44

def client_id
  @client_id
end

#credential_identifierString

[Required] The credential identifier.

Returns:

  • (String)


32
33
34
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 32

def credential_identifier
  @credential_identifier
end

#credential_listArray<String>

[Required] The credential list.

Returns:

  • (Array<String>)


36
37
38
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 36

def credential_list
  @credential_list
end

#raw_credentialString

[Required] The raw credential.

Returns:

  • (String)


12
13
14
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 12

def raw_credential
  @raw_credential
end

#serviceString

[Required] The name of the service that is making this authorization request.

Returns:

  • (String)


40
41
42
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 40

def service
  @service
end

#tenant_idString

[Required] The id of the tenant.

Returns:

  • (String)


20
21
22
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 20

def tenant_id
  @tenant_id
end

#tenant_nameString

[Required] The name of the tenant.

Returns:

  • (String)


28
29
30
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 28

def tenant_name
  @tenant_name
end

#user_idString

[Required] The id of the user.

Returns:

  • (String)


16
17
18
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 16

def user_id
  @user_id
end

#user_nameString

[Required] The name of the user.

Returns:

  • (String)


24
25
26
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 24

def user_name
  @user_name
end

Class Method Details

.attribute_mapObject

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



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 47

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'raw_credential': :'rawCredential',
    'user_id': :'userId',
    'tenant_id': :'tenantId',
    'user_name': :'userName',
    'tenant_name': :'tenantName',
    'credential_identifier': :'credentialIdentifier',
    'credential_list': :'credentialList',
    'service': :'service',
    'client_id': :'clientId'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'raw_credential': :'String',
    'user_id': :'String',
    'tenant_id': :'String',
    'user_name': :'String',
    'tenant_name': :'String',
    'credential_identifier': :'String',
    'credential_list': :'Array<String>',
    'service': :'String',
    'client_id': :'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



159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 159

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    raw_credential == other.raw_credential &&
    user_id == other.user_id &&
    tenant_id == other.tenant_id &&
    user_name == other.user_name &&
    tenant_name == other.tenant_name &&
    credential_identifier == other.credential_identifier &&
    credential_list == other.credential_list &&
    service == other.service &&
    client_id == other.client_id
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



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 197

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


177
178
179
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 177

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



186
187
188
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 186

def hash
  [raw_credential, user_id, tenant_id, user_name, tenant_name, credential_identifier, credential_list, service, client_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 230

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



224
225
226
# File 'lib/oci/identity_data_plane/models/credential_authenticator_info.rb', line 224

def to_s
  to_hash.to_s
end