Class: ThePlaidApi::TransactionsEnrichRequestOptions

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

Overview

An optional object to be used with the request.

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_legacy_category: false, personal_finance_category_version: SKIP, additional_properties: nil) ⇒ TransactionsEnrichRequestOptions

Returns a new instance of TransactionsEnrichRequestOptions.



54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/the_plaid_api/models/transactions_enrich_request_options.rb', line 54

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

  @include_legacy_category = include_legacy_category unless include_legacy_category == SKIP
  unless personal_finance_category_version == SKIP
    @personal_finance_category_version =
      personal_finance_category_version
  end
  @additional_properties = additional_properties
end

Instance Attribute Details

#include_legacy_categoryTrueClass | FalseClass

Include ‘legacy_category` and `legacy_category_id` in the response (in addition to the default `personal_finance_category`). Categories are based on Plaid’s legacy taxonomy. For a full list of legacy categories, see [‘/categories/get`](plaid.com/docs/api/products/transactions/#cate goriesget).

Returns:

  • (TrueClass | FalseClass)


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

def include_legacy_category
  @include_legacy_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.



30
31
32
# File 'lib/the_plaid_api/models/transactions_enrich_request_options.rb', line 30

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.



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/the_plaid_api/models/transactions_enrich_request_options.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  include_legacy_category = hash['include_legacy_category'] ||= false
  personal_finance_category_version =
    hash.key?('personal_finance_category_version') ? hash['personal_finance_category_version'] : 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.
  TransactionsEnrichRequestOptions.new(include_legacy_category: include_legacy_category,
                                       personal_finance_category_version: personal_finance_category_version,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



50
51
52
# File 'lib/the_plaid_api/models/transactions_enrich_request_options.rb', line 50

def self.nullables
  []
end

.optionalsObject

An array for optional fields



42
43
44
45
46
47
# File 'lib/the_plaid_api/models/transactions_enrich_request_options.rb', line 42

def self.optionals
  %w[
    include_legacy_category
    personal_finance_category_version
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



99
100
101
102
103
104
# File 'lib/the_plaid_api/models/transactions_enrich_request_options.rb', line 99

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

#to_sObject

Provides a human-readable string representation of the object.



91
92
93
94
95
96
# File 'lib/the_plaid_api/models/transactions_enrich_request_options.rb', line 91

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