Class: ThePlaidApi::TransactionsSyncRequestOptions

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

Overview

An optional object to be used with the request. If specified, ‘options` must not be `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(include_original_description: false, include_personal_finance_category: false, include_logo_and_counterparty_beta: false, personal_finance_category_version: SKIP, days_requested: 90, account_id: SKIP, additional_properties: nil) ⇒ TransactionsSyncRequestOptions

Returns a new instance of TransactionsSyncRequestOptions.



117
118
119
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
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 117

def initialize(include_original_description: false,
               include_personal_finance_category: false,
               include_logo_and_counterparty_beta: false,
               personal_finance_category_version: SKIP, days_requested: 90,
               account_id: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  unless include_original_description == SKIP
    @include_original_description =
      include_original_description
  end
  unless include_personal_finance_category == SKIP
    @include_personal_finance_category =
      include_personal_finance_category
  end
  unless include_logo_and_counterparty_beta == SKIP
    @include_logo_and_counterparty_beta =
      include_logo_and_counterparty_beta
  end
  unless personal_finance_category_version == SKIP
    @personal_finance_category_version =
      personal_finance_category_version
  end
  @days_requested = days_requested unless days_requested == SKIP
  @account_id =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_idString

If provided, the returned updates and cursor will only reflect the specified account’s transactions. Omitting ‘account_id` returns updates for all accounts under the Item. Note that specifying an `account_id` effectively creates a separate incremental update stream—and therefore a separate cursor—for that account. If multiple accounts are queried this way, you will maintain multiple cursors, one per `account_id`. If you decide to begin filtering by `account_id` after using no `account_id`, start fresh with a null cursor and maintain separate `(account_id, cursor)` pairs going forward. Do not reuse any previously saved cursors, as this can cause pagination errors or incomplete data. Note: An error will be returned if a provided `account_id` is not associated with the Item.

Returns:

  • (String)


81
82
83
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 81

def 
  @account_id
end

#days_requestedInteger

This field only applies to calls for Items where the Transactions product has not already been initialized (i.e., by specifying ‘transactions` in the `products`, `required_if_supported_products`, or `optional_products` array when calling `/link/token/create` or by making a previous call to `/transactions/sync` or `/transactions/get`). In those cases, the field controls the maximum number of days of transaction history that Plaid will request from the financial institution. The more transaction history is requested, the longer the historical update poll will take. If no value is specified, 90 days of history will be requested by default. In Production, if a value less than 30 is provided, a minimum of 30 days of transaction history will be requested. If you are initializing your Items with transactions during the `/link/token/create` call (e.g. by including `transactions` in the `/link/token/create` `products` array), you must use the [`transactions.days_requested`](plaid.com/docs/api/link/#link-toke n-create-request-transactions-days-requested) field in the `/link/token/create` request instead of in the `/transactions/sync` request. If the Item has already been initialized with the Transactions product, this field will have no effect. The maximum amount of transaction history to request on an Item cannot be updated if Transactions has already been added to the Item. To request older transaction history on an Item where Transactions has already been added, you must delete the Item via `/item/remove` and send the user through Link to create a new Item. Customers using [Recurring Transactions](plaid.com/docs/api/products/transactions/#transactio nsrecurringget) should request at least 180 days of history for optimal results.

Returns:

  • (Integer)


66
67
68
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 66

def days_requested
  @days_requested
end

#include_logo_and_counterparty_betaTrueClass | FalseClass

Counterparties and extra merchant fields are now returned by default.

Returns:

  • (TrueClass | FalseClass)


24
25
26
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 24

def include_logo_and_counterparty_beta
  @include_logo_and_counterparty_beta
end

#include_original_descriptionTrueClass | FalseClass

Include the raw unparsed transaction description from the financial institution.

Returns:

  • (TrueClass | FalseClass)


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

def include_original_description
  @include_original_description
end

#include_personal_finance_categoryTrueClass | FalseClass

Personal finance categories are now returned by default.

Returns:

  • (TrueClass | FalseClass)


20
21
22
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 20

def include_personal_finance_category
  @include_personal_finance_category
end

#personal_finance_category_versionPersonalFinanceCategoryVersion

Indicates which version of the personal finance category taxonomy is being used. [View PFCv2 and PFCv1 taxonomies](plaid.com/documents/pfc-taxonomy-all.csv). If you enabled Transactions or Enrich before December 2025 you will receive the ‘v1` taxonomy by default and may request `v2` by explicitly setting this field to `v2` in the request. If you enabled Transactions or Enrich on or after December 2025, you may only receive the `v2` taxonomy.



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

def personal_finance_category_version
  @personal_finance_category_version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 147

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  include_original_description =
    hash['include_original_description'] ||= false
  include_personal_finance_category =
    hash['include_personal_finance_category'] ||= false
  include_logo_and_counterparty_beta =
    hash['include_logo_and_counterparty_beta'] ||= false
  personal_finance_category_version =
    hash.key?('personal_finance_category_version') ? hash['personal_finance_category_version'] : SKIP
  days_requested = hash['days_requested'] ||= 90
   = hash.key?('account_id') ? hash['account_id'] : 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.
  TransactionsSyncRequestOptions.new(include_original_description: include_original_description,
                                     include_personal_finance_category: include_personal_finance_category,
                                     include_logo_and_counterparty_beta: include_logo_and_counterparty_beta,
                                     personal_finance_category_version: personal_finance_category_version,
                                     days_requested: days_requested,
                                     account_id: ,
                                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 84

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['include_original_description'] = 'include_original_description'
  @_hash['include_personal_finance_category'] =
    'include_personal_finance_category'
  @_hash['include_logo_and_counterparty_beta'] =
    'include_logo_and_counterparty_beta'
  @_hash['personal_finance_category_version'] =
    'personal_finance_category_version'
  @_hash['days_requested'] = 'days_requested'
  @_hash['account_id'] = 'account_id'
  @_hash
end

.nullablesObject

An array for nullable fields



111
112
113
114
115
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 111

def self.nullables
  %w[
    include_original_description
  ]
end

.optionalsObject

An array for optional fields



99
100
101
102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 99

def self.optionals
  %w[
    include_original_description
    include_personal_finance_category
    include_logo_and_counterparty_beta
    personal_finance_category_version
    days_requested
    account_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



191
192
193
194
195
196
197
198
199
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 191

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} include_original_description: #{@include_original_description.inspect},"\
  " include_personal_finance_category: #{@include_personal_finance_category.inspect},"\
  " include_logo_and_counterparty_beta: #{@include_logo_and_counterparty_beta.inspect},"\
  " personal_finance_category_version: #{@personal_finance_category_version.inspect},"\
  " days_requested: #{@days_requested.inspect}, account_id: #{@account_id.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



180
181
182
183
184
185
186
187
188
# File 'lib/the_plaid_api/models/transactions_sync_request_options.rb', line 180

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} include_original_description: #{@include_original_description},"\
  " include_personal_finance_category: #{@include_personal_finance_category},"\
  " include_logo_and_counterparty_beta: #{@include_logo_and_counterparty_beta},"\
  " personal_finance_category_version: #{@personal_finance_category_version}, days_requested:"\
  " #{@days_requested}, account_id: #{@account_id}, additional_properties:"\
  " #{@additional_properties}>"
end