Class: ThePlaidApi::LinkTokenCreateHostedLink

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

Overview

Configuration parameters for Hosted Link. To enable the session for Hosted Link, send this object in the request. It can be empty.

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(delivery_method: SKIP, completion_redirect_uri: SKIP, url_lifetime_seconds: SKIP, is_mobile_app: false, additional_properties: nil) ⇒ LinkTokenCreateHostedLink

Returns a new instance of LinkTokenCreateHostedLink.



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 67

def initialize(delivery_method: SKIP, completion_redirect_uri: SKIP,
               url_lifetime_seconds: SKIP, is_mobile_app: false,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @delivery_method = delivery_method unless delivery_method == SKIP
  @completion_redirect_uri = completion_redirect_uri unless completion_redirect_uri == SKIP
  @url_lifetime_seconds = url_lifetime_seconds unless url_lifetime_seconds == SKIP
  @is_mobile_app = is_mobile_app unless is_mobile_app == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#completion_redirect_uriString

URI that Hosted Link will redirect to upon completion of the Link flow. This will only occur in Hosted Link sessions, not in other implementation methods.

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 27

def completion_redirect_uri
  @completion_redirect_uri
end

#delivery_methodHostedLinkDeliveryMethod

How Plaid should deliver the Plaid Link session to the customer. Only available to customers enabled for Link Delivery (beta). To request Link Delivery access, contact your account manager. ‘sms’ will deliver via SMS. Must pass ‘user.phone_number`. ’email’ will deliver via email. Must pass ‘user.email_address`. In the Sandbox environment, this field will be ignored; use the Production environment to test Link Delivery instead.



21
22
23
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 21

def delivery_method
  @delivery_method
end

#is_mobile_appTrueClass | FalseClass

This indicates whether the client is opening hosted Link in a mobile app in an ‘AsWebAuthenticationSession` or Chrome custom tab.

Returns:

  • (TrueClass | FalseClass)


40
41
42
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 40

def is_mobile_app
  @is_mobile_app
end

#url_lifetime_secondsInteger

How many seconds the link will be valid for. Must be positive. Cannot be longer than 21 days. The default lifetime is 7 days for links delivered by email, 1 day for links delivered via SMS, and 30 minutes for links not sent via Plaid Link delivery. This parameter will override the value of all three link types.

Returns:

  • (Integer)


35
36
37
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 35

def url_lifetime_seconds
  @url_lifetime_seconds
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 81

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  delivery_method =
    hash.key?('delivery_method') ? hash['delivery_method'] : SKIP
  completion_redirect_uri =
    hash.key?('completion_redirect_uri') ? hash['completion_redirect_uri'] : SKIP
  url_lifetime_seconds =
    hash.key?('url_lifetime_seconds') ? hash['url_lifetime_seconds'] : SKIP
  is_mobile_app = hash['is_mobile_app'] ||= 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.
  LinkTokenCreateHostedLink.new(delivery_method: delivery_method,
                                completion_redirect_uri: completion_redirect_uri,
                                url_lifetime_seconds: url_lifetime_seconds,
                                is_mobile_app: is_mobile_app,
                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



43
44
45
46
47
48
49
50
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 43

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['delivery_method'] = 'delivery_method'
  @_hash['completion_redirect_uri'] = 'completion_redirect_uri'
  @_hash['url_lifetime_seconds'] = 'url_lifetime_seconds'
  @_hash['is_mobile_app'] = 'is_mobile_app'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 63

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    delivery_method
    completion_redirect_uri
    url_lifetime_seconds
    is_mobile_app
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



117
118
119
120
121
122
123
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 117

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} delivery_method: #{@delivery_method.inspect}, completion_redirect_uri:"\
  " #{@completion_redirect_uri.inspect}, url_lifetime_seconds:"\
  " #{@url_lifetime_seconds.inspect}, is_mobile_app: #{@is_mobile_app.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



109
110
111
112
113
114
# File 'lib/the_plaid_api/models/link_token_create_hosted_link.rb', line 109

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} delivery_method: #{@delivery_method}, completion_redirect_uri:"\
  " #{@completion_redirect_uri}, url_lifetime_seconds: #{@url_lifetime_seconds},"\
  " is_mobile_app: #{@is_mobile_app}, additional_properties: #{@additional_properties}>"
end