Class: ThePlaidApi::AssetReportPdfGetRequestOptions

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

Overview

An optional object to filter or add data to ‘/asset_report/get` results. If provided, must be non-`null`.

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(days_to_include: SKIP, additional_properties: nil) ⇒ AssetReportPdfGetRequestOptions

Returns a new instance of AssetReportPdfGetRequestOptions.



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

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

  @days_to_include = days_to_include unless days_to_include == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#days_to_includeInteger

The maximum integer number of days of history to include in the Asset Report.

Returns:

  • (Integer)


16
17
18
# File 'lib/the_plaid_api/models/asset_report_pdf_get_request_options.rb', line 16

def days_to_include
  @days_to_include
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/the_plaid_api/models/asset_report_pdf_get_request_options.rb', line 48

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  days_to_include =
    hash.key?('days_to_include') ? hash['days_to_include'] : SKIP

  # 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.
  AssetReportPdfGetRequestOptions.new(days_to_include: days_to_include,
                                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



19
20
21
22
23
# File 'lib/the_plaid_api/models/asset_report_pdf_get_request_options.rb', line 19

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  %w[
    days_to_include
  ]
end

.optionalsObject

An array for optional fields



26
27
28
29
30
# File 'lib/the_plaid_api/models/asset_report_pdf_get_request_options.rb', line 26

def self.optionals
  %w[
    days_to_include
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



75
76
77
78
79
# File 'lib/the_plaid_api/models/asset_report_pdf_get_request_options.rb', line 75

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

#to_sObject

Provides a human-readable string representation of the object.



68
69
70
71
72
# File 'lib/the_plaid_api/models/asset_report_pdf_get_request_options.rb', line 68

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