avalara_sdk 25.7.0 → 25.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (309) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +76 -39
  4. data/docs/A1099/V2/BulkUpsert1099FormsRequest.md +3 -1
  5. data/docs/A1099/V2/CompaniesW9Api.md +22 -22
  6. data/docs/A1099/V2/CoveredIndividualReferenceResponse.md +56 -0
  7. data/docs/A1099/V2/CoveredIndividualRequest.md +19 -19
  8. data/docs/A1099/V2/Create1099Form201Response.md +59 -0
  9. data/docs/A1099/V2/CreateW9Form201Response.md +55 -0
  10. data/docs/A1099/V2/CreateW9FormRequest.md +55 -0
  11. data/docs/A1099/V2/Form1042SList.md +20 -0
  12. data/docs/A1099/V2/Form1042SListItem.md +108 -0
  13. data/docs/A1099/V2/Form1042SListItemResponse.md +130 -0
  14. data/docs/A1099/V2/Form1042SRequest.md +110 -0
  15. data/docs/A1099/V2/Form1042SResponse.md +88 -0
  16. data/docs/A1099/V2/Form1095BListItem.md +31 -31
  17. data/docs/A1099/V2/Form1095BListItemResponse.md +86 -0
  18. data/docs/A1099/V2/Form1095BRequest.md +33 -33
  19. data/docs/A1099/V2/Form1099BaseResponse.md +82 -0
  20. data/docs/A1099/V2/Form1099DivListItem.md +45 -45
  21. data/docs/A1099/V2/Form1099DivRequest.md +44 -44
  22. data/docs/A1099/V2/Form1099DivResponse.md +3 -3
  23. data/docs/A1099/V2/Form1099KListItem.md +46 -46
  24. data/docs/A1099/V2/Form1099KListItemResponse.md +122 -0
  25. data/docs/A1099/V2/Form1099KRequest.md +45 -45
  26. data/docs/A1099/V2/Form1099ListResponse.md +18 -0
  27. data/docs/A1099/V2/Form1099ListResponseValueInner.md +59 -0
  28. data/docs/A1099/V2/Form1099MiscListItem.md +43 -43
  29. data/docs/A1099/V2/Form1099MiscListItemResponse.md +108 -0
  30. data/docs/A1099/V2/Form1099MiscRequest.md +42 -42
  31. data/docs/A1099/V2/Form1099MiscResponse.md +5 -5
  32. data/docs/A1099/V2/Form1099NecListItem.md +31 -31
  33. data/docs/A1099/V2/Form1099NecListItemResponse.md +88 -0
  34. data/docs/A1099/V2/Form1099NecRequest.md +30 -30
  35. data/docs/A1099/V2/Form1099NecResponse.md +5 -5
  36. data/docs/A1099/V2/Form1099RListItem.md +47 -47
  37. data/docs/A1099/V2/Form1099RListItemResponse.md +122 -0
  38. data/docs/A1099/V2/Form1099RRequest.md +45 -45
  39. data/docs/A1099/V2/Form1099StatusDetailResponse.md +20 -0
  40. data/docs/A1099/V2/FormRequestBase.md +23 -23
  41. data/docs/A1099/V2/FormRequestListItemBase.md +66 -0
  42. data/docs/A1099/V2/FormResponseBase.md +3 -3
  43. data/docs/A1099/V2/FormSingleRequestBase.md +25 -25
  44. data/docs/A1099/V2/Forms1099Api.md +75 -63
  45. data/docs/A1099/V2/FormsW9Api.md +61 -56
  46. data/docs/A1099/V2/Get1099Form200Response.md +15 -11
  47. data/docs/A1099/V2/IntermediaryOrFlowThrough.md +38 -0
  48. data/docs/A1099/V2/IntermediaryOrFlowThroughRequest.md +38 -0
  49. data/docs/A1099/V2/IntermediaryOrFlowThroughResponse.md +38 -0
  50. data/docs/A1099/V2/Issuers1099Api.md +23 -23
  51. data/docs/A1099/V2/JobResult.md +15 -15
  52. data/docs/A1099/V2/Jobs1099Api.md +2 -2
  53. data/docs/A1099/V2/PrimaryWithholdingAgent.md +20 -0
  54. data/docs/A1099/V2/PrimaryWithholdingAgentRequest.md +20 -0
  55. data/docs/A1099/V2/PrimaryWithholdingAgentResponse.md +20 -0
  56. data/docs/A1099/V2/StateAndLocalWithholdingResponse.md +8 -8
  57. data/docs/A1099/V2/StateEfileStatusDetailResponse.md +22 -0
  58. data/docs/A1099/V2/SubstantialUsOwnerRequest.md +22 -0
  59. data/docs/A1099/V2/Update1099Form200Response.md +3 -1
  60. data/docs/A1099/V2/ValidationErrorResponse.md +20 -0
  61. data/docs/A1099/V2/W4FormDataModel.md +5 -5
  62. data/docs/A1099/V2/W4FormRequest.md +66 -0
  63. data/docs/A1099/V2/W8BenEFormRequest.md +218 -0
  64. data/docs/A1099/V2/W8BenEFormResponse.md +3 -3
  65. data/docs/A1099/V2/W8BenFormDataModel.md +5 -5
  66. data/docs/A1099/V2/W8BenFormRequest.md +76 -0
  67. data/docs/A1099/V2/W8BeneFormDataModel.md +5 -5
  68. data/docs/A1099/V2/W8ImyFormDataModel.md +5 -5
  69. data/docs/A1099/V2/W8ImyFormRequest.md +250 -0
  70. data/docs/A1099/V2/W8ImyFormResponse.md +2 -2
  71. data/docs/A1099/V2/W9FormBaseRequest.md +28 -0
  72. data/docs/A1099/V2/W9FormDataModel.md +5 -5
  73. data/docs/A1099/V2/W9FormRequest.md +64 -0
  74. data/docs/EInvoicing/V1/Address.md +28 -0
  75. data/docs/EInvoicing/V1/BatchErrorDetail.md +20 -0
  76. data/docs/EInvoicing/V1/BatchSearchListResponse.md +2 -2
  77. data/docs/EInvoicing/V1/Consents.md +18 -0
  78. data/docs/EInvoicing/V1/CreateTradingPartner201Response.md +22 -0
  79. data/docs/EInvoicing/V1/CreateTradingPartnersBatch200Response.md +22 -0
  80. data/docs/EInvoicing/V1/CreateTradingPartnersBatch200ResponseValueInner.md +22 -0
  81. data/docs/EInvoicing/V1/CreateTradingPartnersBatchRequest.md +18 -0
  82. data/docs/EInvoicing/V1/DataInputFieldsApi.md +5 -5
  83. data/docs/EInvoicing/V1/DocumentsApi.md +9 -9
  84. data/docs/EInvoicing/V1/Extension.md +20 -0
  85. data/docs/EInvoicing/V1/Identifier.md +22 -0
  86. data/docs/EInvoicing/V1/InteropApi.md +1 -1
  87. data/docs/EInvoicing/V1/MandatesApi.md +6 -6
  88. data/docs/EInvoicing/V1/SearchParticipants200Response.md +22 -0
  89. data/docs/EInvoicing/V1/SubscriptionsApi.md +12 -12
  90. data/docs/EInvoicing/V1/SupportedDocumentTypes.md +26 -0
  91. data/docs/EInvoicing/V1/TaxIdentifierRequest.md +24 -0
  92. data/docs/EInvoicing/V1/TaxIdentifierResponse.md +20 -0
  93. data/docs/EInvoicing/V1/TaxIdentifierResponseValue.md +22 -0
  94. data/docs/EInvoicing/V1/TaxIdentifierSchemaByCountry200Response.md +20 -0
  95. data/docs/EInvoicing/V1/TaxIdentifiersApi.md +177 -0
  96. data/docs/EInvoicing/V1/TradingPartner.md +34 -0
  97. data/docs/EInvoicing/V1/TradingPartnersApi.md +412 -75
  98. data/docs/EInvoicing/V1/UpdateTradingPartner200Response.md +22 -0
  99. data/docs/EInvoicing/V1/ValidationError.md +20 -0
  100. data/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb +14 -14
  101. data/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb +51 -39
  102. data/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb +56 -50
  103. data/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb +20 -20
  104. data/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb +2 -2
  105. data/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb +7 -7
  106. data/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb +11 -11
  107. data/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb +2 -2
  108. data/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb +8 -8
  109. data/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb +21 -21
  110. data/lib/avalara_sdk/api/EInvoicing/V1/tax_identifiers_api.rb +531 -0
  111. data/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb +660 -80
  112. data/lib/avalara_sdk/models/A1099/V2/attribute.rb +1 -1
  113. data/lib/avalara_sdk/models/A1099/V2/authorized_api_request_model.rb +1 -1
  114. data/lib/avalara_sdk/models/A1099/V2/authorized_api_request_v2_data_model.rb +1 -1
  115. data/lib/avalara_sdk/models/A1099/V2/base_company_model.rb +1 -1
  116. data/lib/avalara_sdk/models/A1099/V2/base_form_list_request.rb +1 -1
  117. data/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb +2 -1
  118. data/lib/avalara_sdk/models/A1099/V2/company_create_update_request_model.rb +1 -1
  119. data/lib/avalara_sdk/models/A1099/V2/company_model.rb +1 -1
  120. data/lib/avalara_sdk/models/A1099/V2/company_response.rb +1 -1
  121. data/lib/avalara_sdk/models/A1099/V2/company_response_model.rb +1 -1
  122. data/lib/avalara_sdk/models/A1099/V2/covered_individual_reference_response.rb +407 -0
  123. data/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb +20 -1
  124. data/lib/avalara_sdk/models/A1099/V2/create1099_form201_response.rb +106 -0
  125. data/lib/avalara_sdk/models/A1099/V2/create_w9_form201_response.rb +104 -0
  126. data/lib/avalara_sdk/models/A1099/V2/create_w9_form_request.rb +104 -0
  127. data/lib/avalara_sdk/models/A1099/V2/data.rb +1 -1
  128. data/lib/avalara_sdk/models/A1099/V2/error_model.rb +1 -1
  129. data/lib/avalara_sdk/models/A1099/V2/error_response.rb +1 -1
  130. data/lib/avalara_sdk/models/A1099/V2/error_response_errors_inner.rb +1 -1
  131. data/lib/avalara_sdk/models/A1099/V2/form1042_s_list.rb +238 -0
  132. data/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item.rb +891 -0
  133. data/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item_response.rb +925 -0
  134. data/lib/avalara_sdk/models/A1099/V2/form1042_s_request.rb +855 -0
  135. data/lib/avalara_sdk/models/A1099/V2/form1042_s_response.rb +600 -0
  136. data/lib/avalara_sdk/models/A1099/V2/form1095_b_list.rb +1 -1
  137. data/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb +147 -14
  138. data/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item_response.rb +700 -0
  139. data/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb +149 -16
  140. data/lib/avalara_sdk/models/A1099/V2/form1099_base_response.rb +661 -0
  141. data/lib/avalara_sdk/models/A1099/V2/form1099_div_list.rb +1 -1
  142. data/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb +168 -13
  143. data/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb +159 -14
  144. data/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb +5 -5
  145. data/lib/avalara_sdk/models/A1099/V2/form1099_k_list.rb +1 -1
  146. data/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb +169 -13
  147. data/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item_response.rb +930 -0
  148. data/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb +160 -14
  149. data/lib/avalara_sdk/models/A1099/V2/form1099_list_response.rb +220 -0
  150. data/lib/avalara_sdk/models/A1099/V2/form1099_list_response_value_inner.rb +106 -0
  151. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_list.rb +1 -1
  152. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb +171 -19
  153. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item_response.rb +810 -0
  154. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb +162 -20
  155. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb +12 -12
  156. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_list.rb +1 -1
  157. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb +168 -20
  158. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item_response.rb +700 -0
  159. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb +157 -20
  160. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb +12 -12
  161. data/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb +1 -1
  162. data/lib/avalara_sdk/models/A1099/V2/form1099_r_list.rb +1 -1
  163. data/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb +171 -15
  164. data/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item_response.rb +888 -0
  165. data/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb +160 -14
  166. data/lib/avalara_sdk/models/A1099/V2/form1099_status_detail_response.rb +223 -0
  167. data/lib/avalara_sdk/models/A1099/V2/form_request_base.rb +138 -12
  168. data/lib/avalara_sdk/models/A1099/V2/form_request_list_item_base.rb +611 -0
  169. data/lib/avalara_sdk/models/A1099/V2/form_response_base.rb +5 -5
  170. data/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb +140 -14
  171. data/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb +8 -6
  172. data/lib/avalara_sdk/models/A1099/V2/http_validation_problem_details.rb +1 -1
  173. data/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb +1 -1
  174. data/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb +1 -1
  175. data/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through.rb +311 -0
  176. data/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_request.rb +311 -0
  177. data/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through_response.rb +311 -0
  178. data/lib/avalara_sdk/models/A1099/V2/issuer_command.rb +1 -1
  179. data/lib/avalara_sdk/models/A1099/V2/issuer_response.rb +1 -1
  180. data/lib/avalara_sdk/models/A1099/V2/iw9_form_data_models_one_of.rb +1 -1
  181. data/lib/avalara_sdk/models/A1099/V2/job_result.rb +16 -1
  182. data/lib/avalara_sdk/models/A1099/V2/link.rb +1 -1
  183. data/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model.rb +1 -1
  184. data/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_company_response.rb +1 -1
  185. data/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_issuer_response.rb +1 -1
  186. data/lib/avalara_sdk/models/A1099/V2/paginated_w9_forms_model.rb +1 -1
  187. data/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent.rb +221 -0
  188. data/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_request.rb +221 -0
  189. data/lib/avalara_sdk/models/A1099/V2/primary_withholding_agent_response.rb +221 -0
  190. data/lib/avalara_sdk/models/A1099/V2/problem_details.rb +1 -1
  191. data/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb +5 -1
  192. data/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb +9 -1
  193. data/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail_response.rb +231 -0
  194. data/lib/avalara_sdk/models/A1099/V2/status_detail.rb +1 -1
  195. data/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_request.rb +233 -0
  196. data/lib/avalara_sdk/models/A1099/V2/substantial_us_owner_response.rb +1 -1
  197. data/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb +2 -1
  198. data/lib/avalara_sdk/models/A1099/V2/validation_error_response.rb +231 -0
  199. data/lib/avalara_sdk/models/A1099/V2/w4_form_data_model.rb +6 -6
  200. data/lib/avalara_sdk/models/A1099/V2/w4_form_request.rb +509 -0
  201. data/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb +1 -1
  202. data/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_request.rb +1343 -0
  203. data/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb +4 -4
  204. data/lib/avalara_sdk/models/A1099/V2/w8_ben_e_substantial_us_owner_data_model.rb +1 -1
  205. data/lib/avalara_sdk/models/A1099/V2/w8_ben_form_data_model.rb +6 -6
  206. data/lib/avalara_sdk/models/A1099/V2/w8_ben_form_request.rb +561 -0
  207. data/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb +1 -1
  208. data/lib/avalara_sdk/models/A1099/V2/w8_bene_form_data_model.rb +6 -6
  209. data/lib/avalara_sdk/models/A1099/V2/w8_imy_form_data_model.rb +6 -6
  210. data/lib/avalara_sdk/models/A1099/V2/w8_imy_form_request.rb +1518 -0
  211. data/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb +3 -3
  212. data/lib/avalara_sdk/models/A1099/V2/w9_form_base_request.rb +299 -0
  213. data/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb +1 -1
  214. data/lib/avalara_sdk/models/A1099/V2/w9_form_data_model.rb +6 -6
  215. data/lib/avalara_sdk/models/A1099/V2/w9_form_request.rb +495 -0
  216. data/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb +4 -3
  217. data/lib/avalara_sdk/models/EInvoicing/V1/address.rb +382 -0
  218. data/lib/avalara_sdk/models/EInvoicing/V1/batch_error_detail.rb +223 -0
  219. data/lib/avalara_sdk/models/EInvoicing/V1/batch_search.rb +1 -1
  220. data/lib/avalara_sdk/models/EInvoicing/V1/batch_search_list_response.rb +3 -2
  221. data/lib/avalara_sdk/models/EInvoicing/V1/consents.rb +213 -0
  222. data/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partner201_response.rb +231 -0
  223. data/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response.rb +232 -0
  224. data/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch200_response_value_inner.rb +231 -0
  225. data/lib/avalara_sdk/models/EInvoicing/V1/create_trading_partners_batch_request.rb +212 -0
  226. data/lib/avalara_sdk/models/EInvoicing/V1/data_input_fields_response.rb +1 -2
  227. data/lib/avalara_sdk/models/EInvoicing/V1/document_fetch.rb +1 -2
  228. data/lib/avalara_sdk/models/EInvoicing/V1/error_response.rb +1 -1
  229. data/lib/avalara_sdk/models/EInvoicing/V1/extension.rb +256 -0
  230. data/lib/avalara_sdk/models/EInvoicing/V1/hmac_signature_value.rb +1 -2
  231. data/lib/avalara_sdk/models/EInvoicing/V1/identifier.rb +302 -0
  232. data/lib/avalara_sdk/models/EInvoicing/V1/mandate.rb +1 -2
  233. data/lib/avalara_sdk/models/EInvoicing/V1/pagination.rb +1 -2
  234. data/lib/avalara_sdk/models/EInvoicing/V1/required_when_field.rb +1 -2
  235. data/lib/avalara_sdk/models/EInvoicing/V1/search_participants200_response.rb +232 -0
  236. data/lib/avalara_sdk/models/EInvoicing/V1/signature.rb +1 -2
  237. data/lib/avalara_sdk/models/EInvoicing/V1/signature_value.rb +1 -2
  238. data/lib/avalara_sdk/models/EInvoicing/V1/subscription_common.rb +1 -2
  239. data/lib/avalara_sdk/models/EInvoicing/V1/success_response.rb +1 -2
  240. data/lib/avalara_sdk/models/EInvoicing/V1/supported_document_types.rb +305 -0
  241. data/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_request.rb +329 -0
  242. data/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response.rb +228 -0
  243. data/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_response_value.rb +231 -0
  244. data/lib/avalara_sdk/models/EInvoicing/V1/tax_identifier_schema_by_country200_response.rb +235 -0
  245. data/lib/avalara_sdk/models/EInvoicing/V1/trading_partner.rb +411 -0
  246. data/lib/avalara_sdk/models/EInvoicing/V1/update_trading_partner200_response.rb +231 -0
  247. data/lib/avalara_sdk/models/EInvoicing/V1/validation_error.rb +222 -0
  248. data/lib/avalara_sdk/models/EInvoicing/V1/webhooks_error_response.rb +1 -2
  249. data/lib/avalara_sdk/version.rb +1 -1
  250. data/lib/avalara_sdk.rb +53 -0
  251. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-11.1.3/byebug/byebug.so +0 -0
  252. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-11.1.3/gem_make.out +6 -6
  253. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/date_core.so +0 -0
  254. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/gem_make.out +6 -6
  255. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/mkmf.log +4 -4
  256. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/attach.so +0 -0
  257. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/debase_internals.so +0 -0
  258. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/gem_make.out +7 -7
  259. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/mkmf.log +6 -6
  260. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debug-1.10.0/debug/debug.so +0 -0
  261. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debug-1.10.0/gem_make.out +6 -6
  262. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/erb-5.0.1/erb/escape.so +0 -0
  263. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/erb-5.0.1/gem_make.out +6 -6
  264. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/gem_make.out +6 -6
  265. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/io/console.so +0 -0
  266. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/mkmf.log +21 -21
  267. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/gem_make.out +6 -6
  268. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/json/ext/generator.so +0 -0
  269. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/json/ext/parser.so +0 -0
  270. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/mkmf.log +7 -7
  271. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/prism-1.4.0/gem_make.out +6 -6
  272. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/prism-1.4.0/mkmf.log +6 -6
  273. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/prism-1.4.0/prism/prism.so +0 -0
  274. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/gem_make.out +6 -6
  275. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/mkmf.log +10 -10
  276. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/psych.so +0 -0
  277. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +6 -6
  278. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/racc/cparse.so +0 -0
  279. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/ruby-debug-ide-0.7.3/gem_make.out +2 -2
  280. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/gem_make.out +6 -6
  281. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/mkmf.log +2 -2
  282. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/stringio.so +0 -0
  283. data/vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/ext/byebug/Makefile +3 -3
  284. data/vendor/bundle/ruby/3.3.0/gems/byebug-11.1.3/lib/byebug/byebug.so +0 -0
  285. data/vendor/bundle/ruby/3.3.0/gems/date-3.4.1/ext/date/Makefile +3 -3
  286. data/vendor/bundle/ruby/3.3.0/gems/date-3.4.1/lib/date_core.so +0 -0
  287. data/vendor/bundle/ruby/3.3.0/gems/debase-0.2.9/ext/Makefile +3 -3
  288. data/vendor/bundle/ruby/3.3.0/gems/debase-0.2.9/ext/attach/Makefile +3 -3
  289. data/vendor/bundle/ruby/3.3.0/gems/debase-0.2.9/lib/attach.so +0 -0
  290. data/vendor/bundle/ruby/3.3.0/gems/debase-0.2.9/lib/debase_internals.so +0 -0
  291. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/ext/debug/Makefile +3 -3
  292. data/vendor/bundle/ruby/3.3.0/gems/debug-1.10.0/lib/debug/debug.so +0 -0
  293. data/vendor/bundle/ruby/3.3.0/gems/erb-5.0.1/ext/erb/escape/Makefile +3 -3
  294. data/vendor/bundle/ruby/3.3.0/gems/erb-5.0.1/lib/erb/escape.so +0 -0
  295. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/ext/io/console/Makefile +3 -3
  296. data/vendor/bundle/ruby/3.3.0/gems/io-console-0.8.0/lib/io/console.so +0 -0
  297. data/vendor/bundle/ruby/3.3.0/gems/json-2.12.2/ext/json/ext/generator/Makefile +3 -3
  298. data/vendor/bundle/ruby/3.3.0/gems/json-2.12.2/ext/json/ext/parser/Makefile +3 -3
  299. data/vendor/bundle/ruby/3.3.0/gems/json-2.12.2/lib/json/ext/generator.so +0 -0
  300. data/vendor/bundle/ruby/3.3.0/gems/json-2.12.2/lib/json/ext/parser.so +0 -0
  301. data/vendor/bundle/ruby/3.3.0/gems/prism-1.4.0/ext/prism/Makefile +3 -3
  302. data/vendor/bundle/ruby/3.3.0/gems/prism-1.4.0/lib/prism/prism.so +0 -0
  303. data/vendor/bundle/ruby/3.3.0/gems/psych-5.2.6/ext/psych/Makefile +3 -3
  304. data/vendor/bundle/ruby/3.3.0/gems/psych-5.2.6/lib/psych.so +0 -0
  305. data/vendor/bundle/ruby/3.3.0/gems/racc-1.8.1/ext/racc/cparse/Makefile +3 -3
  306. data/vendor/bundle/ruby/3.3.0/gems/racc-1.8.1/lib/racc/cparse.so +0 -0
  307. data/vendor/bundle/ruby/3.3.0/gems/stringio-3.1.7/ext/stringio/Makefile +3 -3
  308. data/vendor/bundle/ruby/3.3.0/gems/stringio-3.1.7/lib/stringio.so +0 -0
  309. metadata +109 -3
@@ -0,0 +1,891 @@
1
+ =begin
2
+ #Avalara 1099 & W-9 API Definition
3
+
4
+ ### 🔐 Authentication Generate a **license key** from: *[Avalara Portal](https://www.avalara.com/us/en/signin.html) → Settings → License and API Keys*. [More on authentication methods](https://developer.avalara.com/avatax-dm-combined-erp/common-setup/authentication/authentication-methods/) [Test your credentials](https://developer.avalara.com/avatax/test-credentials/) ## 📘 API & SDK Documentation [Avalara SDK (.NET) on GitHub](https://github.com/avadev/Avalara-SDK-DotNet#avalarasdk--the-unified-c-library-for-next-gen-avalara-services) [Code Examples – 1099 API](https://github.com/avadev/Avalara-SDK-DotNet/blob/main/docs/A1099/V2/Class1099IssuersApi.md#call1099issuersget)
5
+
6
+
7
+ =end
8
+
9
+ require 'date'
10
+ require 'time'
11
+
12
+ module AvalaraSdk::A1099::V2
13
+ class Form1042SListItem
14
+ # Unique form identifier
15
+ attr_accessor :unique_form_id
16
+
17
+ # No TIN indicator
18
+ attr_accessor :no_tin
19
+
20
+ # Recipient's date of birth
21
+ attr_accessor :recipient_date_of_birth
22
+
23
+ # Recipient's GIIN (Global Intermediary Identification Number)
24
+ attr_accessor :recipient_giin
25
+
26
+ # Recipient's foreign TIN
27
+ attr_accessor :recipient_foreign_tin
28
+
29
+ # Limitation on benefits code
30
+ attr_accessor :lob_code
31
+
32
+ # Income code
33
+ attr_accessor :income_code
34
+
35
+ # Gross income
36
+ attr_accessor :gross_income
37
+
38
+ # Withholding indicator
39
+ attr_accessor :withholding_indicator
40
+
41
+ # Country code
42
+ attr_accessor :tax_country_code
43
+
44
+ # Exemption code (Chapter 3)
45
+ attr_accessor :exemption_code_chap3
46
+
47
+ # Exemption code (Chapter 4)
48
+ attr_accessor :exemption_code_chap4
49
+
50
+ # Tax rate (Chapter 3)
51
+ attr_accessor :tax_rate_chap3
52
+
53
+ # Withholding allowance
54
+ attr_accessor :withholding_allowance
55
+
56
+ # Federal tax withheld
57
+ attr_accessor :federal_tax_withheld
58
+
59
+ # Tax not deposited indicator
60
+ attr_accessor :tax_not_deposited_indicator
61
+
62
+ # Academic indicator
63
+ attr_accessor :academic_indicator
64
+
65
+ # Tax withheld by other agents
66
+ attr_accessor :tax_withheld_other_agents
67
+
68
+ # Amount repaid to recipient
69
+ attr_accessor :amount_repaid
70
+
71
+ # Tax paid by withholding agent
72
+ attr_accessor :tax_paid_agent
73
+
74
+ # Chapter 3 status code
75
+ attr_accessor :chap3_status_code
76
+
77
+ # Chapter 4 status code
78
+ attr_accessor :chap4_status_code
79
+
80
+ # Primary withholding agent information
81
+ attr_accessor :primary_withholding_agent
82
+
83
+ # Intermediary or flow-through entity information
84
+ attr_accessor :intermediary_or_flow_through
85
+
86
+ # Issuer ID
87
+ attr_accessor :issuer_id
88
+
89
+ # Reference ID
90
+ attr_accessor :reference_id
91
+
92
+ # Recipient Tax ID Number
93
+ attr_accessor :recipient_tin
94
+
95
+ # Recipient name
96
+ attr_accessor :recipient_name
97
+
98
+ # Type of TIN (Tax ID Number). Will be one of: * SSN * EIN * ITIN * ATIN
99
+ attr_accessor :tin_type
100
+
101
+ # Recipient second name
102
+ attr_accessor :recipient_second_name
103
+
104
+ # Address
105
+ attr_accessor :address
106
+
107
+ # Address line 2
108
+ attr_accessor :address2
109
+
110
+ # City
111
+ attr_accessor :city
112
+
113
+ # US state. Required if CountryCode is \"US\".
114
+ attr_accessor :state
115
+
116
+ # Zip/postal code
117
+ attr_accessor :zip
118
+
119
+ # Recipient email address
120
+ attr_accessor :recipient_email
121
+
122
+ # Account number
123
+ attr_accessor :account_number
124
+
125
+ # Office code
126
+ attr_accessor :office_code
127
+
128
+ # Foreign province
129
+ attr_accessor :recipient_non_us_province
130
+
131
+ # Country code, as defined at https://www.irs.gov/e-file-providers/country-codes
132
+ attr_accessor :country_code
133
+
134
+ # Boolean indicating that federal e-filing should be scheduled for this form
135
+ attr_accessor :federal_e_file
136
+
137
+ # Boolean indicating that postal mailing to the recipient should be scheduled for this form
138
+ attr_accessor :postal_mail
139
+
140
+ # Boolean indicating that state e-filing should be scheduled for this form
141
+ attr_accessor :state_e_file
142
+
143
+ # Boolean indicating that TIN Matching should be scheduled for this form
144
+ attr_accessor :tin_match
145
+
146
+ # Boolean indicating that address verification should be scheduled for this form
147
+ attr_accessor :address_verification
148
+
149
+ # State and local withholding information
150
+ attr_accessor :state_and_local_withholding
151
+
152
+ class EnumAttributeValidator
153
+ attr_reader :datatype
154
+ attr_reader :allowable_values
155
+
156
+ def initialize(datatype, allowable_values)
157
+ @allowable_values = allowable_values.map do |value|
158
+ case datatype.to_s
159
+ when /Integer/i
160
+ value.to_i
161
+ when /Float/i
162
+ value.to_f
163
+ else
164
+ value
165
+ end
166
+ end
167
+ end
168
+
169
+ def valid?(value)
170
+ !value || allowable_values.include?(value)
171
+ end
172
+ end
173
+
174
+ # Attribute mapping from ruby-style variable name to JSON key.
175
+ def self.attribute_map
176
+ {
177
+ :'unique_form_id' => :'uniqueFormId',
178
+ :'no_tin' => :'noTin',
179
+ :'recipient_date_of_birth' => :'recipientDateOfBirth',
180
+ :'recipient_giin' => :'recipientGiin',
181
+ :'recipient_foreign_tin' => :'recipientForeignTin',
182
+ :'lob_code' => :'lobCode',
183
+ :'income_code' => :'incomeCode',
184
+ :'gross_income' => :'grossIncome',
185
+ :'withholding_indicator' => :'withholdingIndicator',
186
+ :'tax_country_code' => :'taxCountryCode',
187
+ :'exemption_code_chap3' => :'exemptionCodeChap3',
188
+ :'exemption_code_chap4' => :'exemptionCodeChap4',
189
+ :'tax_rate_chap3' => :'taxRateChap3',
190
+ :'withholding_allowance' => :'withholdingAllowance',
191
+ :'federal_tax_withheld' => :'federalTaxWithheld',
192
+ :'tax_not_deposited_indicator' => :'taxNotDepositedIndicator',
193
+ :'academic_indicator' => :'academicIndicator',
194
+ :'tax_withheld_other_agents' => :'taxWithheldOtherAgents',
195
+ :'amount_repaid' => :'amountRepaid',
196
+ :'tax_paid_agent' => :'taxPaidAgent',
197
+ :'chap3_status_code' => :'chap3StatusCode',
198
+ :'chap4_status_code' => :'chap4StatusCode',
199
+ :'primary_withholding_agent' => :'primaryWithholdingAgent',
200
+ :'intermediary_or_flow_through' => :'intermediaryOrFlowThrough',
201
+ :'issuer_id' => :'issuerId',
202
+ :'reference_id' => :'referenceId',
203
+ :'recipient_tin' => :'recipientTin',
204
+ :'recipient_name' => :'recipientName',
205
+ :'tin_type' => :'tinType',
206
+ :'recipient_second_name' => :'recipientSecondName',
207
+ :'address' => :'address',
208
+ :'address2' => :'address2',
209
+ :'city' => :'city',
210
+ :'state' => :'state',
211
+ :'zip' => :'zip',
212
+ :'recipient_email' => :'recipientEmail',
213
+ :'account_number' => :'accountNumber',
214
+ :'office_code' => :'officeCode',
215
+ :'recipient_non_us_province' => :'recipientNonUsProvince',
216
+ :'country_code' => :'countryCode',
217
+ :'federal_e_file' => :'federalEFile',
218
+ :'postal_mail' => :'postalMail',
219
+ :'state_e_file' => :'stateEFile',
220
+ :'tin_match' => :'tinMatch',
221
+ :'address_verification' => :'addressVerification',
222
+ :'state_and_local_withholding' => :'stateAndLocalWithholding'
223
+ }
224
+ end
225
+
226
+ # Returns all the JSON keys this model knows about
227
+ def self.acceptable_attributes
228
+ attribute_map.values
229
+ end
230
+
231
+ # Attribute type mapping.
232
+ def self.openapi_types
233
+ {
234
+ :'unique_form_id' => :'String',
235
+ :'no_tin' => :'Boolean',
236
+ :'recipient_date_of_birth' => :'Time',
237
+ :'recipient_giin' => :'String',
238
+ :'recipient_foreign_tin' => :'String',
239
+ :'lob_code' => :'String',
240
+ :'income_code' => :'String',
241
+ :'gross_income' => :'Float',
242
+ :'withholding_indicator' => :'String',
243
+ :'tax_country_code' => :'String',
244
+ :'exemption_code_chap3' => :'String',
245
+ :'exemption_code_chap4' => :'String',
246
+ :'tax_rate_chap3' => :'String',
247
+ :'withholding_allowance' => :'Float',
248
+ :'federal_tax_withheld' => :'Float',
249
+ :'tax_not_deposited_indicator' => :'Boolean',
250
+ :'academic_indicator' => :'Boolean',
251
+ :'tax_withheld_other_agents' => :'Float',
252
+ :'amount_repaid' => :'Float',
253
+ :'tax_paid_agent' => :'Float',
254
+ :'chap3_status_code' => :'String',
255
+ :'chap4_status_code' => :'String',
256
+ :'primary_withholding_agent' => :'PrimaryWithholdingAgent',
257
+ :'intermediary_or_flow_through' => :'IntermediaryOrFlowThrough',
258
+ :'issuer_id' => :'String',
259
+ :'reference_id' => :'String',
260
+ :'recipient_tin' => :'String',
261
+ :'recipient_name' => :'String',
262
+ :'tin_type' => :'String',
263
+ :'recipient_second_name' => :'String',
264
+ :'address' => :'String',
265
+ :'address2' => :'String',
266
+ :'city' => :'String',
267
+ :'state' => :'String',
268
+ :'zip' => :'String',
269
+ :'recipient_email' => :'String',
270
+ :'account_number' => :'String',
271
+ :'office_code' => :'String',
272
+ :'recipient_non_us_province' => :'String',
273
+ :'country_code' => :'String',
274
+ :'federal_e_file' => :'Boolean',
275
+ :'postal_mail' => :'Boolean',
276
+ :'state_e_file' => :'Boolean',
277
+ :'tin_match' => :'Boolean',
278
+ :'address_verification' => :'Boolean',
279
+ :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest'
280
+ }
281
+ end
282
+
283
+ # List of attributes with nullable: true
284
+ def self.openapi_nullable
285
+ Set.new([
286
+ :'no_tin',
287
+ :'recipient_date_of_birth',
288
+ :'recipient_giin',
289
+ :'recipient_foreign_tin',
290
+ :'lob_code',
291
+ :'exemption_code_chap3',
292
+ :'exemption_code_chap4',
293
+ :'tax_rate_chap3',
294
+ :'withholding_allowance',
295
+ :'federal_tax_withheld',
296
+ :'tax_not_deposited_indicator',
297
+ :'academic_indicator',
298
+ :'tax_withheld_other_agents',
299
+ :'amount_repaid',
300
+ :'tax_paid_agent',
301
+ :'chap3_status_code',
302
+ :'chap4_status_code',
303
+ :'issuer_id',
304
+ :'reference_id',
305
+ :'recipient_second_name',
306
+ :'address2',
307
+ :'recipient_email',
308
+ :'account_number',
309
+ :'office_code',
310
+ :'recipient_non_us_province',
311
+ ])
312
+ end
313
+
314
+ # List of class defined in allOf (OpenAPI v3)
315
+ def self.openapi_all_of
316
+ [
317
+ :'FormRequestBase'
318
+ ]
319
+ end
320
+
321
+ # Initializes the object
322
+ # @param [Hash] attributes Model attributes in the form of hash
323
+ def initialize(attributes = {})
324
+ if (!attributes.is_a?(Hash))
325
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1042SListItem` initialize method"
326
+ end
327
+
328
+ # check to see if the attribute exists and convert string to symbol for hash key
329
+ attributes = attributes.each_with_object({}) { |(k, v), h|
330
+ if (!self.class.attribute_map.key?(k.to_sym))
331
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1042SListItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
332
+ end
333
+ h[k.to_sym] = v
334
+ }
335
+
336
+ if attributes.key?(:'unique_form_id')
337
+ self.unique_form_id = attributes[:'unique_form_id']
338
+ end
339
+
340
+ if attributes.key?(:'no_tin')
341
+ self.no_tin = attributes[:'no_tin']
342
+ end
343
+
344
+ if attributes.key?(:'recipient_date_of_birth')
345
+ self.recipient_date_of_birth = attributes[:'recipient_date_of_birth']
346
+ end
347
+
348
+ if attributes.key?(:'recipient_giin')
349
+ self.recipient_giin = attributes[:'recipient_giin']
350
+ end
351
+
352
+ if attributes.key?(:'recipient_foreign_tin')
353
+ self.recipient_foreign_tin = attributes[:'recipient_foreign_tin']
354
+ end
355
+
356
+ if attributes.key?(:'lob_code')
357
+ self.lob_code = attributes[:'lob_code']
358
+ end
359
+
360
+ if attributes.key?(:'income_code')
361
+ self.income_code = attributes[:'income_code']
362
+ end
363
+
364
+ if attributes.key?(:'gross_income')
365
+ self.gross_income = attributes[:'gross_income']
366
+ end
367
+
368
+ if attributes.key?(:'withholding_indicator')
369
+ self.withholding_indicator = attributes[:'withholding_indicator']
370
+ end
371
+
372
+ if attributes.key?(:'tax_country_code')
373
+ self.tax_country_code = attributes[:'tax_country_code']
374
+ end
375
+
376
+ if attributes.key?(:'exemption_code_chap3')
377
+ self.exemption_code_chap3 = attributes[:'exemption_code_chap3']
378
+ end
379
+
380
+ if attributes.key?(:'exemption_code_chap4')
381
+ self.exemption_code_chap4 = attributes[:'exemption_code_chap4']
382
+ end
383
+
384
+ if attributes.key?(:'tax_rate_chap3')
385
+ self.tax_rate_chap3 = attributes[:'tax_rate_chap3']
386
+ end
387
+
388
+ if attributes.key?(:'withholding_allowance')
389
+ self.withholding_allowance = attributes[:'withholding_allowance']
390
+ end
391
+
392
+ if attributes.key?(:'federal_tax_withheld')
393
+ self.federal_tax_withheld = attributes[:'federal_tax_withheld']
394
+ end
395
+
396
+ if attributes.key?(:'tax_not_deposited_indicator')
397
+ self.tax_not_deposited_indicator = attributes[:'tax_not_deposited_indicator']
398
+ end
399
+
400
+ if attributes.key?(:'academic_indicator')
401
+ self.academic_indicator = attributes[:'academic_indicator']
402
+ end
403
+
404
+ if attributes.key?(:'tax_withheld_other_agents')
405
+ self.tax_withheld_other_agents = attributes[:'tax_withheld_other_agents']
406
+ end
407
+
408
+ if attributes.key?(:'amount_repaid')
409
+ self.amount_repaid = attributes[:'amount_repaid']
410
+ end
411
+
412
+ if attributes.key?(:'tax_paid_agent')
413
+ self.tax_paid_agent = attributes[:'tax_paid_agent']
414
+ end
415
+
416
+ if attributes.key?(:'chap3_status_code')
417
+ self.chap3_status_code = attributes[:'chap3_status_code']
418
+ end
419
+
420
+ if attributes.key?(:'chap4_status_code')
421
+ self.chap4_status_code = attributes[:'chap4_status_code']
422
+ end
423
+
424
+ if attributes.key?(:'primary_withholding_agent')
425
+ self.primary_withholding_agent = attributes[:'primary_withholding_agent']
426
+ end
427
+
428
+ if attributes.key?(:'intermediary_or_flow_through')
429
+ self.intermediary_or_flow_through = attributes[:'intermediary_or_flow_through']
430
+ end
431
+
432
+ if attributes.key?(:'issuer_id')
433
+ self.issuer_id = attributes[:'issuer_id']
434
+ end
435
+
436
+ if attributes.key?(:'reference_id')
437
+ self.reference_id = attributes[:'reference_id']
438
+ end
439
+
440
+ if attributes.key?(:'recipient_tin')
441
+ self.recipient_tin = attributes[:'recipient_tin']
442
+ end
443
+
444
+ if attributes.key?(:'recipient_name')
445
+ self.recipient_name = attributes[:'recipient_name']
446
+ else
447
+ self.recipient_name = nil
448
+ end
449
+
450
+ if attributes.key?(:'tin_type')
451
+ self.tin_type = attributes[:'tin_type']
452
+ end
453
+
454
+ if attributes.key?(:'recipient_second_name')
455
+ self.recipient_second_name = attributes[:'recipient_second_name']
456
+ end
457
+
458
+ if attributes.key?(:'address')
459
+ self.address = attributes[:'address']
460
+ else
461
+ self.address = nil
462
+ end
463
+
464
+ if attributes.key?(:'address2')
465
+ self.address2 = attributes[:'address2']
466
+ end
467
+
468
+ if attributes.key?(:'city')
469
+ self.city = attributes[:'city']
470
+ else
471
+ self.city = nil
472
+ end
473
+
474
+ if attributes.key?(:'state')
475
+ self.state = attributes[:'state']
476
+ end
477
+
478
+ if attributes.key?(:'zip')
479
+ self.zip = attributes[:'zip']
480
+ end
481
+
482
+ if attributes.key?(:'recipient_email')
483
+ self.recipient_email = attributes[:'recipient_email']
484
+ end
485
+
486
+ if attributes.key?(:'account_number')
487
+ self.account_number = attributes[:'account_number']
488
+ end
489
+
490
+ if attributes.key?(:'office_code')
491
+ self.office_code = attributes[:'office_code']
492
+ end
493
+
494
+ if attributes.key?(:'recipient_non_us_province')
495
+ self.recipient_non_us_province = attributes[:'recipient_non_us_province']
496
+ end
497
+
498
+ if attributes.key?(:'country_code')
499
+ self.country_code = attributes[:'country_code']
500
+ else
501
+ self.country_code = nil
502
+ end
503
+
504
+ if attributes.key?(:'federal_e_file')
505
+ self.federal_e_file = attributes[:'federal_e_file']
506
+ end
507
+
508
+ if attributes.key?(:'postal_mail')
509
+ self.postal_mail = attributes[:'postal_mail']
510
+ end
511
+
512
+ if attributes.key?(:'state_e_file')
513
+ self.state_e_file = attributes[:'state_e_file']
514
+ end
515
+
516
+ if attributes.key?(:'tin_match')
517
+ self.tin_match = attributes[:'tin_match']
518
+ end
519
+
520
+ if attributes.key?(:'address_verification')
521
+ self.address_verification = attributes[:'address_verification']
522
+ end
523
+
524
+ if attributes.key?(:'state_and_local_withholding')
525
+ self.state_and_local_withholding = attributes[:'state_and_local_withholding']
526
+ end
527
+ end
528
+
529
+ # Show invalid properties with the reasons. Usually used together with valid?
530
+ # @return Array for valid properties with the reasons
531
+ def list_invalid_properties
532
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
533
+ invalid_properties = Array.new
534
+ if @recipient_name.nil?
535
+ invalid_properties.push('invalid value for "recipient_name", recipient_name cannot be nil.')
536
+ end
537
+
538
+ if @recipient_name.to_s.length < 1
539
+ invalid_properties.push('invalid value for "recipient_name", the character length must be great than or equal to 1.')
540
+ end
541
+
542
+ if @address.nil?
543
+ invalid_properties.push('invalid value for "address", address cannot be nil.')
544
+ end
545
+
546
+ if @address.to_s.length < 1
547
+ invalid_properties.push('invalid value for "address", the character length must be great than or equal to 1.')
548
+ end
549
+
550
+ if @city.nil?
551
+ invalid_properties.push('invalid value for "city", city cannot be nil.')
552
+ end
553
+
554
+ if @city.to_s.length < 1
555
+ invalid_properties.push('invalid value for "city", the character length must be great than or equal to 1.')
556
+ end
557
+
558
+ if @country_code.nil?
559
+ invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
560
+ end
561
+
562
+ if @country_code.to_s.length < 1
563
+ invalid_properties.push('invalid value for "country_code", the character length must be great than or equal to 1.')
564
+ end
565
+
566
+ invalid_properties
567
+ end
568
+
569
+ # Check to see if the all the properties in the model are valid
570
+ # @return true if the model is valid
571
+ def valid?
572
+ warn '[DEPRECATED] the `valid?` method is obsolete'
573
+ lob_code_validator = EnumAttributeValidator.new('String', ["Individual", "GovernmentContractingState", "TaxExemptPensionTrust", "TaxExemptCharitableOrganization", "PubliclyTradedCorporation", "SubsidiaryOfPubliclyTradedCorporation", "CompanyOwnershipBaseErosionTest", "CompanyDerivativeBenefitsTest", "CompanyActiveTradeOrBusinessTest", "DiscretionaryDetermination", "Other", "NoLobArticleInTreaty"])
574
+ return false unless lob_code_validator.valid?(@lob_code)
575
+ exemption_code_chap3_validator = EnumAttributeValidator.new('String', ["TaxRateDueToBackupWithholding", "EffectivelyConnectedIncome", "ExemptUnderIrc", "IncomeNotFromUsSources", "ExemptUnderTaxTreaty", "PortfolioInterestExemptUnderIrc", "QiThatAssumesPrimaryWithholdingResponsibility", "WfPorWft", "UsBranchTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "QiRepresentsIncomeExempt", "QslThatAssumesPrimaryWithholdingResponsibility", "PayeeSubjectedToChapter4Withholding", "QddThatAssumesPrimaryWithholdingResponsibility", "ExemptUnderSection897L", "ExemptUnderSection892"])
576
+ return false unless exemption_code_chap3_validator.valid?(@exemption_code_chap3)
577
+ exemption_code_chap4_validator = EnumAttributeValidator.new('String', ["NotExempt", "GrandfatheredPayment", "EffectivelyConnectedIncome", "PayeeNotSubjectToChapter4Withholding", "ExcludedNonfinancialPayment", "ForeignEntityThatAssumesPrimaryWithholdingResponsibility", "UsPayeesOfParticipatingFfi", "ExemptFromWithholdingUnderIga", "DormantAccount", "OtherPaymentNotSubjectToChapter4Withholding"])
578
+ return false unless exemption_code_chap4_validator.valid?(@exemption_code_chap4)
579
+ chap3_status_code_validator = EnumAttributeValidator.new('String', ["USWithholdingAgentFI", "USWithholdingAgentOther", "TerritoryFITreatedAsUSPerson", "TerritoryFINotTreatedAsUSPerson", "USBranchTreatedAsUSPerson", "USBranchNotTreatedAsUSPerson", "USBranchECIPresumptionApplied", "PartnershipOtherThanWithholdingForeignPartnership", "WithholdingForeignPartnership", "TrustOtherThanWithholdingForeignTrust", "WithholdingForeignTrust", "QualifiedIntermediary", "QualifiedSecuritiesLenderQualifiedIntermediary", "QualifiedSecuritiesLenderOther", "Corporation", "Individual", "Estate", "PrivateFoundation", "GovernmentOrInternationalOrganization", "TaxExemptOrganizationSection501cEntities", "UnknownRecipient", "ArtistOrAthlete", "Pension", "ForeignCentralBankOfIssue", "NonqualifiedIntermediary", "HybridEntityMakingTreatyClaim", "WithholdingRatePoolGeneral", "WithholdingRatePoolExemptOrganization", "PAIWithholdingRatePoolGeneral", "PAIWithholdingRatePoolExemptOrganization", "AgencyWithholdingRatePoolGeneral", "AgencyWithholdingRatePoolExemptOrganization", "USWithholdingAgentForeignBranchOfFI", "QualifiedDerivativesDealer", "ForeignGovernmentIntegralPart", "ForeignGovernmentControlledEntity", "PubliclyTradedPartnership", "DisclosingQualifiedIntermediary"])
580
+ return false unless chap3_status_code_validator.valid?(@chap3_status_code)
581
+ chap4_status_code_validator = EnumAttributeValidator.new('String', ["UsWithholdingAgentFi", "UsWithholdingAgentOther", "TerritoryFiNotTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "ParticipatingFfiOther", "ParticipatingFfiReportingModel2Ffi", "RegisteredDeemedCompliantFfiReportingModel1Ffi", "RegisteredDeemedCompliantFfiSponsoredEntity", "RegisteredDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiffiWithLowValueAccounts", "CertifiedDeemedCompliantFfiNonRegisteringLocalBank", "CertifiedDeemedCompliantFfiSponsoredEntity", "CertifiedDeemedCompliantFfiInvestmentAdvisorOrManager", "NonparticipatingFfi", "OwnerDocumentedFfi", "UsBranchTreatedAsUsPerson", "UsBranchNotTreatedAsUsPerson", "PassiveNffeIdentifyingSubstantialUsOwners", "PassiveNffeWithNoSubstantialUsOwners", "PubliclyTradedNffeOrAffiliate", "ActiveNffe", "Individual", "Section501CEntities", "ExceptedTerritoryNffe", "ExceptedNffeOther", "ExemptBeneficialOwner", "EntityWhollyOwnedByExemptBeneficialOwners", "UnknownRecipient", "RecalcitrantAccountHolder", "NonreportingIgafii", "DirectReportingNffe", "UsReportableAccount", "NonConsentingUsAccount", "SponsoredDirectReportingNffe", "ExceptedInterAffiliateFfi", "UndocumentedPreexistingObligation", "UsBranchEciPresumptionApplied", "AccountHolderOfExcludedFinancialAccount", "PassiveNffeReportedByFfi", "NffeSubjectTo1472Withholding", "RecalcitrantPoolNoUsIndicia", "RecalcitrantPoolUsIndicia", "RecalcitrantPoolDormantAccount", "RecalcitrantPoolUsPersons", "RecalcitrantPoolPassiveNffEs", "NonparticipatingFfiPool", "UsPayeesPool", "QiRecalcitrantPoolGeneral", "UsWithholdingAgentForeignBranchOfFi"])
582
+ return false unless chap4_status_code_validator.valid?(@chap4_status_code)
583
+ return false if @recipient_name.nil?
584
+ return false if @recipient_name.to_s.length < 1
585
+ tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
586
+ return false unless tin_type_validator.valid?(@tin_type)
587
+ return false if @address.nil?
588
+ return false if @address.to_s.length < 1
589
+ return false if @city.nil?
590
+ return false if @city.to_s.length < 1
591
+ return false if @country_code.nil?
592
+ return false if @country_code.to_s.length < 1
593
+ true
594
+ end
595
+
596
+ # Custom attribute writer method checking allowed values (enum).
597
+ # @param [Object] lob_code Object to be assigned
598
+ def lob_code=(lob_code)
599
+ validator = EnumAttributeValidator.new('String', ["Individual", "GovernmentContractingState", "TaxExemptPensionTrust", "TaxExemptCharitableOrganization", "PubliclyTradedCorporation", "SubsidiaryOfPubliclyTradedCorporation", "CompanyOwnershipBaseErosionTest", "CompanyDerivativeBenefitsTest", "CompanyActiveTradeOrBusinessTest", "DiscretionaryDetermination", "Other", "NoLobArticleInTreaty"])
600
+ unless validator.valid?(lob_code)
601
+ fail ArgumentError, "invalid value for \"lob_code\", must be one of #{validator.allowable_values}."
602
+ end
603
+ @lob_code = lob_code
604
+ end
605
+
606
+ # Custom attribute writer method checking allowed values (enum).
607
+ # @param [Object] exemption_code_chap3 Object to be assigned
608
+ def exemption_code_chap3=(exemption_code_chap3)
609
+ validator = EnumAttributeValidator.new('String', ["TaxRateDueToBackupWithholding", "EffectivelyConnectedIncome", "ExemptUnderIrc", "IncomeNotFromUsSources", "ExemptUnderTaxTreaty", "PortfolioInterestExemptUnderIrc", "QiThatAssumesPrimaryWithholdingResponsibility", "WfPorWft", "UsBranchTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "QiRepresentsIncomeExempt", "QslThatAssumesPrimaryWithholdingResponsibility", "PayeeSubjectedToChapter4Withholding", "QddThatAssumesPrimaryWithholdingResponsibility", "ExemptUnderSection897L", "ExemptUnderSection892"])
610
+ unless validator.valid?(exemption_code_chap3)
611
+ fail ArgumentError, "invalid value for \"exemption_code_chap3\", must be one of #{validator.allowable_values}."
612
+ end
613
+ @exemption_code_chap3 = exemption_code_chap3
614
+ end
615
+
616
+ # Custom attribute writer method checking allowed values (enum).
617
+ # @param [Object] exemption_code_chap4 Object to be assigned
618
+ def exemption_code_chap4=(exemption_code_chap4)
619
+ validator = EnumAttributeValidator.new('String', ["NotExempt", "GrandfatheredPayment", "EffectivelyConnectedIncome", "PayeeNotSubjectToChapter4Withholding", "ExcludedNonfinancialPayment", "ForeignEntityThatAssumesPrimaryWithholdingResponsibility", "UsPayeesOfParticipatingFfi", "ExemptFromWithholdingUnderIga", "DormantAccount", "OtherPaymentNotSubjectToChapter4Withholding"])
620
+ unless validator.valid?(exemption_code_chap4)
621
+ fail ArgumentError, "invalid value for \"exemption_code_chap4\", must be one of #{validator.allowable_values}."
622
+ end
623
+ @exemption_code_chap4 = exemption_code_chap4
624
+ end
625
+
626
+ # Custom attribute writer method checking allowed values (enum).
627
+ # @param [Object] chap3_status_code Object to be assigned
628
+ def chap3_status_code=(chap3_status_code)
629
+ validator = EnumAttributeValidator.new('String', ["USWithholdingAgentFI", "USWithholdingAgentOther", "TerritoryFITreatedAsUSPerson", "TerritoryFINotTreatedAsUSPerson", "USBranchTreatedAsUSPerson", "USBranchNotTreatedAsUSPerson", "USBranchECIPresumptionApplied", "PartnershipOtherThanWithholdingForeignPartnership", "WithholdingForeignPartnership", "TrustOtherThanWithholdingForeignTrust", "WithholdingForeignTrust", "QualifiedIntermediary", "QualifiedSecuritiesLenderQualifiedIntermediary", "QualifiedSecuritiesLenderOther", "Corporation", "Individual", "Estate", "PrivateFoundation", "GovernmentOrInternationalOrganization", "TaxExemptOrganizationSection501cEntities", "UnknownRecipient", "ArtistOrAthlete", "Pension", "ForeignCentralBankOfIssue", "NonqualifiedIntermediary", "HybridEntityMakingTreatyClaim", "WithholdingRatePoolGeneral", "WithholdingRatePoolExemptOrganization", "PAIWithholdingRatePoolGeneral", "PAIWithholdingRatePoolExemptOrganization", "AgencyWithholdingRatePoolGeneral", "AgencyWithholdingRatePoolExemptOrganization", "USWithholdingAgentForeignBranchOfFI", "QualifiedDerivativesDealer", "ForeignGovernmentIntegralPart", "ForeignGovernmentControlledEntity", "PubliclyTradedPartnership", "DisclosingQualifiedIntermediary"])
630
+ unless validator.valid?(chap3_status_code)
631
+ fail ArgumentError, "invalid value for \"chap3_status_code\", must be one of #{validator.allowable_values}."
632
+ end
633
+ @chap3_status_code = chap3_status_code
634
+ end
635
+
636
+ # Custom attribute writer method checking allowed values (enum).
637
+ # @param [Object] chap4_status_code Object to be assigned
638
+ def chap4_status_code=(chap4_status_code)
639
+ validator = EnumAttributeValidator.new('String', ["UsWithholdingAgentFi", "UsWithholdingAgentOther", "TerritoryFiNotTreatedAsUsPerson", "TerritoryFiTreatedAsUsPerson", "ParticipatingFfiOther", "ParticipatingFfiReportingModel2Ffi", "RegisteredDeemedCompliantFfiReportingModel1Ffi", "RegisteredDeemedCompliantFfiSponsoredEntity", "RegisteredDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiOther", "CertifiedDeemedCompliantFfiffiWithLowValueAccounts", "CertifiedDeemedCompliantFfiNonRegisteringLocalBank", "CertifiedDeemedCompliantFfiSponsoredEntity", "CertifiedDeemedCompliantFfiInvestmentAdvisorOrManager", "NonparticipatingFfi", "OwnerDocumentedFfi", "UsBranchTreatedAsUsPerson", "UsBranchNotTreatedAsUsPerson", "PassiveNffeIdentifyingSubstantialUsOwners", "PassiveNffeWithNoSubstantialUsOwners", "PubliclyTradedNffeOrAffiliate", "ActiveNffe", "Individual", "Section501CEntities", "ExceptedTerritoryNffe", "ExceptedNffeOther", "ExemptBeneficialOwner", "EntityWhollyOwnedByExemptBeneficialOwners", "UnknownRecipient", "RecalcitrantAccountHolder", "NonreportingIgafii", "DirectReportingNffe", "UsReportableAccount", "NonConsentingUsAccount", "SponsoredDirectReportingNffe", "ExceptedInterAffiliateFfi", "UndocumentedPreexistingObligation", "UsBranchEciPresumptionApplied", "AccountHolderOfExcludedFinancialAccount", "PassiveNffeReportedByFfi", "NffeSubjectTo1472Withholding", "RecalcitrantPoolNoUsIndicia", "RecalcitrantPoolUsIndicia", "RecalcitrantPoolDormantAccount", "RecalcitrantPoolUsPersons", "RecalcitrantPoolPassiveNffEs", "NonparticipatingFfiPool", "UsPayeesPool", "QiRecalcitrantPoolGeneral", "UsWithholdingAgentForeignBranchOfFi"])
640
+ unless validator.valid?(chap4_status_code)
641
+ fail ArgumentError, "invalid value for \"chap4_status_code\", must be one of #{validator.allowable_values}."
642
+ end
643
+ @chap4_status_code = chap4_status_code
644
+ end
645
+
646
+ # Custom attribute writer method with validation
647
+ # @param [Object] recipient_name Value to be assigned
648
+ def recipient_name=(recipient_name)
649
+ if recipient_name.nil?
650
+ fail ArgumentError, 'recipient_name cannot be nil'
651
+ end
652
+
653
+ if recipient_name.to_s.length < 1
654
+ fail ArgumentError, 'invalid value for "recipient_name", the character length must be great than or equal to 1.'
655
+ end
656
+
657
+ @recipient_name = recipient_name
658
+ end
659
+
660
+ # Custom attribute writer method checking allowed values (enum).
661
+ # @param [Object] tin_type Object to be assigned
662
+ def tin_type=(tin_type)
663
+ validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
664
+ unless validator.valid?(tin_type)
665
+ fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}."
666
+ end
667
+ @tin_type = tin_type
668
+ end
669
+
670
+ # Custom attribute writer method with validation
671
+ # @param [Object] address Value to be assigned
672
+ def address=(address)
673
+ if address.nil?
674
+ fail ArgumentError, 'address cannot be nil'
675
+ end
676
+
677
+ if address.to_s.length < 1
678
+ fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 1.'
679
+ end
680
+
681
+ @address = address
682
+ end
683
+
684
+ # Custom attribute writer method with validation
685
+ # @param [Object] city Value to be assigned
686
+ def city=(city)
687
+ if city.nil?
688
+ fail ArgumentError, 'city cannot be nil'
689
+ end
690
+
691
+ if city.to_s.length < 1
692
+ fail ArgumentError, 'invalid value for "city", the character length must be great than or equal to 1.'
693
+ end
694
+
695
+ @city = city
696
+ end
697
+
698
+ # Custom attribute writer method with validation
699
+ # @param [Object] country_code Value to be assigned
700
+ def country_code=(country_code)
701
+ if country_code.nil?
702
+ fail ArgumentError, 'country_code cannot be nil'
703
+ end
704
+
705
+ if country_code.to_s.length < 1
706
+ fail ArgumentError, 'invalid value for "country_code", the character length must be great than or equal to 1.'
707
+ end
708
+
709
+ @country_code = country_code
710
+ end
711
+
712
+ # Checks equality by comparing each attribute.
713
+ # @param [Object] Object to be compared
714
+ def ==(o)
715
+ return true if self.equal?(o)
716
+ self.class == o.class &&
717
+ unique_form_id == o.unique_form_id &&
718
+ no_tin == o.no_tin &&
719
+ recipient_date_of_birth == o.recipient_date_of_birth &&
720
+ recipient_giin == o.recipient_giin &&
721
+ recipient_foreign_tin == o.recipient_foreign_tin &&
722
+ lob_code == o.lob_code &&
723
+ income_code == o.income_code &&
724
+ gross_income == o.gross_income &&
725
+ withholding_indicator == o.withholding_indicator &&
726
+ tax_country_code == o.tax_country_code &&
727
+ exemption_code_chap3 == o.exemption_code_chap3 &&
728
+ exemption_code_chap4 == o.exemption_code_chap4 &&
729
+ tax_rate_chap3 == o.tax_rate_chap3 &&
730
+ withholding_allowance == o.withholding_allowance &&
731
+ federal_tax_withheld == o.federal_tax_withheld &&
732
+ tax_not_deposited_indicator == o.tax_not_deposited_indicator &&
733
+ academic_indicator == o.academic_indicator &&
734
+ tax_withheld_other_agents == o.tax_withheld_other_agents &&
735
+ amount_repaid == o.amount_repaid &&
736
+ tax_paid_agent == o.tax_paid_agent &&
737
+ chap3_status_code == o.chap3_status_code &&
738
+ chap4_status_code == o.chap4_status_code &&
739
+ primary_withholding_agent == o.primary_withholding_agent &&
740
+ intermediary_or_flow_through == o.intermediary_or_flow_through &&
741
+ issuer_id == o.issuer_id &&
742
+ reference_id == o.reference_id &&
743
+ recipient_tin == o.recipient_tin &&
744
+ recipient_name == o.recipient_name &&
745
+ tin_type == o.tin_type &&
746
+ recipient_second_name == o.recipient_second_name &&
747
+ address == o.address &&
748
+ address2 == o.address2 &&
749
+ city == o.city &&
750
+ state == o.state &&
751
+ zip == o.zip &&
752
+ recipient_email == o.recipient_email &&
753
+ account_number == o.account_number &&
754
+ office_code == o.office_code &&
755
+ recipient_non_us_province == o.recipient_non_us_province &&
756
+ country_code == o.country_code &&
757
+ federal_e_file == o.federal_e_file &&
758
+ postal_mail == o.postal_mail &&
759
+ state_e_file == o.state_e_file &&
760
+ tin_match == o.tin_match &&
761
+ address_verification == o.address_verification &&
762
+ state_and_local_withholding == o.state_and_local_withholding
763
+ end
764
+
765
+ # @see the `==` method
766
+ # @param [Object] Object to be compared
767
+ def eql?(o)
768
+ self == o
769
+ end
770
+
771
+ # Calculates hash code according to all attributes.
772
+ # @return [Integer] Hash code
773
+ def hash
774
+ [unique_form_id, no_tin, recipient_date_of_birth, recipient_giin, recipient_foreign_tin, lob_code, income_code, gross_income, withholding_indicator, tax_country_code, exemption_code_chap3, exemption_code_chap4, tax_rate_chap3, withholding_allowance, federal_tax_withheld, tax_not_deposited_indicator, academic_indicator, tax_withheld_other_agents, amount_repaid, tax_paid_agent, chap3_status_code, chap4_status_code, primary_withholding_agent, intermediary_or_flow_through, issuer_id, reference_id, recipient_tin, recipient_name, tin_type, recipient_second_name, address, address2, city, state, zip, recipient_email, account_number, office_code, recipient_non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, address_verification, state_and_local_withholding].hash
775
+ end
776
+
777
+ # Builds the object from hash
778
+ # @param [Hash] attributes Model attributes in the form of hash
779
+ # @return [Object] Returns the model itself
780
+ def self.build_from_hash(attributes)
781
+ return nil unless attributes.is_a?(Hash)
782
+ attributes = attributes.transform_keys(&:to_sym)
783
+ transformed_hash = {}
784
+ openapi_types.each_pair do |key, type|
785
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
786
+ transformed_hash["#{key}"] = nil
787
+ elsif type =~ /\AArray<(.*)>/i
788
+ # check to ensure the input is an array given that the attribute
789
+ # is documented as an array but the input is not
790
+ if attributes[attribute_map[key]].is_a?(Array)
791
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
792
+ end
793
+ elsif !attributes[attribute_map[key]].nil?
794
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
795
+ end
796
+ end
797
+ new(transformed_hash)
798
+ end
799
+
800
+ # Deserializes the data based on type
801
+ # @param string type Data type
802
+ # @param string value Value to be deserialized
803
+ # @return [Object] Deserialized data
804
+ def self._deserialize(type, value)
805
+ case type.to_sym
806
+ when :Time
807
+ Time.parse(value)
808
+ when :Date
809
+ Date.parse(value)
810
+ when :String
811
+ value.to_s
812
+ when :Integer
813
+ value.to_i
814
+ when :Float
815
+ value.to_f
816
+ when :Boolean
817
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
818
+ true
819
+ else
820
+ false
821
+ end
822
+ when :Object
823
+ # generic object (usually a Hash), return directly
824
+ value
825
+ when /\AArray<(?<inner_type>.+)>\z/
826
+ inner_type = Regexp.last_match[:inner_type]
827
+ value.map { |v| _deserialize(inner_type, v) }
828
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
829
+ k_type = Regexp.last_match[:k_type]
830
+ v_type = Regexp.last_match[:v_type]
831
+ {}.tap do |hash|
832
+ value.each do |k, v|
833
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
834
+ end
835
+ end
836
+ else # model
837
+ # models (e.g. Pet) or oneOf
838
+ klass = AvalaraSdk::A1099::V2.const_get(type)
839
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
840
+ end
841
+ end
842
+
843
+ # Returns the string representation of the object
844
+ # @return [String] String presentation of the object
845
+ def to_s
846
+ to_hash.to_s
847
+ end
848
+
849
+ # to_body is an alias to to_hash (backward compatibility)
850
+ # @return [Hash] Returns the object in the form of hash
851
+ def to_body
852
+ to_hash
853
+ end
854
+
855
+ # Returns the object in the form of hash
856
+ # @return [Hash] Returns the object in the form of hash
857
+ def to_hash
858
+ hash = {}
859
+ self.class.attribute_map.each_pair do |attr, param|
860
+ value = self.send(attr)
861
+ if value.nil?
862
+ is_nullable = self.class.openapi_nullable.include?(attr)
863
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
864
+ end
865
+
866
+ hash[param] = _to_hash(value)
867
+ end
868
+ hash
869
+ end
870
+
871
+ # Outputs non-array value in the form of hash
872
+ # For object, use to_hash. Otherwise, just return the value
873
+ # @param [Object] value Any valid value
874
+ # @return [Hash] Returns the value in the form of hash
875
+ def _to_hash(value)
876
+ if value.is_a?(Array)
877
+ value.compact.map { |v| _to_hash(v) }
878
+ elsif value.is_a?(Hash)
879
+ {}.tap do |hash|
880
+ value.each { |k, v| hash[k] = _to_hash(v) }
881
+ end
882
+ elsif value.respond_to? :to_hash
883
+ value.to_hash
884
+ else
885
+ value
886
+ end
887
+ end
888
+
889
+ end
890
+
891
+ end