Class: SyncteraRubySdk::ExternalAccountLinkToken

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

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ ExternalAccountLinkToken

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
177
178
179
180
181
182
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
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 140

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'sdk_type')
    self.sdk_type = attributes[:'sdk_type']
  else
    self.sdk_type = 'WEB'
  end

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

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

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

  if attributes.key?(:'verify_owner')
    self.verify_owner = attributes[:'verify_owner']
  else
    self.verify_owner = false
  end
end

Instance Attribute Details

#business_idObject

The identifier for the business customer associated with this external account. Exactly one of ‘business_id` or `customer_id` must be specified.



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

def business_id
  @business_id
end

#client_nameObject

The name of your application, as it should be displayed in Link. Maximum length of 30 characters.



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

def client_name
  @client_name
end

#country_codesObject

Country codes in the ISO-3166-1 alpha-2 country code standard.



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

def country_codes
  @country_codes
end

#customer_idObject

The identifier for the personal customer associated with this external account. Exactly one of ‘customer_id` or `business_id` must be specified.



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

def customer_id
  @customer_id
end

#expirationObject

The expiration date for the link_token. Expires in 4 hours.



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

def expiration
  @expiration
end

#languageObject

The language that corresponds to the link token. For Plaid, see their [documentation](plaid.com/docs/api/tokens/#link-token-create-request-language) for a list of allowed values.



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

def language
  @language
end

The name of the Link customization from the Plaid Dashboard to be applied to Link. If not specified, the default customization will be used. When using a Link customization, the language in the customization must match the language selected via the language parameter, and the countries in the customization should match the country codes selected via country_codes.



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

def link_customization_name
  @link_customization_name
end

A link_token, which can be supplied to Link in order to initialize it and receive a public_token, which can be exchanged for an access_token.



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

def link_token
  @link_token
end

#redirect_uriObject

A URI indicating the destination where a user should be forwarded after completing the Link flow; used to support OAuth authentication flows when launching Link in the browser or via a webview.



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

def redirect_uri
  @redirect_uri
end

#request_idObject

A unique identifier for the request, which can be used for troubleshooting.



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

def request_id
  @request_id
end

#sdk_typeObject

Describes the environment of the client code running a vendor-supplied SDK



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

def sdk_type
  @sdk_type
end

#typeObject

The type of the link token. DEPOSITORY for checking and savings accounts, CREDIT for credit card type accounts, INVESTMENT for investment accounts, and MICRO_DEPOSIT for depository accounts with support for micro-deposits verification.



52
53
54
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 52

def type
  @type
end

#vendor_access_tokenObject

The access token associated with the Item data is being requested for.



55
56
57
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 55

def vendor_access_token
  @vendor_access_token
end

#vendor_institution_idObject

The ID of the institution the access token is requested for. If present the link token will be created in an update mode.



58
59
60
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 58

def vendor_institution_id
  @vendor_institution_id
end

#verify_ownerObject

If true, Synctera will attempt to verify that the external account owner is the same as the customer by comparing external account data to customer data. At least 2 of the following fields must match: name, phone number, email, address. Verification is disabled by default.



61
62
63
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 61

def verify_owner
  @verify_owner
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



107
108
109
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 107

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 86

def self.attribute_map
  {
    :'business_id' => :'business_id',
    :'client_name' => :'client_name',
    :'country_codes' => :'country_codes',
    :'customer_id' => :'customer_id',
    :'expiration' => :'expiration',
    :'language' => :'language',
    :'link_customization_name' => :'link_customization_name',
    :'link_token' => :'link_token',
    :'redirect_uri' => :'redirect_uri',
    :'request_id' => :'request_id',
    :'sdk_type' => :'sdk_type',
    :'type' => :'type',
    :'vendor_access_token' => :'vendor_access_token',
    :'vendor_institution_id' => :'vendor_institution_id',
    :'verify_owner' => :'verify_owner'
  }
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



346
347
348
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 346

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

.openapi_nullableObject

List of attributes with nullable: true



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

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

.openapi_typesObject

Attribute type mapping.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 112

def self.openapi_types
  {
    :'business_id' => :'String',
    :'client_name' => :'String',
    :'country_codes' => :'Array<String>',
    :'customer_id' => :'String',
    :'expiration' => :'Time',
    :'language' => :'String',
    :'link_customization_name' => :'String',
    :'link_token' => :'String',
    :'redirect_uri' => :'String',
    :'request_id' => :'String',
    :'sdk_type' => :'String',
    :'type' => :'String',
    :'vendor_access_token' => :'String',
    :'vendor_institution_id' => :'String',
    :'verify_owner' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 311

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      business_id == o.business_id &&
      client_name == o.client_name &&
      country_codes == o.country_codes &&
      customer_id == o.customer_id &&
      expiration == o.expiration &&
      language == o.language &&
      link_customization_name == o.link_customization_name &&
      link_token == o.link_token &&
      redirect_uri == o.redirect_uri &&
      request_id == o.request_id &&
      sdk_type == o.sdk_type &&
      type == o.type &&
      vendor_access_token == o.vendor_access_token &&
      vendor_institution_id == o.vendor_institution_id &&
      verify_owner == o.verify_owner
end

#_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



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

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

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 448

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

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 353

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

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


333
334
335
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 333

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



339
340
341
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 339

def hash
  [business_id, client_name, country_codes, customer_id, expiration, language, link_customization_name, link_token, redirect_uri, request_id, sdk_type, type, vendor_access_token, vendor_institution_id, verify_owner].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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

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

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

  if @country_codes.length < 1
    invalid_properties.push('invalid value for "country_codes", number of items must be greater than or equal to 1.')
  end

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

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

  if !@vendor_institution_id.nil? && @vendor_institution_id.to_s.length < 1
    invalid_properties.push('invalid value for "vendor_institution_id", the character length must be great than or equal to 1.')
  end

  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



424
425
426
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 424

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



430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 430

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



418
419
420
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 418

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



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/synctera_ruby_sdk/models/external_account_link_token.rb', line 253

def valid?
  return false if @client_name.nil?
  return false if @country_codes.nil?
  return false if @country_codes.length < 1
  return false if @language.nil?
  language_validator = EnumAttributeValidator.new('String', ["EN", "FR", "ES", "NL", "DE"])
  return false unless language_validator.valid?(@language)
  sdk_type_validator = EnumAttributeValidator.new('String', ["WEB", "IOS", "ANDROID"])
  return false unless sdk_type_validator.valid?(@sdk_type)
  return false if @type.nil?
  type_validator = EnumAttributeValidator.new('String', ["DEPOSITORY", "CREDIT", "INVESTMENT", "MICRO_DEPOSIT"])
  return false unless type_validator.valid?(@type)
  return false if !@vendor_institution_id.nil? && @vendor_institution_id.to_s.length < 1
  true
end