Class: ThePlaidApi::Credit1099Recipient
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::Credit1099Recipient
- Defined in:
- lib/the_plaid_api/models/credit1099_recipient.rb
Overview
An object representing a recipient used in both 1099-K and 1099-MISC tax documents.
Instance Attribute Summary collapse
-
#account_number ⇒ String
Account number number of recipient.
-
#address ⇒ CreditPayStubAddress
Address on the pay stub.
-
#facta_filing_requirement ⇒ String
Checked if FACTA is a filing requirement.
-
#name ⇒ String
Name of recipient.
-
#second_tin_exists ⇒ String
Checked if 2nd TIN exists.
-
#tin ⇒ String
Tax identification number of recipient.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(address: SKIP, name: SKIP, tin: SKIP, account_number: SKIP, facta_filing_requirement: SKIP, second_tin_exists: SKIP, additional_properties: nil) ⇒ Credit1099Recipient
constructor
A new instance of Credit1099Recipient.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(address: SKIP, name: SKIP, tin: SKIP, account_number: SKIP, facta_filing_requirement: SKIP, second_tin_exists: SKIP, additional_properties: nil) ⇒ Credit1099Recipient
Returns a new instance of Credit1099Recipient.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 72 def initialize(address: SKIP, name: SKIP, tin: SKIP, account_number: SKIP, facta_filing_requirement: SKIP, second_tin_exists: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @address = address unless address == SKIP @name = name unless name == SKIP @tin = tin unless tin == SKIP @account_number = account_number unless account_number == SKIP @facta_filing_requirement = facta_filing_requirement unless facta_filing_requirement == SKIP @second_tin_exists = second_tin_exists unless second_tin_exists == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_number ⇒ String
Account number number of recipient.
27 28 29 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 27 def account_number @account_number end |
#address ⇒ CreditPayStubAddress
Address on the pay stub.
15 16 17 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 15 def address @address end |
#facta_filing_requirement ⇒ String
Checked if FACTA is a filing requirement.
31 32 33 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 31 def facta_filing_requirement @facta_filing_requirement end |
#name ⇒ String
Name of recipient.
19 20 21 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 19 def name @name end |
#second_tin_exists ⇒ String
Checked if 2nd TIN exists.
35 36 37 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 35 def second_tin_exists @second_tin_exists end |
#tin ⇒ String
Tax identification number of recipient.
23 24 25 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 23 def tin @tin end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 88 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. address = CreditPayStubAddress.from_hash(hash['address']) if hash['address'] name = hash.key?('name') ? hash['name'] : SKIP tin = hash.key?('tin') ? hash['tin'] : SKIP account_number = hash.key?('account_number') ? hash['account_number'] : SKIP facta_filing_requirement = hash.key?('facta_filing_requirement') ? hash['facta_filing_requirement'] : SKIP second_tin_exists = hash.key?('second_tin_exists') ? hash['second_tin_exists'] : 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. Credit1099Recipient.new(address: address, name: name, tin: tin, account_number: account_number, facta_filing_requirement: facta_filing_requirement, second_tin_exists: second_tin_exists, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['address'] = 'address' @_hash['name'] = 'name' @_hash['tin'] = 'tin' @_hash['account_number'] = 'account_number' @_hash['facta_filing_requirement'] = 'facta_filing_requirement' @_hash['second_tin_exists'] = 'second_tin_exists' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 65 66 67 68 69 70 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 62 def self.nullables %w[ name tin account_number facta_filing_requirement second_tin_exists ] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 50 def self.optionals %w[ address name tin account_number facta_filing_requirement second_tin_exists ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
129 130 131 132 133 134 135 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 129 def inspect class_name = self.class.name.split('::').last "<#{class_name} address: #{@address.inspect}, name: #{@name.inspect}, tin: #{@tin.inspect},"\ " account_number: #{@account_number.inspect}, facta_filing_requirement:"\ " #{@facta_filing_requirement.inspect}, second_tin_exists: #{@second_tin_exists.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
120 121 122 123 124 125 126 |
# File 'lib/the_plaid_api/models/credit1099_recipient.rb', line 120 def to_s class_name = self.class.name.split('::').last "<#{class_name} address: #{@address}, name: #{@name}, tin: #{@tin}, account_number:"\ " #{@account_number}, facta_filing_requirement: #{@facta_filing_requirement},"\ " second_tin_exists: #{@second_tin_exists}, additional_properties:"\ " #{@additional_properties}>" end |