Class: FdxV660Api::Form1042S1
- Defined in:
- lib/fdx_v660_api/models/form1042_s1.rb
Overview
Foreign Person's U.S. Source Income Subject to Withholding
Instance Attribute Summary collapse
-
#account_id ⇒ String
Long-term persistent identity of the source account.
-
#account_number ⇒ String
Box 13o, Recipient account number.
-
#additional_information ⇒ String
Additional explanation text or content about this tax form.
-
#amended ⇒ TrueClass | FalseClass
Amended.
-
#amendment_number ⇒ Integer
Amendment number.
-
#attributes ⇒ Array[TaxFormAttribute]
Additional attributes for this tax form when defined fields are not available.
-
#ch3_exemption_code ⇒ String
Box 3a, Exemption code.
-
#ch3_tax_rate ⇒ Float
Box 3b, Tax rate.
-
#ch4_exemption_code ⇒ String
Box 4a, Exemption code.
-
#ch4_tax_rate ⇒ Float
Box 4b, Tax rate.
-
#chapter_indicator ⇒ String
Box 3, Chapter indicator, either '3' or '4'.
-
#corrected ⇒ TrueClass | FalseClass
True to indicate this is a corrected tax form.
-
#error ⇒ Error2
Present if an error was encountered while retrieving this form.
-
#escrow_procedures_applied ⇒ TrueClass | FalseClass
Box 7b, Check if federal tax withheld was not deposited with the IRS because escrow procedures were applied.
-
#federal_tax_withheld ⇒ Float
Box 7a, Federal tax withheld.
-
#form1042_recipient ⇒ Form1042SRecipient1
Boxes 13a, 13c-n, 13p, Recipient for Form 1042-S.
-
#form_id ⇒ String
Unique form identifier.
-
#gross_income ⇒ Float
Box 2, Gross income.
-
#income_type_code ⇒ String
Box 1, Income code.
-
#intermediary ⇒ Form1042SAgent3
Boxes 15a-e, 15g-m, Intermediary or flow thru entity.
-
#intermediary_country ⇒ String
Box 15f, IRS country code for Intermediary.
-
#issuer ⇒ TaxParty8
Issuer's name, address, phone, and TIN.
-
#links ⇒ Array[HateoasLink]
Links to retrieve this form as data or image, or to invoke other APIs.
-
#net_income ⇒ Float
Box 6, Net income.
-
#other_agents_tax_withheld ⇒ Float
Box 8, Tax withheld by other agents.
-
#payer ⇒ Form1042SAgent4
Boxes 16a-e, Payer.
-
#primary ⇒ Form1042SAgent2
Boxes 14a-b, Primary Withholding Agent.
-
#prorata_basis_reporting ⇒ TrueClass | FalseClass
Box 15, Check if pro-rata basis reporting.
-
#recipient ⇒ TaxParty1
Recipient's name, address, phone, and TIN.
-
#recipient_country ⇒ String
Box 13b, IRS country code for Recipient.
-
#recipient_repaid_amount ⇒ Float
Box 9, Overwithheld tax repaid to recipient pursuant to adjustment procedures.
-
#revised_reporting ⇒ TrueClass | FalseClass
Box 7d, Check if you are a qualified intermediary, withholding foreign partnership, or withholding foreign trust revising its reporting on Form 1042-S to report to a specific recipient.
-
#state_and_local ⇒ StateAndLocalTaxWithholding1
Box 17, State and Local tax withholding.
-
#subsequent_year ⇒ TrueClass | FalseClass
Box 7c, Check if withholding occurred in subsequent year with respect to a partnership interest.
-
#tax_form_date ⇒ Date
Date of production or delivery of the tax form.
-
#tax_form_id ⇒ String
Long-term persistent id for this tax form.
-
#tax_form_type ⇒ TypeFormType1
Enumerated name of the tax form entity e.g.
-
#tax_year ⇒ Integer
Year for which taxes are being paid.
-
#total_tax_withholding_credit ⇒ Float
Box 10, Total withholding credit (combine boxes 7a, 8, and 9).
-
#withholding_agent ⇒ Form1042SAgent1
Boxes 12a-e & 12g-m, Withholding agent.
-
#withholding_agent_country ⇒ String
Box 12f, IRS country code for Withholding Agent.
-
#withholding_agent_tax_paid ⇒ Float
Box 11, Tax paid by withholding agent (amounts not withheld).
-
#withholding_allowance ⇒ Float
Box 5, Withholding allowance.
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(tax_year: SKIP, corrected: SKIP, account_id: SKIP, tax_form_id: SKIP, tax_form_date: SKIP, additional_information: SKIP, tax_form_type: SKIP, issuer: SKIP, recipient: SKIP, attributes: SKIP, error: SKIP, links: SKIP, form_id: SKIP, amended: SKIP, amendment_number: SKIP, income_type_code: SKIP, gross_income: SKIP, chapter_indicator: SKIP, ch3_exemption_code: SKIP, ch3_tax_rate: SKIP, ch4_exemption_code: SKIP, ch4_tax_rate: SKIP, withholding_allowance: SKIP, net_income: SKIP, federal_tax_withheld: SKIP, escrow_procedures_applied: SKIP, subsequent_year: SKIP, revised_reporting: SKIP, other_agents_tax_withheld: SKIP, recipient_repaid_amount: SKIP, total_tax_withholding_credit: SKIP, withholding_agent_tax_paid: SKIP, withholding_agent: SKIP, withholding_agent_country: SKIP, form1042_recipient: SKIP, recipient_country: SKIP, account_number: SKIP, primary: SKIP, prorata_basis_reporting: SKIP, intermediary: SKIP, intermediary_country: SKIP, payer: SKIP, state_and_local: SKIP, additional_properties: nil) ⇒ Form1042S1
constructor
A new instance of Form1042S1.
-
#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(tax_year: SKIP, corrected: SKIP, account_id: SKIP, tax_form_id: SKIP, tax_form_date: SKIP, additional_information: SKIP, tax_form_type: SKIP, issuer: SKIP, recipient: SKIP, attributes: SKIP, error: SKIP, links: SKIP, form_id: SKIP, amended: SKIP, amendment_number: SKIP, income_type_code: SKIP, gross_income: SKIP, chapter_indicator: SKIP, ch3_exemption_code: SKIP, ch3_tax_rate: SKIP, ch4_exemption_code: SKIP, ch4_tax_rate: SKIP, withholding_allowance: SKIP, net_income: SKIP, federal_tax_withheld: SKIP, escrow_procedures_applied: SKIP, subsequent_year: SKIP, revised_reporting: SKIP, other_agents_tax_withheld: SKIP, recipient_repaid_amount: SKIP, total_tax_withholding_credit: SKIP, withholding_agent_tax_paid: SKIP, withholding_agent: SKIP, withholding_agent_country: SKIP, form1042_recipient: SKIP, recipient_country: SKIP, account_number: SKIP, primary: SKIP, prorata_basis_reporting: SKIP, intermediary: SKIP, intermediary_country: SKIP, payer: SKIP, state_and_local: SKIP, additional_properties: nil) ⇒ Form1042S1
Returns a new instance of Form1042S1.
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 308 def initialize(tax_year: SKIP, corrected: SKIP, account_id: SKIP, tax_form_id: SKIP, tax_form_date: SKIP, additional_information: SKIP, tax_form_type: SKIP, issuer: SKIP, recipient: SKIP, attributes: SKIP, error: SKIP, links: SKIP, form_id: SKIP, amended: SKIP, amendment_number: SKIP, income_type_code: SKIP, gross_income: SKIP, chapter_indicator: SKIP, ch3_exemption_code: SKIP, ch3_tax_rate: SKIP, ch4_exemption_code: SKIP, ch4_tax_rate: SKIP, withholding_allowance: SKIP, net_income: SKIP, federal_tax_withheld: SKIP, escrow_procedures_applied: SKIP, subsequent_year: SKIP, revised_reporting: SKIP, other_agents_tax_withheld: SKIP, recipient_repaid_amount: SKIP, total_tax_withholding_credit: SKIP, withholding_agent_tax_paid: SKIP, withholding_agent: SKIP, withholding_agent_country: SKIP, form1042_recipient: SKIP, recipient_country: SKIP, account_number: SKIP, primary: SKIP, prorata_basis_reporting: SKIP, intermediary: SKIP, intermediary_country: SKIP, payer: SKIP, state_and_local: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @tax_year = tax_year unless tax_year == SKIP @corrected = corrected unless corrected == SKIP @account_id = account_id unless account_id == SKIP @tax_form_id = tax_form_id unless tax_form_id == SKIP @tax_form_date = tax_form_date unless tax_form_date == SKIP @additional_information = additional_information unless additional_information == SKIP @tax_form_type = tax_form_type unless tax_form_type == SKIP @issuer = issuer unless issuer == SKIP @recipient = recipient unless recipient == SKIP @attributes = attributes unless attributes == SKIP @error = error unless error == SKIP @links = links unless links == SKIP @form_id = form_id unless form_id == SKIP @amended = amended unless amended == SKIP @amendment_number = amendment_number unless amendment_number == SKIP @income_type_code = income_type_code unless income_type_code == SKIP @gross_income = gross_income unless gross_income == SKIP @chapter_indicator = chapter_indicator unless chapter_indicator == SKIP @ch3_exemption_code = ch3_exemption_code unless ch3_exemption_code == SKIP @ch3_tax_rate = ch3_tax_rate unless ch3_tax_rate == SKIP @ch4_exemption_code = ch4_exemption_code unless ch4_exemption_code == SKIP @ch4_tax_rate = ch4_tax_rate unless ch4_tax_rate == SKIP @withholding_allowance = withholding_allowance unless withholding_allowance == SKIP @net_income = net_income unless net_income == SKIP @federal_tax_withheld = federal_tax_withheld unless federal_tax_withheld == SKIP unless escrow_procedures_applied == SKIP @escrow_procedures_applied = escrow_procedures_applied end @subsequent_year = subsequent_year unless subsequent_year == SKIP @revised_reporting = revised_reporting unless revised_reporting == SKIP unless other_agents_tax_withheld == SKIP @other_agents_tax_withheld = other_agents_tax_withheld end @recipient_repaid_amount = recipient_repaid_amount unless recipient_repaid_amount == SKIP unless total_tax_withholding_credit == SKIP @total_tax_withholding_credit = total_tax_withholding_credit end unless withholding_agent_tax_paid == SKIP @withholding_agent_tax_paid = withholding_agent_tax_paid end @withholding_agent = withholding_agent unless withholding_agent == SKIP unless withholding_agent_country == SKIP @withholding_agent_country = withholding_agent_country end @form1042_recipient = form1042_recipient unless form1042_recipient == SKIP @recipient_country = recipient_country unless recipient_country == SKIP @account_number = account_number unless account_number == SKIP @primary = primary unless primary == SKIP @prorata_basis_reporting = prorata_basis_reporting unless prorata_basis_reporting == SKIP @intermediary = intermediary unless intermediary == SKIP @intermediary_country = intermediary_country unless intermediary_country == SKIP @payer = payer unless payer == SKIP @state_and_local = state_and_local unless state_and_local == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
Long-term persistent identity of the source account. Not the account number
23 24 25 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 23 def account_id @account_id end |
#account_number ⇒ String
Box 13o, Recipient account number
178 179 180 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 178 def account_number @account_number end |
#additional_information ⇒ String
Additional explanation text or content about this tax form
37 38 39 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 37 def additional_information @additional_information end |
#amended ⇒ TrueClass | FalseClass
Amended
79 80 81 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 79 def amended @amended end |
#amendment_number ⇒ Integer
Amendment number
83 84 85 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 83 def amendment_number @amendment_number end |
#attributes ⇒ Array[TaxFormAttribute]
Additional attributes for this tax form when defined fields are not available. Some specific additional attributes already defined by providers: Fields required by [IRS FIRE](https://www.irs.gov/e-file-providers/filing-information-returns-elec tronically-fire): Name Control, Type of Identification Number (EIN, SSN, ITIN, ATIN). (ATIN is tax ID number for pending adoptions.) Tax form provider field for taxpayer notification: Recipient Email Address.
63 64 65 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 63 def attributes @attributes end |
#ch3_exemption_code ⇒ String
Box 3a, Exemption code
99 100 101 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 99 def ch3_exemption_code @ch3_exemption_code end |
#ch3_tax_rate ⇒ Float
Box 3b, Tax rate
103 104 105 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 103 def ch3_tax_rate @ch3_tax_rate end |
#ch4_exemption_code ⇒ String
Box 4a, Exemption code
107 108 109 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 107 def ch4_exemption_code @ch4_exemption_code end |
#ch4_tax_rate ⇒ Float
Box 4b, Tax rate
111 112 113 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 111 def ch4_tax_rate @ch4_tax_rate end |
#chapter_indicator ⇒ String
Box 3, Chapter indicator, either '3' or '4'
95 96 97 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 95 def chapter_indicator @chapter_indicator end |
#corrected ⇒ TrueClass | FalseClass
True to indicate this is a corrected tax form
18 19 20 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 18 def corrected @corrected end |
#error ⇒ Error2
Present if an error was encountered while retrieving this form
67 68 69 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 67 def error @error end |
#escrow_procedures_applied ⇒ TrueClass | FalseClass
Box 7b, Check if federal tax withheld was not deposited with the IRS because escrow procedures were applied
128 129 130 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 128 def escrow_procedures_applied @escrow_procedures_applied end |
#federal_tax_withheld ⇒ Float
Box 7a, Federal tax withheld
123 124 125 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 123 def federal_tax_withheld @federal_tax_withheld end |
#form1042_recipient ⇒ Form1042SRecipient1
Boxes 13a, 13c-n, 13p, Recipient for Form 1042-S
169 170 171 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 169 def form1042_recipient @form1042_recipient end |
#form_id ⇒ String
Unique form identifier
75 76 77 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 75 def form_id @form_id end |
#gross_income ⇒ Float
Box 2, Gross income
91 92 93 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 91 def gross_income @gross_income end |
#income_type_code ⇒ String
Box 1, Income code
87 88 89 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 87 def income_type_code @income_type_code end |
#intermediary ⇒ Form1042SAgent3
Boxes 15a-e, 15g-m, Intermediary or flow thru entity
190 191 192 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 190 def intermediary @intermediary end |
#intermediary_country ⇒ String
Box 15f, IRS country code for Intermediary. See IRS Country Codes
195 196 197 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 195 def intermediary_country @intermediary_country end |
#issuer ⇒ TaxParty8
Issuer's name, address, phone, and TIN. Issuer data need only be transmitted on enclosing TaxStatement, if it is the same on all its included tax forms.
47 48 49 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 47 def issuer @issuer end |
#links ⇒ Array[HateoasLink]
Links to retrieve this form as data or image, or to invoke other APIs
71 72 73 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 71 def links @links end |
#net_income ⇒ Float
Box 6, Net income
119 120 121 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 119 def net_income @net_income end |
#other_agents_tax_withheld ⇒ Float
Box 8, Tax withheld by other agents
143 144 145 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 143 def other_agents_tax_withheld @other_agents_tax_withheld end |
#payer ⇒ Form1042SAgent4
Boxes 16a-e, Payer
199 200 201 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 199 def payer @payer end |
#primary ⇒ Form1042SAgent2
Boxes 14a-b, Primary Withholding Agent
182 183 184 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 182 def primary @primary end |
#prorata_basis_reporting ⇒ TrueClass | FalseClass
Box 15, Check if pro-rata basis reporting
186 187 188 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 186 def prorata_basis_reporting @prorata_basis_reporting end |
#recipient ⇒ TaxParty1
Recipient's name, address, phone, and TIN. Recipient data need only be transmitted on enclosing TaxStatement, if it is the same on all its included tax forms.
53 54 55 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 53 def recipient @recipient end |
#recipient_country ⇒ String
Box 13b, IRS country code for Recipient. See IRS Country Codes
174 175 176 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 174 def recipient_country @recipient_country end |
#recipient_repaid_amount ⇒ Float
Box 9, Overwithheld tax repaid to recipient pursuant to adjustment procedures
148 149 150 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 148 def recipient_repaid_amount @recipient_repaid_amount end |
#revised_reporting ⇒ TrueClass | FalseClass
Box 7d, Check if you are a qualified intermediary, withholding foreign partnership, or withholding foreign trust revising its reporting on Form 1042-S to report to a specific recipient. Added for tax year 2025
139 140 141 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 139 def revised_reporting @revised_reporting end |
#state_and_local ⇒ StateAndLocalTaxWithholding1
Box 17, State and Local tax withholding
203 204 205 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 203 def state_and_local @state_and_local end |
#subsequent_year ⇒ TrueClass | FalseClass
Box 7c, Check if withholding occurred in subsequent year with respect to a partnership interest
133 134 135 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 133 def subsequent_year @subsequent_year end |
#tax_form_date ⇒ Date
Date of production or delivery of the tax form
33 34 35 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 33 def tax_form_date @tax_form_date end |
#tax_form_id ⇒ String
Long-term persistent id for this tax form. Depending upon the data provider, this may be the same id as the enclosing tax statement id, or this may be a different id, or this id may be omitted.
29 30 31 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 29 def tax_form_id @tax_form_id end |
#tax_form_type ⇒ TypeFormType1
Enumerated name of the tax form entity e.g. "TaxW2"
41 42 43 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 41 def tax_form_type @tax_form_type end |
#tax_year ⇒ Integer
Year for which taxes are being paid
14 15 16 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 14 def tax_year @tax_year end |
#total_tax_withholding_credit ⇒ Float
Box 10, Total withholding credit (combine boxes 7a, 8, and 9)
152 153 154 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 152 def total_tax_withholding_credit @total_tax_withholding_credit end |
#withholding_agent ⇒ Form1042SAgent1
Boxes 12a-e & 12g-m, Withholding agent
160 161 162 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 160 def withholding_agent @withholding_agent end |
#withholding_agent_country ⇒ String
Box 12f, IRS country code for Withholding Agent. See IRS Country Codes
165 166 167 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 165 def withholding_agent_country @withholding_agent_country end |
#withholding_agent_tax_paid ⇒ Float
Box 11, Tax paid by withholding agent (amounts not withheld)
156 157 158 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 156 def withholding_agent_tax_paid @withholding_agent_tax_paid end |
#withholding_allowance ⇒ Float
Box 5, Withholding allowance
115 116 117 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 115 def withholding_allowance @withholding_allowance end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 394 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. tax_year = hash.key?('taxYear') ? hash['taxYear'] : SKIP corrected = hash.key?('corrected') ? hash['corrected'] : SKIP account_id = hash.key?('accountId') ? hash['accountId'] : SKIP tax_form_id = hash.key?('taxFormId') ? hash['taxFormId'] : SKIP tax_form_date = hash.key?('taxFormDate') ? hash['taxFormDate'] : SKIP additional_information = hash.key?('additionalInformation') ? hash['additionalInformation'] : SKIP tax_form_type = hash.key?('taxFormType') ? hash['taxFormType'] : SKIP issuer = TaxParty8.from_hash(hash['issuer']) if hash['issuer'] recipient = TaxParty1.from_hash(hash['recipient']) if hash['recipient'] # Parameter is an array, so we need to iterate through it attributes = nil unless hash['attributes'].nil? attributes = [] hash['attributes'].each do |structure| attributes << (TaxFormAttribute.from_hash(structure) if structure) end end attributes = SKIP unless hash.key?('attributes') error = Error2.from_hash(hash['error']) if hash['error'] # Parameter is an array, so we need to iterate through it links = nil unless hash['links'].nil? links = [] hash['links'].each do |structure| links << (HateoasLink.from_hash(structure) if structure) end end links = SKIP unless hash.key?('links') form_id = hash.key?('formId') ? hash['formId'] : SKIP amended = hash.key?('amended') ? hash['amended'] : SKIP amendment_number = hash.key?('amendmentNumber') ? hash['amendmentNumber'] : SKIP income_type_code = hash.key?('incomeTypeCode') ? hash['incomeTypeCode'] : SKIP gross_income = hash.key?('grossIncome') ? hash['grossIncome'] : SKIP chapter_indicator = hash.key?('chapterIndicator') ? hash['chapterIndicator'] : SKIP ch3_exemption_code = hash.key?('ch3ExemptionCode') ? hash['ch3ExemptionCode'] : SKIP ch3_tax_rate = hash.key?('ch3TaxRate') ? hash['ch3TaxRate'] : SKIP ch4_exemption_code = hash.key?('ch4ExemptionCode') ? hash['ch4ExemptionCode'] : SKIP ch4_tax_rate = hash.key?('ch4TaxRate') ? hash['ch4TaxRate'] : SKIP withholding_allowance = hash.key?('withholdingAllowance') ? hash['withholdingAllowance'] : SKIP net_income = hash.key?('netIncome') ? hash['netIncome'] : SKIP federal_tax_withheld = hash.key?('federalTaxWithheld') ? hash['federalTaxWithheld'] : SKIP escrow_procedures_applied = hash.key?('escrowProceduresApplied') ? hash['escrowProceduresApplied'] : SKIP subsequent_year = hash.key?('subsequentYear') ? hash['subsequentYear'] : SKIP revised_reporting = hash.key?('revisedReporting') ? hash['revisedReporting'] : SKIP other_agents_tax_withheld = hash.key?('otherAgentsTaxWithheld') ? hash['otherAgentsTaxWithheld'] : SKIP recipient_repaid_amount = hash.key?('recipientRepaidAmount') ? hash['recipientRepaidAmount'] : SKIP total_tax_withholding_credit = hash.key?('totalTaxWithholdingCredit') ? hash['totalTaxWithholdingCredit'] : SKIP withholding_agent_tax_paid = hash.key?('withholdingAgentTaxPaid') ? hash['withholdingAgentTaxPaid'] : SKIP withholding_agent = Form1042SAgent1.from_hash(hash['withholdingAgent']) if hash['withholdingAgent'] withholding_agent_country = hash.key?('withholdingAgentCountry') ? hash['withholdingAgentCountry'] : SKIP form1042_recipient = Form1042SRecipient1.from_hash(hash['form1042Recipient']) if hash['form1042Recipient'] recipient_country = hash.key?('recipientCountry') ? hash['recipientCountry'] : SKIP account_number = hash.key?('accountNumber') ? hash['accountNumber'] : SKIP primary = Form1042SAgent2.from_hash(hash['primary']) if hash['primary'] prorata_basis_reporting = hash.key?('prorataBasisReporting') ? hash['prorataBasisReporting'] : SKIP intermediary = Form1042SAgent3.from_hash(hash['intermediary']) if hash['intermediary'] intermediary_country = hash.key?('intermediaryCountry') ? hash['intermediaryCountry'] : SKIP payer = Form1042SAgent4.from_hash(hash['payer']) if hash['payer'] state_and_local = StateAndLocalTaxWithholding1.from_hash(hash['stateAndLocal']) if hash['stateAndLocal'] # 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. Form1042S1.new(tax_year: tax_year, corrected: corrected, account_id: account_id, tax_form_id: tax_form_id, tax_form_date: tax_form_date, additional_information: additional_information, tax_form_type: tax_form_type, issuer: issuer, recipient: recipient, attributes: attributes, error: error, links: links, form_id: form_id, amended: amended, amendment_number: amendment_number, income_type_code: income_type_code, gross_income: gross_income, chapter_indicator: chapter_indicator, ch3_exemption_code: ch3_exemption_code, ch3_tax_rate: ch3_tax_rate, ch4_exemption_code: ch4_exemption_code, ch4_tax_rate: ch4_tax_rate, withholding_allowance: withholding_allowance, net_income: net_income, federal_tax_withheld: federal_tax_withheld, escrow_procedures_applied: escrow_procedures_applied, subsequent_year: subsequent_year, revised_reporting: revised_reporting, other_agents_tax_withheld: other_agents_tax_withheld, recipient_repaid_amount: recipient_repaid_amount, total_tax_withholding_credit: total_tax_withholding_credit, withholding_agent_tax_paid: withholding_agent_tax_paid, withholding_agent: withholding_agent, withholding_agent_country: withholding_agent_country, form1042_recipient: form1042_recipient, recipient_country: recipient_country, account_number: account_number, primary: primary, prorata_basis_reporting: prorata_basis_reporting, intermediary: intermediary, intermediary_country: intermediary_country, payer: payer, state_and_local: state_and_local, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 206 def self.names @_hash = {} if @_hash.nil? @_hash['tax_year'] = 'taxYear' @_hash['corrected'] = 'corrected' @_hash['account_id'] = 'accountId' @_hash['tax_form_id'] = 'taxFormId' @_hash['tax_form_date'] = 'taxFormDate' @_hash['additional_information'] = 'additionalInformation' @_hash['tax_form_type'] = 'taxFormType' @_hash['issuer'] = 'issuer' @_hash['recipient'] = 'recipient' @_hash['attributes'] = 'attributes' @_hash['error'] = 'error' @_hash['links'] = 'links' @_hash['form_id'] = 'formId' @_hash['amended'] = 'amended' @_hash['amendment_number'] = 'amendmentNumber' @_hash['income_type_code'] = 'incomeTypeCode' @_hash['gross_income'] = 'grossIncome' @_hash['chapter_indicator'] = 'chapterIndicator' @_hash['ch3_exemption_code'] = 'ch3ExemptionCode' @_hash['ch3_tax_rate'] = 'ch3TaxRate' @_hash['ch4_exemption_code'] = 'ch4ExemptionCode' @_hash['ch4_tax_rate'] = 'ch4TaxRate' @_hash['withholding_allowance'] = 'withholdingAllowance' @_hash['net_income'] = 'netIncome' @_hash['federal_tax_withheld'] = 'federalTaxWithheld' @_hash['escrow_procedures_applied'] = 'escrowProceduresApplied' @_hash['subsequent_year'] = 'subsequentYear' @_hash['revised_reporting'] = 'revisedReporting' @_hash['other_agents_tax_withheld'] = 'otherAgentsTaxWithheld' @_hash['recipient_repaid_amount'] = 'recipientRepaidAmount' @_hash['total_tax_withholding_credit'] = 'totalTaxWithholdingCredit' @_hash['withholding_agent_tax_paid'] = 'withholdingAgentTaxPaid' @_hash['withholding_agent'] = 'withholdingAgent' @_hash['withholding_agent_country'] = 'withholdingAgentCountry' @_hash['form1042_recipient'] = 'form1042Recipient' @_hash['recipient_country'] = 'recipientCountry' @_hash['account_number'] = 'accountNumber' @_hash['primary'] = 'primary' @_hash['prorata_basis_reporting'] = 'prorataBasisReporting' @_hash['intermediary'] = 'intermediary' @_hash['intermediary_country'] = 'intermediaryCountry' @_hash['payer'] = 'payer' @_hash['state_and_local'] = 'stateAndLocal' @_hash end |
.nullables ⇒ Object
An array for nullable fields
304 305 306 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 304 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 255 def self.optionals %w[ tax_year corrected account_id tax_form_id tax_form_date additional_information tax_form_type issuer recipient attributes error links form_id amended amendment_number income_type_code gross_income chapter_indicator ch3_exemption_code ch3_tax_rate ch4_exemption_code ch4_tax_rate withholding_allowance net_income federal_tax_withheld escrow_procedures_applied subsequent_year revised_reporting other_agents_tax_withheld recipient_repaid_amount total_tax_withholding_credit withholding_agent_tax_paid withholding_agent withholding_agent_country form1042_recipient recipient_country account_number primary prorata_basis_reporting intermediary intermediary_country payer state_and_local ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 564 def inspect class_name = self.class.name.split('::').last "<#{class_name} tax_year: #{@tax_year.inspect}, corrected: #{@corrected.inspect},"\ " account_id: #{@account_id.inspect}, tax_form_id: #{@tax_form_id.inspect}, tax_form_date:"\ " #{@tax_form_date.inspect}, additional_information: #{@additional_information.inspect},"\ " tax_form_type: #{@tax_form_type.inspect}, issuer: #{@issuer.inspect}, recipient:"\ " #{@recipient.inspect}, attributes: #{@attributes.inspect}, error: #{@error.inspect},"\ " links: #{@links.inspect}, form_id: #{@form_id.inspect}, amended: #{@amended.inspect},"\ " amendment_number: #{@amendment_number.inspect}, income_type_code:"\ " #{@income_type_code.inspect}, gross_income: #{@gross_income.inspect}, chapter_indicator:"\ " #{@chapter_indicator.inspect}, ch3_exemption_code: #{@ch3_exemption_code.inspect},"\ " ch3_tax_rate: #{@ch3_tax_rate.inspect}, ch4_exemption_code:"\ " #{@ch4_exemption_code.inspect}, ch4_tax_rate: #{@ch4_tax_rate.inspect},"\ " withholding_allowance: #{@withholding_allowance.inspect}, net_income:"\ " #{@net_income.inspect}, federal_tax_withheld: #{@federal_tax_withheld.inspect},"\ " escrow_procedures_applied: #{@escrow_procedures_applied.inspect}, subsequent_year:"\ " #{@subsequent_year.inspect}, revised_reporting: #{@revised_reporting.inspect},"\ " other_agents_tax_withheld: #{@other_agents_tax_withheld.inspect}, recipient_repaid_amount:"\ " #{@recipient_repaid_amount.inspect}, total_tax_withholding_credit:"\ " #{@total_tax_withholding_credit.inspect}, withholding_agent_tax_paid:"\ " #{@withholding_agent_tax_paid.inspect}, withholding_agent: #{@withholding_agent.inspect},"\ " withholding_agent_country: #{@withholding_agent_country.inspect}, form1042_recipient:"\ " #{@form1042_recipient.inspect}, recipient_country: #{@recipient_country.inspect},"\ " account_number: #{@account_number.inspect}, primary: #{@primary.inspect},"\ " prorata_basis_reporting: #{@prorata_basis_reporting.inspect}, intermediary:"\ " #{@intermediary.inspect}, intermediary_country: #{@intermediary_country.inspect}, payer:"\ " #{@payer.inspect}, state_and_local: #{@state_and_local.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/fdx_v660_api/models/form1042_s1.rb', line 537 def to_s class_name = self.class.name.split('::').last "<#{class_name} tax_year: #{@tax_year}, corrected: #{@corrected}, account_id:"\ " #{@account_id}, tax_form_id: #{@tax_form_id}, tax_form_date: #{@tax_form_date},"\ " additional_information: #{@additional_information}, tax_form_type: #{@tax_form_type},"\ " issuer: #{@issuer}, recipient: #{@recipient}, attributes: #{@attributes}, error:"\ " #{@error}, links: #{@links}, form_id: #{@form_id}, amended: #{@amended}, amendment_number:"\ " #{@amendment_number}, income_type_code: #{@income_type_code}, gross_income:"\ " #{@gross_income}, chapter_indicator: #{@chapter_indicator}, ch3_exemption_code:"\ " #{@ch3_exemption_code}, ch3_tax_rate: #{@ch3_tax_rate}, ch4_exemption_code:"\ " #{@ch4_exemption_code}, ch4_tax_rate: #{@ch4_tax_rate}, withholding_allowance:"\ " #{@withholding_allowance}, net_income: #{@net_income}, federal_tax_withheld:"\ " #{@federal_tax_withheld}, escrow_procedures_applied: #{@escrow_procedures_applied},"\ " subsequent_year: #{@subsequent_year}, revised_reporting: #{@revised_reporting},"\ " other_agents_tax_withheld: #{@other_agents_tax_withheld}, recipient_repaid_amount:"\ " #{@recipient_repaid_amount}, total_tax_withholding_credit:"\ " #{@total_tax_withholding_credit}, withholding_agent_tax_paid:"\ " #{@withholding_agent_tax_paid}, withholding_agent: #{@withholding_agent},"\ " withholding_agent_country: #{@withholding_agent_country}, form1042_recipient:"\ " #{@form1042_recipient}, recipient_country: #{@recipient_country}, account_number:"\ " #{@account_number}, primary: #{@primary}, prorata_basis_reporting:"\ " #{@prorata_basis_reporting}, intermediary: #{@intermediary}, intermediary_country:"\ " #{@intermediary_country}, payer: #{@payer}, state_and_local: #{@state_and_local},"\ " additional_properties: #{@additional_properties}>" end |