Class: Plaid::AssetReportCreateRequestOptions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/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, user: SKIP, additional_properties: nil) ⇒ AssetReportCreateRequestOptions

Returns a new instance of AssetReportCreateRequestOptions.



54
55
56
57
58
59
60
61
62
63
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 54

def initialize(client_report_id: SKIP, webhook: SKIP, user: SKIP,
               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
  @user = user unless user == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_report_idString

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

Returns:

  • (String)


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

def client_report_id
  @client_report_id
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:



29
30
31
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 29

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/plaid/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.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 66

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
  user = AssetReportUser.from_hash(hash['user']) if hash['user']

  # 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,
                                      user: user,
                                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



32
33
34
35
36
37
38
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 32

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

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



41
42
43
44
45
46
47
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 41

def self.optionals
  %w[
    client_report_id
    webhook
    user
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



97
98
99
100
101
102
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 97

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

#to_sObject

Provides a human-readable string representation of the object.



90
91
92
93
94
# File 'lib/plaid/models/asset_report_create_request_options.rb', line 90

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