Class: ThePlaidApi::InvestmentsTransactionsGetRequestOptions

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

Overview

An optional object to filter ‘/investments/transactions/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(account_ids: SKIP, count: 100, offset: 0, async_update: false, additional_properties: nil) ⇒ InvestmentsTransactionsGetRequestOptions

Returns a new instance of InvestmentsTransactionsGetRequestOptions.



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/the_plaid_api/models/investments_transactions_get_request_options.rb', line 63

def initialize(account_ids: SKIP, count: 100, offset: 0,
               async_update: false, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_ids =  unless  == SKIP
  @count = count unless count == SKIP
  @offset = offset unless offset == SKIP
  @async_update = async_update unless async_update == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idsArray[String]

An array of ‘account_ids` to retrieve for the Item.

Returns:

  • (Array[String])


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

def 
  @account_ids
end

#async_updateTrueClass | FalseClass

If the Item was not initialized with the investments product via the ‘products`, `required_if_supported_products`, or `optional_products` array when calling `/link/token/create`, and `async_update` is set to true, the initial Investments extraction will happen asynchronously. Plaid will subsequently fire a `HISTORICAL_UPDATE` webhook when the extraction completes. When `false`, Plaid will wait to return a response until extraction completion and no `HISTORICAL_UPDATE` webhook will fire. Note that while the extraction is happening asynchronously, calls to `/investments/transactions/get` and `/investments/refresh` will return `PRODUCT_NOT_READY` errors until the extraction completes.

Returns:

  • (TrueClass | FalseClass)


36
37
38
# File 'lib/the_plaid_api/models/investments_transactions_get_request_options.rb', line 36

def async_update
  @async_update
end

#countInteger

The number of transactions to fetch.

Returns:

  • (Integer)


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

def count
  @count
end

#offsetInteger

The number of transactions to skip when fetching transaction history

Returns:

  • (Integer)


23
24
25
# File 'lib/the_plaid_api/models/investments_transactions_get_request_options.rb', line 23

def offset
  @offset
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/the_plaid_api/models/investments_transactions_get_request_options.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('account_ids') ? hash['account_ids'] : SKIP
  count = hash['count'] ||= 100
  offset = hash['offset'] ||= 0
  async_update = hash['async_update'] ||= 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.
  InvestmentsTransactionsGetRequestOptions.new(account_ids: ,
                                               count: count,
                                               offset: offset,
                                               async_update: async_update,
                                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_ids'] = 'account_ids'
  @_hash['count'] = 'count'
  @_hash['offset'] = 'offset'
  @_hash['async_update'] = 'async_update'
  @_hash
end

.nullablesObject

An array for nullable fields



59
60
61
# File 'lib/the_plaid_api/models/investments_transactions_get_request_options.rb', line 59

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
# File 'lib/the_plaid_api/models/investments_transactions_get_request_options.rb', line 49

def self.optionals
  %w[
    account_ids
    count
    offset
    async_update
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
# File 'lib/the_plaid_api/models/investments_transactions_get_request_options.rb', line 101

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