Class: ClerkHttpClient::User

Inherits:
Object
  • Object
show all
Defined in:
lib/clerk-http-client/models/user.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ User

Initializes the object

Parameters:

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

    Model attributes in the form of hash



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/clerk-http-client/models/user.rb', line 252

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `ClerkHttpClient::User` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `ClerkHttpClient::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.key?(:'object')
    self.object = attributes[:'object']
  end

  if attributes.key?(:'external_id')
    self.external_id = attributes[:'external_id']
  end

  if attributes.key?(:'primary_email_address_id')
    self.primary_email_address_id = attributes[:'primary_email_address_id']
  end

  if attributes.key?(:'primary_phone_number_id')
    self.primary_phone_number_id = attributes[:'primary_phone_number_id']
  end

  if attributes.key?(:'primary_web3_wallet_id')
    self.primary_web3_wallet_id = attributes[:'primary_web3_wallet_id']
  end

  if attributes.key?(:'username')
    self.username = attributes[:'username']
  end

  if attributes.key?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

  if attributes.key?(:'last_name')
    self.last_name = attributes[:'last_name']
  end

  if attributes.key?(:'profile_image_url')
    self.profile_image_url = attributes[:'profile_image_url']
  end

  if attributes.key?(:'image_url')
    self.image_url = attributes[:'image_url']
  end

  if attributes.key?(:'has_image')
    self.has_image = attributes[:'has_image']
  end

  if attributes.key?(:'public_metadata')
    if (value = attributes[:'public_metadata']).is_a?(Hash)
      self. = value
    end
  end

  if attributes.key?(:'private_metadata')
    if (value = attributes[:'private_metadata']).is_a?(Hash)
      self. = value
    end
  end

  if attributes.key?(:'unsafe_metadata')
    if (value = attributes[:'unsafe_metadata']).is_a?(Hash)
      self. = value
    end
  end

  if attributes.key?(:'email_addresses')
    if (value = attributes[:'email_addresses']).is_a?(Array)
      self.email_addresses = value
    end
  end

  if attributes.key?(:'phone_numbers')
    if (value = attributes[:'phone_numbers']).is_a?(Array)
      self.phone_numbers = value
    end
  end

  if attributes.key?(:'web3_wallets')
    if (value = attributes[:'web3_wallets']).is_a?(Array)
      self.web3_wallets = value
    end
  end

  if attributes.key?(:'passkeys')
    if (value = attributes[:'passkeys']).is_a?(Array)
      self.passkeys = value
    end
  end

  if attributes.key?(:'password_enabled')
    self.password_enabled = attributes[:'password_enabled']
  end

  if attributes.key?(:'two_factor_enabled')
    self.two_factor_enabled = attributes[:'two_factor_enabled']
  end

  if attributes.key?(:'totp_enabled')
    self.totp_enabled = attributes[:'totp_enabled']
  end

  if attributes.key?(:'backup_code_enabled')
    self.backup_code_enabled = attributes[:'backup_code_enabled']
  end

  if attributes.key?(:'mfa_enabled_at')
    self.mfa_enabled_at = attributes[:'mfa_enabled_at']
  end

  if attributes.key?(:'mfa_disabled_at')
    self.mfa_disabled_at = attributes[:'mfa_disabled_at']
  end

  if attributes.key?(:'external_accounts')
    if (value = attributes[:'external_accounts']).is_a?(Array)
      self.external_accounts = value
    end
  end

  if attributes.key?(:'saml_accounts')
    if (value = attributes[:'saml_accounts']).is_a?(Array)
      self.saml_accounts = value
    end
  end

  if attributes.key?(:'last_sign_in_at')
    self. = attributes[:'last_sign_in_at']
  end

  if attributes.key?(:'banned')
    self.banned = attributes[:'banned']
  end

  if attributes.key?(:'locked')
    self.locked = attributes[:'locked']
  end

  if attributes.key?(:'lockout_expires_in_seconds')
    self.lockout_expires_in_seconds = attributes[:'lockout_expires_in_seconds']
  end

  if attributes.key?(:'verification_attempts_remaining')
    self.verification_attempts_remaining = attributes[:'verification_attempts_remaining']
  end

  if attributes.key?(:'updated_at')
    self.updated_at = attributes[:'updated_at']
  end

  if attributes.key?(:'created_at')
    self.created_at = attributes[:'created_at']
  end

  if attributes.key?(:'delete_self_enabled')
    self.delete_self_enabled = attributes[:'delete_self_enabled']
  end

  if attributes.key?(:'create_organization_enabled')
    self.create_organization_enabled = attributes[:'create_organization_enabled']
  end

  if attributes.key?(:'create_organizations_limit')
    self.create_organizations_limit = attributes[:'create_organizations_limit']
  end

  if attributes.key?(:'last_active_at')
    self.last_active_at = attributes[:'last_active_at']
  end

  if attributes.key?(:'legal_accepted_at')
    self.legal_accepted_at = attributes[:'legal_accepted_at']
  end
end

Instance Attribute Details

#backup_code_enabledObject

Returns the value of attribute backup_code_enabled.



63
64
65
# File 'lib/clerk-http-client/models/user.rb', line 63

def backup_code_enabled
  @backup_code_enabled
end

#bannedObject

Flag to denote whether user is banned or not.



79
80
81
# File 'lib/clerk-http-client/models/user.rb', line 79

def banned
  @banned
end

#create_organization_enabledObject

If enabled, user can create organizations via FAPI.



100
101
102
# File 'lib/clerk-http-client/models/user.rb', line 100

def create_organization_enabled
  @create_organization_enabled
end

#create_organizations_limitObject

The maximum number of organizations the user can create. 0 means unlimited.



103
104
105
# File 'lib/clerk-http-client/models/user.rb', line 103

def create_organizations_limit
  @create_organizations_limit
end

#created_atObject

Unix timestamp of creation.



94
95
96
# File 'lib/clerk-http-client/models/user.rb', line 94

def created_at
  @created_at
end

#delete_self_enabledObject

If enabled, user can delete themselves via FAPI.



97
98
99
# File 'lib/clerk-http-client/models/user.rb', line 97

def delete_self_enabled
  @delete_self_enabled
end

#email_addressesObject

Returns the value of attribute email_addresses.



49
50
51
# File 'lib/clerk-http-client/models/user.rb', line 49

def email_addresses
  @email_addresses
end

#external_accountsObject

Returns the value of attribute external_accounts.



71
72
73
# File 'lib/clerk-http-client/models/user.rb', line 71

def external_accounts
  @external_accounts
end

#external_idObject

Returns the value of attribute external_id.



23
24
25
# File 'lib/clerk-http-client/models/user.rb', line 23

def external_id
  @external_id
end

#first_nameObject

Returns the value of attribute first_name.



33
34
35
# File 'lib/clerk-http-client/models/user.rb', line 33

def first_name
  @first_name
end

#has_imageObject

Returns the value of attribute has_image.



41
42
43
# File 'lib/clerk-http-client/models/user.rb', line 41

def has_image
  @has_image
end

#idObject

Returns the value of attribute id.



18
19
20
# File 'lib/clerk-http-client/models/user.rb', line 18

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url.



39
40
41
# File 'lib/clerk-http-client/models/user.rb', line 39

def image_url
  @image_url
end

#last_active_atObject

Unix timestamp of the latest session activity, with day precision.



106
107
108
# File 'lib/clerk-http-client/models/user.rb', line 106

def last_active_at
  @last_active_at
end

#last_nameObject

Returns the value of attribute last_name.



35
36
37
# File 'lib/clerk-http-client/models/user.rb', line 35

def last_name
  @last_name
end

#last_sign_in_atObject

Unix timestamp of last sign-in.



76
77
78
# File 'lib/clerk-http-client/models/user.rb', line 76

def 
  @last_sign_in_at
end

Unix timestamp of when the user accepted the legal requirements.



109
110
111
# File 'lib/clerk-http-client/models/user.rb', line 109

def legal_accepted_at
  @legal_accepted_at
end

#lockedObject

Flag to denote whether user is currently locked, i.e. restricted from signing in or not.



82
83
84
# File 'lib/clerk-http-client/models/user.rb', line 82

def locked
  @locked
end

#lockout_expires_in_secondsObject

The number of seconds remaining until the lockout period expires for a locked user. A null value for a locked user indicates that lockout never expires.



85
86
87
# File 'lib/clerk-http-client/models/user.rb', line 85

def lockout_expires_in_seconds
  @lockout_expires_in_seconds
end

#mfa_disabled_atObject

Unix timestamp of when MFA was last disabled for this user. It should be noted that this field is not nullified if MFA is enabled again.



69
70
71
# File 'lib/clerk-http-client/models/user.rb', line 69

def mfa_disabled_at
  @mfa_disabled_at
end

#mfa_enabled_atObject

Unix timestamp of when MFA was last enabled for this user. It should be noted that this field is not nullified if MFA is disabled.



66
67
68
# File 'lib/clerk-http-client/models/user.rb', line 66

def mfa_enabled_at
  @mfa_enabled_at
end

#objectObject

String representing the object’s type. Objects of the same type share the same value.



21
22
23
# File 'lib/clerk-http-client/models/user.rb', line 21

def object
  @object
end

#passkeysObject

Returns the value of attribute passkeys.



55
56
57
# File 'lib/clerk-http-client/models/user.rb', line 55

def passkeys
  @passkeys
end

#password_enabledObject

Returns the value of attribute password_enabled.



57
58
59
# File 'lib/clerk-http-client/models/user.rb', line 57

def password_enabled
  @password_enabled
end

#phone_numbersObject

Returns the value of attribute phone_numbers.



51
52
53
# File 'lib/clerk-http-client/models/user.rb', line 51

def phone_numbers
  @phone_numbers
end

#primary_email_address_idObject

Returns the value of attribute primary_email_address_id.



25
26
27
# File 'lib/clerk-http-client/models/user.rb', line 25

def primary_email_address_id
  @primary_email_address_id
end

#primary_phone_number_idObject

Returns the value of attribute primary_phone_number_id.



27
28
29
# File 'lib/clerk-http-client/models/user.rb', line 27

def primary_phone_number_id
  @primary_phone_number_id
end

#primary_web3_wallet_idObject

Returns the value of attribute primary_web3_wallet_id.



29
30
31
# File 'lib/clerk-http-client/models/user.rb', line 29

def primary_web3_wallet_id
  @primary_web3_wallet_id
end

#private_metadataObject

Returns the value of attribute private_metadata.



45
46
47
# File 'lib/clerk-http-client/models/user.rb', line 45

def 
  @private_metadata
end

#profile_image_urlObject

Returns the value of attribute profile_image_url.



37
38
39
# File 'lib/clerk-http-client/models/user.rb', line 37

def profile_image_url
  @profile_image_url
end

#public_metadataObject

Returns the value of attribute public_metadata.



43
44
45
# File 'lib/clerk-http-client/models/user.rb', line 43

def 
  @public_metadata
end

#saml_accountsObject

Returns the value of attribute saml_accounts.



73
74
75
# File 'lib/clerk-http-client/models/user.rb', line 73

def saml_accounts
  @saml_accounts
end

#totp_enabledObject

Returns the value of attribute totp_enabled.



61
62
63
# File 'lib/clerk-http-client/models/user.rb', line 61

def totp_enabled
  @totp_enabled
end

#two_factor_enabledObject

Returns the value of attribute two_factor_enabled.



59
60
61
# File 'lib/clerk-http-client/models/user.rb', line 59

def two_factor_enabled
  @two_factor_enabled
end

#unsafe_metadataObject

Returns the value of attribute unsafe_metadata.



47
48
49
# File 'lib/clerk-http-client/models/user.rb', line 47

def 
  @unsafe_metadata
end

#updated_atObject

Unix timestamp of last update.



91
92
93
# File 'lib/clerk-http-client/models/user.rb', line 91

def updated_at
  @updated_at
end

#usernameObject

Returns the value of attribute username.



31
32
33
# File 'lib/clerk-http-client/models/user.rb', line 31

def username
  @username
end

#verification_attempts_remainingObject

The number of verification attempts remaining until the user is locked. Null if account lockout is not enabled. Note: if a user is locked explicitly via the Backend API, they may still have verification attempts remaining.



88
89
90
# File 'lib/clerk-http-client/models/user.rb', line 88

def verification_attempts_remaining
  @verification_attempts_remaining
end

#web3_walletsObject

Returns the value of attribute web3_wallets.



53
54
55
# File 'lib/clerk-http-client/models/user.rb', line 53

def web3_wallets
  @web3_wallets
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/clerk-http-client/models/user.rb', line 552

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = ClerkHttpClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



179
180
181
# File 'lib/clerk-http-client/models/user.rb', line 179

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/clerk-http-client/models/user.rb', line 134

def self.attribute_map
  {
    :'id' => :'id',
    :'object' => :'object',
    :'external_id' => :'external_id',
    :'primary_email_address_id' => :'primary_email_address_id',
    :'primary_phone_number_id' => :'primary_phone_number_id',
    :'primary_web3_wallet_id' => :'primary_web3_wallet_id',
    :'username' => :'username',
    :'first_name' => :'first_name',
    :'last_name' => :'last_name',
    :'profile_image_url' => :'profile_image_url',
    :'image_url' => :'image_url',
    :'has_image' => :'has_image',
    :'public_metadata' => :'public_metadata',
    :'private_metadata' => :'private_metadata',
    :'unsafe_metadata' => :'unsafe_metadata',
    :'email_addresses' => :'email_addresses',
    :'phone_numbers' => :'phone_numbers',
    :'web3_wallets' => :'web3_wallets',
    :'passkeys' => :'passkeys',
    :'password_enabled' => :'password_enabled',
    :'two_factor_enabled' => :'two_factor_enabled',
    :'totp_enabled' => :'totp_enabled',
    :'backup_code_enabled' => :'backup_code_enabled',
    :'mfa_enabled_at' => :'mfa_enabled_at',
    :'mfa_disabled_at' => :'mfa_disabled_at',
    :'external_accounts' => :'external_accounts',
    :'saml_accounts' => :'saml_accounts',
    :'last_sign_in_at' => :'last_sign_in_at',
    :'banned' => :'banned',
    :'locked' => :'locked',
    :'lockout_expires_in_seconds' => :'lockout_expires_in_seconds',
    :'verification_attempts_remaining' => :'verification_attempts_remaining',
    :'updated_at' => :'updated_at',
    :'created_at' => :'created_at',
    :'delete_self_enabled' => :'delete_self_enabled',
    :'create_organization_enabled' => :'create_organization_enabled',
    :'create_organizations_limit' => :'create_organizations_limit',
    :'last_active_at' => :'last_active_at',
    :'legal_accepted_at' => :'legal_accepted_at'
  }
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



528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# File 'lib/clerk-http-client/models/user.rb', line 528

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/clerk-http-client/models/user.rb', line 229

def self.openapi_nullable
  Set.new([
    :'external_id',
    :'primary_email_address_id',
    :'primary_phone_number_id',
    :'primary_web3_wallet_id',
    :'username',
    :'first_name',
    :'last_name',
    :'private_metadata',
    :'mfa_enabled_at',
    :'mfa_disabled_at',
    :'last_sign_in_at',
    :'lockout_expires_in_seconds',
    :'verification_attempts_remaining',
    :'create_organizations_limit',
    :'last_active_at',
    :'legal_accepted_at'
  ])
end

.openapi_typesObject

Attribute type mapping.



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/clerk-http-client/models/user.rb', line 184

def self.openapi_types
  {
    :'id' => :'String',
    :'object' => :'String',
    :'external_id' => :'String',
    :'primary_email_address_id' => :'String',
    :'primary_phone_number_id' => :'String',
    :'primary_web3_wallet_id' => :'String',
    :'username' => :'String',
    :'first_name' => :'String',
    :'last_name' => :'String',
    :'profile_image_url' => :'String',
    :'image_url' => :'String',
    :'has_image' => :'Boolean',
    :'public_metadata' => :'Hash<String, Object>',
    :'private_metadata' => :'Hash<String, Object>',
    :'unsafe_metadata' => :'Hash<String, Object>',
    :'email_addresses' => :'Array<EmailAddress>',
    :'phone_numbers' => :'Array<PhoneNumber>',
    :'web3_wallets' => :'Array<Web3Wallet>',
    :'passkeys' => :'Array<SchemasPasskey>',
    :'password_enabled' => :'Boolean',
    :'two_factor_enabled' => :'Boolean',
    :'totp_enabled' => :'Boolean',
    :'backup_code_enabled' => :'Boolean',
    :'mfa_enabled_at' => :'Integer',
    :'mfa_disabled_at' => :'Integer',
    :'external_accounts' => :'Array<Object>',
    :'saml_accounts' => :'Array<SAMLAccount>',
    :'last_sign_in_at' => :'Integer',
    :'banned' => :'Boolean',
    :'locked' => :'Boolean',
    :'lockout_expires_in_seconds' => :'Integer',
    :'verification_attempts_remaining' => :'Integer',
    :'updated_at' => :'Integer',
    :'created_at' => :'Integer',
    :'delete_self_enabled' => :'Boolean',
    :'create_organization_enabled' => :'Boolean',
    :'create_organizations_limit' => :'Integer',
    :'last_active_at' => :'Integer',
    :'legal_accepted_at' => :'Integer'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/clerk-http-client/models/user.rb', line 469

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      object == o.object &&
      external_id == o.external_id &&
      primary_email_address_id == o.primary_email_address_id &&
      primary_phone_number_id == o.primary_phone_number_id &&
      primary_web3_wallet_id == o.primary_web3_wallet_id &&
      username == o.username &&
      first_name == o.first_name &&
      last_name == o.last_name &&
      profile_image_url == o.profile_image_url &&
      image_url == o.image_url &&
      has_image == o.has_image &&
       == o. &&
       == o. &&
       == o. &&
      email_addresses == o.email_addresses &&
      phone_numbers == o.phone_numbers &&
      web3_wallets == o.web3_wallets &&
      passkeys == o.passkeys &&
      password_enabled == o.password_enabled &&
      two_factor_enabled == o.two_factor_enabled &&
      totp_enabled == o.totp_enabled &&
      backup_code_enabled == o.backup_code_enabled &&
      mfa_enabled_at == o.mfa_enabled_at &&
      mfa_disabled_at == o.mfa_disabled_at &&
      external_accounts == o.external_accounts &&
      saml_accounts == o.saml_accounts &&
       == o. &&
      banned == o.banned &&
      locked == o.locked &&
      lockout_expires_in_seconds == o.lockout_expires_in_seconds &&
      verification_attempts_remaining == o.verification_attempts_remaining &&
      updated_at == o.updated_at &&
      created_at == o.created_at &&
      delete_self_enabled == o.delete_self_enabled &&
      create_organization_enabled == o.create_organization_enabled &&
      create_organizations_limit == o.create_organizations_limit &&
      last_active_at == o.last_active_at &&
      legal_accepted_at == o.legal_accepted_at
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



623
624
625
626
627
628
629
630
631
632
633
634
635
# File 'lib/clerk-http-client/models/user.rb', line 623

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


515
516
517
# File 'lib/clerk-http-client/models/user.rb', line 515

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



521
522
523
# File 'lib/clerk-http-client/models/user.rb', line 521

def hash
  [id, object, external_id, primary_email_address_id, primary_phone_number_id, primary_web3_wallet_id, username, first_name, last_name, profile_image_url, image_url, has_image, , , , email_addresses, phone_numbers, web3_wallets, passkeys, password_enabled, two_factor_enabled, totp_enabled, backup_code_enabled, mfa_enabled_at, mfa_disabled_at, external_accounts, saml_accounts, , banned, locked, lockout_expires_in_seconds, verification_attempts_remaining, updated_at, created_at, delete_self_enabled, create_organization_enabled, create_organizations_limit, last_active_at, legal_accepted_at].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



442
443
444
445
446
# File 'lib/clerk-http-client/models/user.rb', line 442

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



599
600
601
# File 'lib/clerk-http-client/models/user.rb', line 599

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



605
606
607
608
609
610
611
612
613
614
615
616
617
# File 'lib/clerk-http-client/models/user.rb', line 605

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



593
594
595
# File 'lib/clerk-http-client/models/user.rb', line 593

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



450
451
452
453
454
455
# File 'lib/clerk-http-client/models/user.rb', line 450

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  object_validator = EnumAttributeValidator.new('String', ["user"])
  return false unless object_validator.valid?(@object)
  true
end