Class: SyncteraRubySdk::ResponsePerson

Inherits:
Object
  • Object
show all
Defined in:
lib/synctera_ruby_sdk/models/response_person.rb

Overview

Details of a person

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ResponsePerson

Initializes the object



183
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
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
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 183

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `SyncteraRubySdk::ResponsePerson` 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 `SyncteraRubySdk::ResponsePerson`. 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?(:'ban_status')
    self.ban_status = attributes[:'ban_status']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#ban_statusObject

Returns the value of attribute ban_status.



19
20
21
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 19

def ban_status
  @ban_status
end

#chosen_nameObject

Person’s chosen name.



22
23
24
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 22

def chosen_name
  @chosen_name
end

#creation_timeObject

The date and time the resource was created.



25
26
27
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 25

def creation_time
  @creation_time
end

#dobObject

Person’s date of birth in RFC 3339 full-date format (YYYY-MM-DD).



28
29
30
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 28

def dob
  @dob
end

#emailObject

Person’s email.



31
32
33
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 31

def email
  @email
end

#first_nameObject

Person’s first name.



34
35
36
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 34

def first_name
  @first_name
end

#has_accountsObject

This flag indicates whether the person or business has accounts.



37
38
39
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 37

def has_accounts
  @has_accounts
end

#idObject

Person’s unique identifier.



40
41
42
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 40

def id
  @id
end

#is_customerObject

True for personal and business customers with a direct relationship with the fintech or bank. Set this to true for any customer related to an account.



43
44
45
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 43

def is_customer
  @is_customer
end

#last_nameObject

Person’s last name.



46
47
48
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 46

def last_name
  @last_name
end

#last_updated_timeObject

The date and time the resource was last updated.



49
50
51
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 49

def last_updated_time
  @last_updated_time
end

Returns the value of attribute legal_address.



51
52
53
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 51

def legal_address
  @legal_address
end

#metadataObject

Optional field to store additional information about the resource. Intended to be used by the integrator to store non-sensitive data.



54
55
56
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 54

def 
  @metadata
end

#middle_nameObject

Person’s middle name.



57
58
59
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 57

def middle_name
  @middle_name
end

#personal_idsObject

> 🚧 Beta > This is a Beta property. Feedback from the community is welcome. We may make breaking changes to this property. Array of personal identifiers



80
81
82
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 80

def personal_ids
  @personal_ids
end

#phone_numberObject

Person’s mobile phone number with country code in E.164 format. Must have a valid country code. Area code and local phone number are not validated



60
61
62
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 60

def phone_number
  @phone_number
end

#shipping_addressObject

Returns the value of attribute shipping_address.



62
63
64
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 62

def shipping_address
  @shipping_address
end

#ssnObject

Person’s full tax ID eg SSN formatted with hyphens. The response contains the last 4 digits only (e.g. 6789).



65
66
67
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 65

def ssn
  @ssn
end

#ssn_sourceObject

Returns the value of attribute ssn_source.



67
68
69
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 67

def ssn_source
  @ssn_source
end

#statusObject

Returns the value of attribute status.



69
70
71
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 69

def status
  @status
end

#tenantObject

The id of the tenant containing the resource. This is relevant for Fintechs that have multiple workspaces.



72
73
74
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 72

def tenant
  @tenant
end

#verification_last_runObject

Date and time KYC verification was last run on the person.



75
76
77
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 75

def verification_last_run
  @verification_last_run
end

#verification_statusObject

Returns the value of attribute verification_status.



77
78
79
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 77

def verification_status
  @verification_status
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



134
135
136
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 134

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



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
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 105

def self.attribute_map
  {
    :'ban_status' => :'ban_status',
    :'chosen_name' => :'chosen_name',
    :'creation_time' => :'creation_time',
    :'dob' => :'dob',
    :'email' => :'email',
    :'first_name' => :'first_name',
    :'has_accounts' => :'has_accounts',
    :'id' => :'id',
    :'is_customer' => :'is_customer',
    :'last_name' => :'last_name',
    :'last_updated_time' => :'last_updated_time',
    :'legal_address' => :'legal_address',
    :'metadata' => :'metadata',
    :'middle_name' => :'middle_name',
    :'phone_number' => :'phone_number',
    :'shipping_address' => :'shipping_address',
    :'ssn' => :'ssn',
    :'ssn_source' => :'ssn_source',
    :'status' => :'status',
    :'tenant' => :'tenant',
    :'verification_last_run' => :'verification_last_run',
    :'verification_status' => :'verification_status',
    :'personal_ids' => :'personal_ids'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash



406
407
408
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 406

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_all_ofObject

List of class defined in allOf (OpenAPI v3)



174
175
176
177
178
179
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 174

def self.openapi_all_of
  [
  :'BasePerson1',
  :'ResponsePersonalIdsArray'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



168
169
170
171
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 168

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 139

def self.openapi_types
  {
    :'ban_status' => :'BanStatus',
    :'chosen_name' => :'String',
    :'creation_time' => :'Time',
    :'dob' => :'Date',
    :'email' => :'String',
    :'first_name' => :'String',
    :'has_accounts' => :'Boolean',
    :'id' => :'String',
    :'is_customer' => :'Boolean',
    :'last_name' => :'String',
    :'last_updated_time' => :'Time',
    :'legal_address' => :'LegalAddress',
    :'metadata' => :'Object',
    :'middle_name' => :'String',
    :'phone_number' => :'String',
    :'shipping_address' => :'ShippingAddress',
    :'ssn' => :'String',
    :'ssn_source' => :'SsnSource',
    :'status' => :'Status2',
    :'tenant' => :'String',
    :'verification_last_run' => :'Time',
    :'verification_status' => :'VerificationStatus',
    :'personal_ids' => :'Array<ResponsePersonalId>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.



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
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 363

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ban_status == o.ban_status &&
      chosen_name == o.chosen_name &&
      creation_time == o.creation_time &&
      dob == o.dob &&
      email == o.email &&
      first_name == o.first_name &&
      has_accounts == o.has_accounts &&
      id == o.id &&
      is_customer == o.is_customer &&
      last_name == o.last_name &&
      last_updated_time == o.last_updated_time &&
      legal_address == o.legal_address &&
       == o. &&
      middle_name == o.middle_name &&
      phone_number == o.phone_number &&
      shipping_address == o.shipping_address &&
      ssn == o.ssn &&
      ssn_source == o.ssn_source &&
      status == o.status &&
      tenant == o.tenant &&
      verification_last_run == o.verification_last_run &&
      verification_status == o.verification_status &&
      personal_ids == o.personal_ids
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type



437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 437

def _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 = SyncteraRubySdk.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

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



508
509
510
511
512
513
514
515
516
517
518
519
520
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 508

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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 413

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

See Also:

  • `==` method


393
394
395
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 393

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.



399
400
401
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 399

def hash
  [ban_status, chosen_name, creation_time, dob, email, first_name, has_accounts, id, is_customer, last_name, last_updated_time, legal_address, , middle_name, phone_number, shipping_address, ssn, ssn_source, status, tenant, verification_last_run, verification_status, personal_ids].hash
end

#list_invalid_propertiesObject

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



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
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 293

def list_invalid_properties
  invalid_properties = Array.new
  if @ban_status.nil?
    invalid_properties.push('invalid value for "ban_status", ban_status cannot be nil.')
  end

  if @creation_time.nil?
    invalid_properties.push('invalid value for "creation_time", creation_time cannot be nil.')
  end

  if @id.nil?
    invalid_properties.push('invalid value for "id", id cannot be nil.')
  end

  if @is_customer.nil?
    invalid_properties.push('invalid value for "is_customer", is_customer cannot be nil.')
  end

  if @last_updated_time.nil?
    invalid_properties.push('invalid value for "last_updated_time", last_updated_time cannot be nil.')
  end

  pattern = Regexp.new(/^\+[1-9]\d{1,14}$/)
  if !@phone_number.nil? && @phone_number !~ pattern
    invalid_properties.push("invalid value for \"phone_number\", must conform to the pattern #{pattern}.")
  end

  if @status.nil?
    invalid_properties.push('invalid value for "status", status cannot be nil.')
  end

  if @tenant.nil?
    invalid_properties.push('invalid value for "tenant", tenant cannot be nil.')
  end

  if @verification_status.nil?
    invalid_properties.push('invalid value for "verification_status", verification_status cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)



484
485
486
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 484

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash



490
491
492
493
494
495
496
497
498
499
500
501
502
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 490

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



478
479
480
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 478

def to_s
  to_hash.to_s
end

#valid?Boolean

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



337
338
339
340
341
342
343
344
345
346
347
348
# File 'lib/synctera_ruby_sdk/models/response_person.rb', line 337

def valid?
  return false if @ban_status.nil?
  return false if @creation_time.nil?
  return false if @id.nil?
  return false if @is_customer.nil?
  return false if @last_updated_time.nil?
  return false if !@phone_number.nil? && @phone_number !~ Regexp.new(/^\+[1-9]\d{1,14}$/)
  return false if @status.nil?
  return false if @tenant.nil?
  return false if @verification_status.nil?
  true
end