Class: ThePlaidApi::LinkTokenCreateRequestIdentityVerification

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/link_token_create_request_identity_verification.rb

Overview

Specifies option for initializing Link for use with the Identity Verification product.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(template_id:, consent: SKIP, gave_consent: false, additional_properties: nil) ⇒ LinkTokenCreateRequestIdentityVerification

Returns a new instance of LinkTokenCreateRequestIdentityVerification.



52
53
54
55
56
57
58
59
60
61
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 52

def initialize(template_id:, consent: SKIP, gave_consent: false,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @template_id = template_id
  @consent = consent unless consent == SKIP
  @gave_consent = gave_consent unless gave_consent == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


19
20
21
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 19

def consent
  @consent
end

A flag specifying whether the end user has already agreed to a privacy policy specifying that their data will be shared with Plaid for verification purposes. If ‘gave_consent` is set to `true`, the `accept_tos` step will be marked as `skipped` and the end user’s session will start at the next step requirement.

Returns:

  • (TrueClass | FalseClass)


28
29
30
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 28

def gave_consent
  @gave_consent
end

#template_idString

TODO: Write general description for this method

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 15

def template_id
  @template_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  template_id = hash.key?('template_id') ? hash['template_id'] : nil
  consent = hash.key?('consent') ? hash['consent'] : SKIP
  gave_consent = hash['gave_consent'] ||= false

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  LinkTokenCreateRequestIdentityVerification.new(template_id: template_id,
                                                 consent: consent,
                                                 gave_consent: gave_consent,
                                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



31
32
33
34
35
36
37
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 31

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['template_id'] = 'template_id'
  @_hash['consent'] = 'consent'
  @_hash['gave_consent'] = 'gave_consent'
  @_hash
end

.nullablesObject

An array for nullable fields



48
49
50
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 48

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
43
44
45
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 40

def self.optionals
  %w[
    consent
    gave_consent
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 94

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} template_id: #{@template_id.inspect}, consent: #{@consent.inspect},"\
  " gave_consent: #{@gave_consent.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



87
88
89
90
91
# File 'lib/the_plaid_api/models/link_token_create_request_identity_verification.rb', line 87

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} template_id: #{@template_id}, consent: #{@consent}, gave_consent:"\
  " #{@gave_consent}, additional_properties: #{@additional_properties}>"
end