Class: OCI::IdentityDomains::Models::UserName

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/identity_domains/models/user_name.rb

Overview

A complex attribute that contains attributes representing the name

SCIM++ Properties: - idcsCsvAttributeNameMappings: [[columnHeaderName:Formatted Name, mapsTo:name.formatted], [columnHeaderName:Honorific Prefix, mapsTo:name.honorificPrefix], [columnHeaderName:First Name, mapsTo:name.givenName], [columnHeaderName:Middle Name, mapsTo:name.middleName], [columnHeaderName:Last Name, mapsTo:name.familyName], [columnHeaderName:Honorific Suffix, mapsTo:name.honorificSuffix]] - idcsPii: true - multiValued: false - mutability: readWrite - required: false - returned: default - type: complex - uniqueness: none

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ UserName

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :formatted (String)

    The value to assign to the #formatted property

  • :family_name (String)

    The value to assign to the #family_name property

  • :given_name (String)

    The value to assign to the #given_name property

  • :middle_name (String)

    The value to assign to the #middle_name property

  • :honorific_prefix (String)

    The value to assign to the #honorific_prefix property

  • :honorific_suffix (String)

    The value to assign to the #honorific_suffix property



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/identity_domains/models/user_name.rb', line 148

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

  self.family_name = attributes[:'familyName'] if attributes[:'familyName']

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

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

  self.given_name = attributes[:'givenName'] if attributes[:'givenName']

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

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

  self.middle_name = attributes[:'middleName'] if attributes[:'middleName']

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

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

  self.honorific_prefix = attributes[:'honorificPrefix'] if attributes[:'honorificPrefix']

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

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

  self.honorific_suffix = attributes[:'honorificSuffix'] if attributes[:'honorificSuffix']

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

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

Instance Attribute Details

#family_nameString

Last name

SCIM++ Properties: - caseExact: false - idcsCsvAttributeName: Last Name - idcsSearchable: true - multiValued: false - mutability: readWrite - required: false - returned: default - type: string - uniqueness: none

Returns:

  • (String)


48
49
50
# File 'lib/oci/identity_domains/models/user_name.rb', line 48

def family_name
  @family_name
end

#formattedString

Full name

SCIM++ Properties: - caseExact: false - idcsSearchable: true - multiValued: false - mutability: readWrite - required: false - returned: default - type: string - uniqueness: none

Returns:

  • (String)


33
34
35
# File 'lib/oci/identity_domains/models/user_name.rb', line 33

def formatted
  @formatted
end

#given_nameString

First name

SCIM++ Properties: - caseExact: false - idcsCsvAttributeName: First Name - idcsSearchable: true - multiValued: false - mutability: readWrite - required: false - returned: default - type: string - uniqueness: none

Returns:

  • (String)


63
64
65
# File 'lib/oci/identity_domains/models/user_name.rb', line 63

def given_name
  @given_name
end

#honorific_prefixString

Prefix

SCIM++ Properties: - idcsCsvAttributeName: Honorific Prefix - idcsSearchable: false - multiValued: false - mutability: readWrite - required: false - returned: default - type: string - uniqueness: none

Returns:

  • (String)


92
93
94
# File 'lib/oci/identity_domains/models/user_name.rb', line 92

def honorific_prefix
  @honorific_prefix
end

#honorific_suffixString

Suffix

SCIM++ Properties: - idcsCsvAttributeName: Honorific Suffix - idcsSearchable: false - multiValued: false - mutability: readWrite - required: false - returned: default - type: string - uniqueness: none

Returns:

  • (String)


106
107
108
# File 'lib/oci/identity_domains/models/user_name.rb', line 106

def honorific_suffix
  @honorific_suffix
end

#middle_nameString

Middle name

SCIM++ Properties: - caseExact: false - idcsCsvAttributeName: Middle Name - idcsSearchable: true - multiValued: false - mutability: readWrite - required: false - returned: default - type: string - uniqueness: none

Returns:

  • (String)


78
79
80
# File 'lib/oci/identity_domains/models/user_name.rb', line 78

def middle_name
  @middle_name
end

Class Method Details

.attribute_mapObject

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



109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/identity_domains/models/user_name.rb', line 109

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'formatted': :'formatted',
    'family_name': :'familyName',
    'given_name': :'givenName',
    'middle_name': :'middleName',
    'honorific_prefix': :'honorificPrefix',
    'honorific_suffix': :'honorificSuffix'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/oci/identity_domains/models/user_name.rb', line 123

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'formatted': :'String',
    'family_name': :'String',
    'given_name': :'String',
    'middle_name': :'String',
    'honorific_prefix': :'String',
    'honorific_suffix': :'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
# File 'lib/oci/identity_domains/models/user_name.rb', line 194

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

  self.class == other.class &&
    formatted == other.formatted &&
    family_name == other.family_name &&
    given_name == other.given_name &&
    middle_name == other.middle_name &&
    honorific_prefix == other.honorific_prefix &&
    honorific_suffix == other.honorific_suffix
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



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

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


209
210
211
# File 'lib/oci/identity_domains/models/user_name.rb', line 209

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



218
219
220
# File 'lib/oci/identity_domains/models/user_name.rb', line 218

def hash
  [formatted, family_name, given_name, middle_name, honorific_prefix, honorific_suffix].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



262
263
264
265
266
267
268
269
270
271
# File 'lib/oci/identity_domains/models/user_name.rb', line 262

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



256
257
258
# File 'lib/oci/identity_domains/models/user_name.rb', line 256

def to_s
  to_hash.to_s
end