Class: ThePlaidApi::AssetReportCreateRequestOptions

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

Overview

An optional object to filter ‘/asset_report/create` results. If provided, must be non-`null`. The optional `user` object is required for the report to be eligible for Fannie Mae’s Day 1 Certainty program.

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(client_report_id: SKIP, webhook: SKIP, include_fast_report: SKIP, products: SKIP, add_ons: SKIP, user: SKIP, require_all_items: true, additional_properties: nil) ⇒ AssetReportCreateRequestOptions

Returns a new instance of AssetReportCreateRequestOptions.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 102

def initialize(client_report_id: SKIP, webhook: SKIP,
               include_fast_report: SKIP, products: SKIP, add_ons: SKIP,
               user: SKIP, require_all_items: true,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_report_id = client_report_id unless client_report_id == SKIP
  @webhook = webhook unless webhook == SKIP
  @include_fast_report = include_fast_report unless include_fast_report == SKIP
  @products = products unless products == SKIP
  @add_ons = add_ons unless add_ons == SKIP
  @user = user unless user == SKIP
  @require_all_items = require_all_items unless require_all_items == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#add_onsArray[AssetReportAddOns]

A list of add-ons that should be included in the Asset Report. When Fast Assets is requested, Plaid will create two versions of the Asset Report: the Fast Asset Report, which will contain only Identity and Balance information, and the Full Asset Report, which will also contain Transactions information. A ‘PRODUCT_READY` webhook will be fired for each Asset Report when it is ready, and the `report_type` field will indicate whether the webhook is firing for the `full` or `fast` Asset Report. To retrieve the Fast Asset Report, call `/asset_report/get` with `fast_report` set to `true`. There is no additional charge for using Fast Assets. To create a Fast Asset Report, Plaid must successfully retrieve both Identity and Balance data; if Plaid encounters an error obtaining this data, the Fast Asset Report will not be created. However, as long as Plaid can obtain Transactions data, the Full Asset Report will still be available. When Investments is requested, `investments` must be specified in the `optional_products` array when initializing Link.

Returns:



51
52
53
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 51

def add_ons
  @add_ons
end

#client_report_idString

Client-generated identifier, which can be used by lenders to track loan applications.

Returns:

  • (String)


17
18
19
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 17

def client_report_id
  @client_report_id
end

#include_fast_reportTrueClass | FalseClass

true to return balance and identity earlier as a fast report. Defaults to false if omitted.

Returns:

  • (TrueClass | FalseClass)


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

def include_fast_report
  @include_fast_report
end

#productsArray[String]

Additional information that can be included in the asset report. Possible values: ‘“investments”`

Returns:

  • (Array[String])


32
33
34
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 32

def products
  @products
end

#require_all_itemsTrueClass | FalseClass

If set to false, only 1 item must be healthy at the time of report creation. The default value is true, which would require all items to be healthy at the time of report creation.

Returns:

  • (TrueClass | FalseClass)


64
65
66
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 64

def require_all_items
  @require_all_items
end

#userAssetReportUser

The user object allows you to provide additional information about the user to be appended to the Asset Report. All fields are optional. The ‘first_name`, `last_name`, and `ssn` fields are required if you would like the Report to be eligible for Fannie Mae’s Day 1 Certainty™ program.

Returns:



58
59
60
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 58

def user
  @user
end

#webhookString

URL to which Plaid will send Assets webhooks, for example when the requested Asset Report is ready.

Returns:

  • (String)


22
23
24
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 22

def webhook
  @webhook
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 120

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_report_id =
    hash.key?('client_report_id') ? hash['client_report_id'] : SKIP
  webhook = hash.key?('webhook') ? hash['webhook'] : SKIP
  include_fast_report =
    hash.key?('include_fast_report') ? hash['include_fast_report'] : SKIP
  products = hash.key?('products') ? hash['products'] : SKIP
  add_ons = hash.key?('add_ons') ? hash['add_ons'] : SKIP
  user = AssetReportUser.from_hash(hash['user']) if hash['user']
  require_all_items = hash['require_all_items'] ||= true

  # 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.
  AssetReportCreateRequestOptions.new(client_report_id: client_report_id,
                                      webhook: webhook,
                                      include_fast_report: include_fast_report,
                                      products: products,
                                      add_ons: add_ons,
                                      user: user,
                                      require_all_items: require_all_items,
                                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_report_id'] = 'client_report_id'
  @_hash['webhook'] = 'webhook'
  @_hash['include_fast_report'] = 'include_fast_report'
  @_hash['products'] = 'products'
  @_hash['add_ons'] = 'add_ons'
  @_hash['user'] = 'user'
  @_hash['require_all_items'] = 'require_all_items'
  @_hash
end

.nullablesObject

An array for nullable fields



93
94
95
96
97
98
99
100
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 93

def self.nullables
  %w[
    client_report_id
    webhook
    include_fast_report
    require_all_items
  ]
end

.optionalsObject

An array for optional fields



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 80

def self.optionals
  %w[
    client_report_id
    webhook
    include_fast_report
    products
    add_ons
    user
    require_all_items
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



162
163
164
165
166
167
168
169
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 162

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_report_id: #{@client_report_id.inspect}, webhook:"\
  " #{@webhook.inspect}, include_fast_report: #{@include_fast_report.inspect}, products:"\
  " #{@products.inspect}, add_ons: #{@add_ons.inspect}, user: #{@user.inspect},"\
  " require_all_items: #{@require_all_items.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



153
154
155
156
157
158
159
# File 'lib/the_plaid_api/models/asset_report_create_request_options.rb', line 153

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_report_id: #{@client_report_id}, webhook: #{@webhook},"\
  " include_fast_report: #{@include_fast_report}, products: #{@products}, add_ons:"\
  " #{@add_ons}, user: #{@user}, require_all_items: #{@require_all_items},"\
  " additional_properties: #{@additional_properties}>"
end