Class: FdxV660Api::Form1042SRecipient1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::Form1042SRecipient1
- Defined in:
- lib/fdx_v660_api/models/form1042_s_recipient1.rb
Overview
Boxes 13a, 13c-n, 13p, Recipient for Form 1042-S
Instance Attribute Summary collapse
-
#address ⇒ TaxFormAddress5
Issuer or recipient address.
-
#business_name ⇒ BusinessName4
Business issuer or recipient name.
-
#ch3_status_code ⇒ String
Ch.
-
#ch4_status_code ⇒ String
Ch.
-
#date_of_birth ⇒ Date
Box 13p, Recipient's date of birth.
-
#email ⇒ String
Issuer or recipient email address.
-
#foreign_tin ⇒ String
Foreign tax identification number, if any, * Box 12g, Withholding Agent, * Box 13m, Recipient, * Box 15g, Intermediary or flow-through entity.
-
#giin ⇒ String
Agent's Global Intermediary Identification Number (GIIN), * Box 12e, Withholding Agent, * Box 13l, Recipient, * Box 15e, Intermediary or flow-through entity, * Box 16c, Payer.
-
#individual_name ⇒ IndividualName4
Individual issuer or recipient name.
-
#lob_code ⇒ String
Box 13n, Recipient's LOB code, if any.
-
#party_type ⇒ TaxPartyType2
Type of issuer or recipient legal entity, as "BUSINESS" or "INDIVIDUAL".
-
#phone ⇒ TelephoneNumberPlusExtension1
Issuer or recipient telephone number.
-
#tin ⇒ String
Issuer or recipient Tax Identification Number.
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(tin: SKIP, party_type: SKIP, individual_name: SKIP, business_name: SKIP, address: SKIP, phone: SKIP, email: SKIP, ch3_status_code: SKIP, ch4_status_code: SKIP, giin: SKIP, foreign_tin: SKIP, lob_code: SKIP, date_of_birth: SKIP, additional_properties: nil) ⇒ Form1042SRecipient1
constructor
A new instance of Form1042SRecipient1.
-
#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(tin: SKIP, party_type: SKIP, individual_name: SKIP, business_name: SKIP, address: SKIP, phone: SKIP, email: SKIP, ch3_status_code: SKIP, ch4_status_code: SKIP, giin: SKIP, foreign_tin: SKIP, lob_code: SKIP, date_of_birth: SKIP, additional_properties: nil) ⇒ Form1042SRecipient1
Returns a new instance of Form1042SRecipient1.
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 127 def initialize(tin: SKIP, party_type: SKIP, individual_name: SKIP, business_name: SKIP, address: SKIP, phone: SKIP, email: SKIP, ch3_status_code: SKIP, ch4_status_code: SKIP, giin: SKIP, foreign_tin: SKIP, lob_code: SKIP, date_of_birth: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @tin = tin unless tin == SKIP @party_type = party_type unless party_type == SKIP @individual_name = individual_name unless individual_name == SKIP @business_name = business_name unless business_name == SKIP @address = address unless address == SKIP @phone = phone unless phone == SKIP @email = email unless email == SKIP @ch3_status_code = ch3_status_code unless ch3_status_code == SKIP @ch4_status_code = ch4_status_code unless ch4_status_code == SKIP @giin = giin unless giin == SKIP @foreign_tin = foreign_tin unless foreign_tin == SKIP @lob_code = lob_code unless lob_code == SKIP @date_of_birth = date_of_birth unless date_of_birth == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ TaxFormAddress5
Issuer or recipient address
34 35 36 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 34 def address @address end |
#business_name ⇒ BusinessName4
Business issuer or recipient name
30 31 32 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 30 def business_name @business_name end |
#ch3_status_code ⇒ String
Ch. 3 status code,
- Box 12b, Withholding Agent,
- Box 13j, Recipient,
- Box 15b, Intermediary or flow-through entity,
- Box 16d, Payer
51 52 53 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 51 def ch3_status_code @ch3_status_code end |
#ch4_status_code ⇒ String
Ch. 4 status code,
- Box 12c, Withholding Agent,
- Box 13k, Recipient,
- Box 15c, Intermediary or flow-through entity,
- Box 16e, Payer
59 60 61 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 59 def ch4_status_code @ch4_status_code end |
#date_of_birth ⇒ Date
Box 13p, Recipient's date of birth
82 83 84 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 82 def date_of_birth @date_of_birth end |
#email ⇒ String
Issuer or recipient email address. (Additional information, not part of IRS forms)
43 44 45 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 43 def email @email end |
#foreign_tin ⇒ String
Foreign tax identification number, if any,
- Box 12g, Withholding Agent,
- Box 13m, Recipient,
- Box 15g, Intermediary or flow-through entity
74 75 76 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 74 def foreign_tin @foreign_tin end |
#giin ⇒ String
Agent's Global Intermediary Identification Number (GIIN),
- Box 12e, Withholding Agent,
- Box 13l, Recipient,
- Box 15e, Intermediary or flow-through entity,
- Box 16c, Payer
67 68 69 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 67 def giin @giin end |
#individual_name ⇒ IndividualName4
Individual issuer or recipient name
26 27 28 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 26 def individual_name @individual_name end |
#lob_code ⇒ String
Box 13n, Recipient's LOB code, if any
78 79 80 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 78 def lob_code @lob_code end |
#party_type ⇒ TaxPartyType2
Type of issuer or recipient legal entity, as "BUSINESS" or "INDIVIDUAL". Commonly BUSINESS for issuer and INDIVIDUAL for recipient
22 23 24 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 22 def party_type @party_type end |
#phone ⇒ TelephoneNumberPlusExtension1
Issuer or recipient telephone number
38 39 40 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 38 def phone @phone end |
#tin ⇒ String
Issuer or recipient Tax Identification Number. The issuer TIN should normally not be truncated or masked. The recipient TIN may be truncated or masked on this recipient copy (though the full TIN will be filed on IRS copy). Usually EIN for issuer and SSN for recipient
17 18 19 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 17 def tin @tin end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 152 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. tin = hash.key?('tin') ? hash['tin'] : SKIP party_type = hash.key?('partyType') ? hash['partyType'] : SKIP individual_name = IndividualName4.from_hash(hash['individualName']) if hash['individualName'] business_name = BusinessName4.from_hash(hash['businessName']) if hash['businessName'] address = TaxFormAddress5.from_hash(hash['address']) if hash['address'] phone = TelephoneNumberPlusExtension1.from_hash(hash['phone']) if hash['phone'] email = hash.key?('email') ? hash['email'] : SKIP ch3_status_code = hash.key?('ch3StatusCode') ? hash['ch3StatusCode'] : SKIP ch4_status_code = hash.key?('ch4StatusCode') ? hash['ch4StatusCode'] : SKIP giin = hash.key?('giin') ? hash['giin'] : SKIP foreign_tin = hash.key?('foreignTin') ? hash['foreignTin'] : SKIP lob_code = hash.key?('lobCode') ? hash['lobCode'] : SKIP date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : 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. Form1042SRecipient1.new(tin: tin, party_type: party_type, individual_name: individual_name, business_name: business_name, address: address, phone: phone, email: email, ch3_status_code: ch3_status_code, ch4_status_code: ch4_status_code, giin: giin, foreign_tin: foreign_tin, lob_code: lob_code, date_of_birth: date_of_birth, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 85 def self.names @_hash = {} if @_hash.nil? @_hash['tin'] = 'tin' @_hash['party_type'] = 'partyType' @_hash['individual_name'] = 'individualName' @_hash['business_name'] = 'businessName' @_hash['address'] = 'address' @_hash['phone'] = 'phone' @_hash['email'] = 'email' @_hash['ch3_status_code'] = 'ch3StatusCode' @_hash['ch4_status_code'] = 'ch4StatusCode' @_hash['giin'] = 'giin' @_hash['foreign_tin'] = 'foreignTin' @_hash['lob_code'] = 'lobCode' @_hash['date_of_birth'] = 'dateOfBirth' @_hash end |
.nullables ⇒ Object
An array for nullable fields
123 124 125 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 123 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 104 def self.optionals %w[ tin party_type individual_name business_name address phone email ch3_status_code ch4_status_code giin foreign_tin lob_code date_of_birth ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
208 209 210 211 212 213 214 215 216 217 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 208 def inspect class_name = self.class.name.split('::').last "<#{class_name} tin: #{@tin.inspect}, party_type: #{@party_type.inspect}, individual_name:"\ " #{@individual_name.inspect}, business_name: #{@business_name.inspect}, address:"\ " #{@address.inspect}, phone: #{@phone.inspect}, email: #{@email.inspect}, ch3_status_code:"\ " #{@ch3_status_code.inspect}, ch4_status_code: #{@ch4_status_code.inspect}, giin:"\ " #{@giin.inspect}, foreign_tin: #{@foreign_tin.inspect}, lob_code: #{@lob_code.inspect},"\ " date_of_birth: #{@date_of_birth.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
198 199 200 201 202 203 204 205 |
# File 'lib/fdx_v660_api/models/form1042_s_recipient1.rb', line 198 def to_s class_name = self.class.name.split('::').last "<#{class_name} tin: #{@tin}, party_type: #{@party_type}, individual_name:"\ " #{@individual_name}, business_name: #{@business_name}, address: #{@address}, phone:"\ " #{@phone}, email: #{@email}, ch3_status_code: #{@ch3_status_code}, ch4_status_code:"\ " #{@ch4_status_code}, giin: #{@giin}, foreign_tin: #{@foreign_tin}, lob_code: #{@lob_code},"\ " date_of_birth: #{@date_of_birth}, additional_properties: #{@additional_properties}>" end |