avalara_sdk 25.8.0 → 25.8.2

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 (185) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +32 -6
  4. data/docs/A1099/V2/BulkUpsert1099FormsRequest.md +4 -0
  5. data/docs/A1099/V2/CompaniesW9Api.md +6 -6
  6. data/docs/A1099/V2/CoveredIndividualRequest.md +26 -26
  7. data/docs/A1099/V2/Create1099Form201Response.md +4 -0
  8. data/docs/A1099/V2/ErrorResponse.md +1 -1
  9. data/docs/A1099/V2/ErrorResponseItem.md +20 -0
  10. data/docs/A1099/V2/Form1042S.md +140 -0
  11. data/docs/A1099/V2/Form1042SListItem.md +12 -8
  12. data/docs/A1099/V2/Form1042SListItemResponse.md +19 -9
  13. data/docs/A1099/V2/Form1042SRequest.md +14 -10
  14. data/docs/A1099/V2/Form1042SResponse.md +10 -6
  15. data/docs/A1099/V2/Form1095B.md +14 -2
  16. data/docs/A1099/V2/Form1095BListItem.md +14 -8
  17. data/docs/A1099/V2/Form1095BListItemResponse.md +20 -8
  18. data/docs/A1099/V2/Form1095BRequest.md +14 -8
  19. data/docs/A1099/V2/Form1095BResponse.md +106 -0
  20. data/docs/A1099/V2/Form1095CList.md +20 -0
  21. data/docs/A1099/V2/Form1095CListItem.md +90 -0
  22. data/docs/A1099/V2/Form1099Base.md +14 -2
  23. data/docs/A1099/V2/Form1099BaseResponse.md +20 -8
  24. data/docs/A1099/V2/Form1099Div.md +130 -0
  25. data/docs/A1099/V2/Form1099DivListItem.md +32 -28
  26. data/docs/A1099/V2/Form1099DivListItemResponse.md +130 -0
  27. data/docs/A1099/V2/Form1099DivRequest.md +32 -28
  28. data/docs/A1099/V2/Form1099DivResponse.md +48 -6
  29. data/docs/A1099/V2/Form1099Int.md +122 -0
  30. data/docs/A1099/V2/Form1099IntList.md +20 -0
  31. data/docs/A1099/V2/Form1099IntListItem.md +100 -0
  32. data/docs/A1099/V2/Form1099IntListItemResponse.md +122 -0
  33. data/docs/A1099/V2/Form1099IntRequest.md +96 -0
  34. data/docs/A1099/V2/Form1099IntResponse.md +120 -0
  35. data/docs/A1099/V2/Form1099K.md +14 -2
  36. data/docs/A1099/V2/Form1099KListItem.md +14 -8
  37. data/docs/A1099/V2/Form1099KListItemResponse.md +20 -8
  38. data/docs/A1099/V2/Form1099KRequest.md +18 -12
  39. data/docs/A1099/V2/Form1099KResponse.md +132 -0
  40. data/docs/A1099/V2/Form1099ListResponseValueInner.md +4 -0
  41. data/docs/A1099/V2/Form1099Misc.md +24 -12
  42. data/docs/A1099/V2/Form1099MiscListItem.md +14 -12
  43. data/docs/A1099/V2/Form1099MiscListItemResponse.md +30 -16
  44. data/docs/A1099/V2/Form1099MiscRequest.md +14 -12
  45. data/docs/A1099/V2/Form1099MiscResponse.md +12 -10
  46. data/docs/A1099/V2/Form1099Nec.md +14 -2
  47. data/docs/A1099/V2/Form1099NecListItem.md +14 -10
  48. data/docs/A1099/V2/Form1099NecListItemResponse.md +20 -8
  49. data/docs/A1099/V2/Form1099NecRequest.md +14 -10
  50. data/docs/A1099/V2/Form1099NecResponse.md +10 -8
  51. data/docs/A1099/V2/Form1099ProccessResult.md +3 -1
  52. data/docs/A1099/V2/Form1099ProccessResultProcessedFormsInner.md +61 -0
  53. data/docs/A1099/V2/Form1099R.md +14 -4
  54. data/docs/A1099/V2/Form1099RListItem.md +12 -8
  55. data/docs/A1099/V2/Form1099RListItemResponse.md +20 -10
  56. data/docs/A1099/V2/Form1099RRequest.md +12 -8
  57. data/docs/A1099/V2/Form1099RResponse.md +132 -0
  58. data/docs/A1099/V2/FormRequestBase.md +14 -8
  59. data/docs/A1099/V2/FormRequestListItemBase.md +14 -8
  60. data/docs/A1099/V2/FormResponseBase.md +10 -6
  61. data/docs/A1099/V2/FormSingleRequestBase.md +14 -8
  62. data/docs/A1099/V2/Forms1099Api.md +11 -11
  63. data/docs/A1099/V2/FormsW9Api.md +21 -19
  64. data/docs/A1099/V2/Get1099Form200Response.md +4 -0
  65. data/docs/A1099/V2/ICreateForm1099Request.md +2 -0
  66. data/docs/A1099/V2/IUpdateForm1099Request.md +2 -0
  67. data/docs/A1099/V2/IrsResponse.md +20 -0
  68. data/docs/A1099/V2/Issuers1099Api.md +6 -6
  69. data/docs/A1099/V2/Jobs1099Api.md +1 -1
  70. data/docs/A1099/V2/OfferAndCoverageRequest.md +26 -0
  71. data/docs/A1099/V2/PaginatedQueryResultModelCompanyResponse.md +1 -1
  72. data/docs/A1099/V2/PaginatedQueryResultModelIssuerResponse.md +1 -1
  73. data/docs/A1099/V2/PaginatedQueryResultModelW9FormBaseResponse.md +22 -0
  74. data/docs/A1099/V2/TinMatchStatusResponse.md +22 -0
  75. data/docs/A1099/V2/Update1099Form200Response.md +8 -0
  76. data/docs/A1099/V2/W4FormResponse.md +1 -29
  77. data/docs/A1099/V2/W8BenEFormResponse.md +1 -29
  78. data/docs/A1099/V2/W8BenFormResponse.md +1 -29
  79. data/docs/A1099/V2/W8ImyFormResponse.md +1 -29
  80. data/docs/A1099/V2/W9FormBaseResponse.md +3 -3
  81. data/docs/A1099/V2/W9FormResponse.md +2 -28
  82. data/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb +1 -1
  83. data/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb +3 -3
  84. data/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb +30 -14
  85. data/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb +1 -1
  86. data/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb +1 -1
  87. data/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb +1 -1
  88. data/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb +1 -1
  89. data/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb +1 -1
  90. data/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb +1 -1
  91. data/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb +1 -1
  92. data/lib/avalara_sdk/api/EInvoicing/V1/tax_identifiers_api.rb +1 -1
  93. data/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb +1 -1
  94. data/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb +2 -0
  95. data/lib/avalara_sdk/models/A1099/V2/covered_individual_reference.rb +1 -1
  96. data/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb +79 -79
  97. data/lib/avalara_sdk/models/A1099/V2/create1099_form201_response.rb +2 -0
  98. data/lib/avalara_sdk/models/A1099/V2/error_response.rb +1 -1
  99. data/lib/avalara_sdk/models/A1099/V2/error_response_item.rb +221 -0
  100. data/lib/avalara_sdk/models/A1099/V2/form1042_s.rb +824 -0
  101. data/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item.rb +44 -119
  102. data/lib/avalara_sdk/models/A1099/V2/form1042_s_list_item_response.rb +67 -12
  103. data/lib/avalara_sdk/models/A1099/V2/form1042_s_request.rb +55 -132
  104. data/lib/avalara_sdk/models/A1099/V2/form1042_s_response.rb +43 -24
  105. data/lib/avalara_sdk/models/A1099/V2/form1095_b.rb +68 -9
  106. data/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb +54 -119
  107. data/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item_response.rb +77 -12
  108. data/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb +56 -121
  109. data/lib/avalara_sdk/models/A1099/V2/form1095_b_response.rb +709 -0
  110. data/lib/avalara_sdk/models/A1099/V2/form1095_c_list.rb +238 -0
  111. data/lib/avalara_sdk/models/A1099/V2/form1095_c_list_item.rb +662 -0
  112. data/lib/avalara_sdk/models/A1099/V2/form1099_base.rb +68 -9
  113. data/lib/avalara_sdk/models/A1099/V2/form1099_base_response.rb +77 -12
  114. data/lib/avalara_sdk/models/A1099/V2/form1099_div.rb +781 -0
  115. data/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb +93 -147
  116. data/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item_response.rb +931 -0
  117. data/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb +93 -149
  118. data/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb +214 -24
  119. data/lib/avalara_sdk/models/A1099/V2/form1099_int.rb +741 -0
  120. data/lib/avalara_sdk/models/A1099/V2/form1099_int_list.rb +238 -0
  121. data/lib/avalara_sdk/models/A1099/V2/form1099_int_list_item.rb +702 -0
  122. data/lib/avalara_sdk/models/A1099/V2/form1099_int_list_item_response.rb +887 -0
  123. data/lib/avalara_sdk/models/A1099/V2/form1099_int_request.rb +684 -0
  124. data/lib/avalara_sdk/models/A1099/V2/form1099_int_response.rb +773 -0
  125. data/lib/avalara_sdk/models/A1099/V2/form1099_k.rb +68 -9
  126. data/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb +56 -119
  127. data/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item_response.rb +77 -12
  128. data/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb +82 -123
  129. data/lib/avalara_sdk/models/A1099/V2/form1099_k_response.rb +839 -0
  130. data/lib/avalara_sdk/models/A1099/V2/form1099_list_response_value_inner.rb +2 -0
  131. data/lib/avalara_sdk/models/A1099/V2/form1099_misc.rb +106 -47
  132. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb +52 -135
  133. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item_response.rb +116 -40
  134. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb +52 -137
  135. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb +49 -39
  136. data/lib/avalara_sdk/models/A1099/V2/form1099_nec.rb +68 -9
  137. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb +56 -129
  138. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item_response.rb +77 -12
  139. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb +56 -131
  140. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb +43 -33
  141. data/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result.rb +22 -4
  142. data/lib/avalara_sdk/models/A1099/V2/form1099_proccess_result_processed_forms_inner.rb +107 -0
  143. data/lib/avalara_sdk/models/A1099/V2/form1099_r.rb +68 -19
  144. data/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb +46 -119
  145. data/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item_response.rb +77 -23
  146. data/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb +46 -121
  147. data/lib/avalara_sdk/models/A1099/V2/form1099_r_response.rb +839 -0
  148. data/lib/avalara_sdk/models/A1099/V2/form1099_status_detail.rb +1 -1
  149. data/lib/avalara_sdk/models/A1099/V2/form_request_base.rb +54 -119
  150. data/lib/avalara_sdk/models/A1099/V2/form_request_list_item_base.rb +56 -119
  151. data/lib/avalara_sdk/models/A1099/V2/form_response_base.rb +43 -24
  152. data/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb +56 -121
  153. data/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb +2 -0
  154. data/lib/avalara_sdk/models/A1099/V2/i_create_form1099_request.rb +1 -0
  155. data/lib/avalara_sdk/models/A1099/V2/i_update_form1099_request.rb +1 -0
  156. data/lib/avalara_sdk/models/A1099/V2/included_base.rb +1 -1
  157. data/lib/avalara_sdk/models/A1099/V2/irs_response.rb +221 -0
  158. data/lib/avalara_sdk/models/A1099/V2/issuer_command.rb +1 -0
  159. data/lib/avalara_sdk/models/A1099/V2/offer_and_coverage_request.rb +256 -0
  160. data/lib/avalara_sdk/models/A1099/V2/paginated_query_result_model_w9_form_base_response.rb +234 -0
  161. data/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding.rb +1 -1
  162. data/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail.rb +1 -1
  163. data/lib/avalara_sdk/models/A1099/V2/tin_match_status_response.rb +267 -0
  164. data/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb +4 -0
  165. data/lib/avalara_sdk/models/A1099/V2/validation_error.rb +1 -1
  166. data/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb +15 -157
  167. data/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb +14 -156
  168. data/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb +15 -157
  169. data/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb +15 -157
  170. data/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb +19 -14
  171. data/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb +18 -150
  172. data/lib/avalara_sdk/version.rb +1 -1
  173. data/lib/avalara_sdk.rb +21 -1
  174. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-11.1.3/gem_make.out +5 -5
  175. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/gem_make.out +5 -5
  176. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/gem_make.out +5 -5
  177. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debug-1.10.0/gem_make.out +5 -5
  178. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/erb-5.0.1/gem_make.out +5 -5
  179. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/gem_make.out +5 -5
  180. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/gem_make.out +5 -5
  181. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/prism-1.4.0/gem_make.out +5 -5
  182. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/gem_make.out +5 -5
  183. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +5 -5
  184. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/gem_make.out +5 -5
  185. metadata +42 -2
@@ -0,0 +1,824 @@
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 Form1042S
14
+ attr_accessor :unique_form_id
15
+
16
+ attr_accessor :recipient_date_of_birth
17
+
18
+ attr_accessor :recipient_giin
19
+
20
+ attr_accessor :recipient_foreign_tin
21
+
22
+ attr_accessor :lob_code
23
+
24
+ attr_accessor :income_code
25
+
26
+ attr_accessor :gross_income
27
+
28
+ attr_accessor :withholding_indicator
29
+
30
+ attr_accessor :tax_country_code
31
+
32
+ attr_accessor :exemption_code_chap3
33
+
34
+ attr_accessor :exemption_code_chap4
35
+
36
+ attr_accessor :tax_rate_chap3
37
+
38
+ attr_accessor :withholding_allowance
39
+
40
+ attr_accessor :federal_tax_withheld
41
+
42
+ attr_accessor :tax_not_deposited_indicator
43
+
44
+ attr_accessor :academic_indicator
45
+
46
+ attr_accessor :tax_withheld_other_agents
47
+
48
+ attr_accessor :amount_repaid
49
+
50
+ attr_accessor :tax_paid_agent
51
+
52
+ attr_accessor :chap3_status_code
53
+
54
+ attr_accessor :chap4_status_code
55
+
56
+ attr_accessor :primary_withholding_agent
57
+
58
+ attr_accessor :intermediary_or_flow_through
59
+
60
+ attr_accessor :id
61
+
62
+ attr_accessor :type
63
+
64
+ attr_accessor :issuer_id
65
+
66
+ attr_accessor :issuer_reference_id
67
+
68
+ attr_accessor :issuer_tin
69
+
70
+ attr_accessor :tax_year
71
+
72
+ attr_accessor :federal_efile
73
+
74
+ attr_accessor :federal_efile_status
75
+
76
+ attr_accessor :state_efile
77
+
78
+ attr_accessor :state_efile_status
79
+
80
+ attr_accessor :postal_mail
81
+
82
+ attr_accessor :postal_mail_status
83
+
84
+ attr_accessor :tin_match
85
+
86
+ attr_accessor :tin_match_status
87
+
88
+ attr_accessor :address_verification
89
+
90
+ attr_accessor :address_verification_status
91
+
92
+ attr_accessor :e_delivery_status
93
+
94
+ attr_accessor :reference_id
95
+
96
+ attr_accessor :email
97
+
98
+ attr_accessor :tin_type
99
+
100
+ attr_accessor :fatca_filing_requirement
101
+
102
+ attr_accessor :tin
103
+
104
+ attr_accessor :no_tin
105
+
106
+ attr_accessor :second_tin_notice
107
+
108
+ attr_accessor :recipient_name
109
+
110
+ attr_accessor :recipient_second_name
111
+
112
+ attr_accessor :address
113
+
114
+ attr_accessor :address2
115
+
116
+ attr_accessor :city
117
+
118
+ attr_accessor :state
119
+
120
+ attr_accessor :zip
121
+
122
+ attr_accessor :non_us_province
123
+
124
+ attr_accessor :country_code
125
+
126
+ attr_accessor :account_number
127
+
128
+ attr_accessor :office_code
129
+
130
+ attr_accessor :validation_errors
131
+
132
+ attr_accessor :created_at
133
+
134
+ attr_accessor :updated_at
135
+
136
+ attr_accessor :state_and_local_withholding
137
+
138
+ # Attribute mapping from ruby-style variable name to JSON key.
139
+ def self.attribute_map
140
+ {
141
+ :'unique_form_id' => :'uniqueFormId',
142
+ :'recipient_date_of_birth' => :'recipientDateOfBirth',
143
+ :'recipient_giin' => :'recipientGiin',
144
+ :'recipient_foreign_tin' => :'recipientForeignTin',
145
+ :'lob_code' => :'lobCode',
146
+ :'income_code' => :'incomeCode',
147
+ :'gross_income' => :'grossIncome',
148
+ :'withholding_indicator' => :'withholdingIndicator',
149
+ :'tax_country_code' => :'taxCountryCode',
150
+ :'exemption_code_chap3' => :'exemptionCodeChap3',
151
+ :'exemption_code_chap4' => :'exemptionCodeChap4',
152
+ :'tax_rate_chap3' => :'taxRateChap3',
153
+ :'withholding_allowance' => :'withholdingAllowance',
154
+ :'federal_tax_withheld' => :'federalTaxWithheld',
155
+ :'tax_not_deposited_indicator' => :'taxNotDepositedIndicator',
156
+ :'academic_indicator' => :'academicIndicator',
157
+ :'tax_withheld_other_agents' => :'taxWithheldOtherAgents',
158
+ :'amount_repaid' => :'amountRepaid',
159
+ :'tax_paid_agent' => :'taxPaidAgent',
160
+ :'chap3_status_code' => :'chap3StatusCode',
161
+ :'chap4_status_code' => :'chap4StatusCode',
162
+ :'primary_withholding_agent' => :'primaryWithholdingAgent',
163
+ :'intermediary_or_flow_through' => :'intermediaryOrFlowThrough',
164
+ :'id' => :'id',
165
+ :'type' => :'type',
166
+ :'issuer_id' => :'issuerId',
167
+ :'issuer_reference_id' => :'issuerReferenceId',
168
+ :'issuer_tin' => :'issuerTin',
169
+ :'tax_year' => :'taxYear',
170
+ :'federal_efile' => :'federalEfile',
171
+ :'federal_efile_status' => :'federalEfileStatus',
172
+ :'state_efile' => :'stateEfile',
173
+ :'state_efile_status' => :'stateEfileStatus',
174
+ :'postal_mail' => :'postalMail',
175
+ :'postal_mail_status' => :'postalMailStatus',
176
+ :'tin_match' => :'tinMatch',
177
+ :'tin_match_status' => :'tinMatchStatus',
178
+ :'address_verification' => :'addressVerification',
179
+ :'address_verification_status' => :'addressVerificationStatus',
180
+ :'e_delivery_status' => :'eDeliveryStatus',
181
+ :'reference_id' => :'referenceId',
182
+ :'email' => :'email',
183
+ :'tin_type' => :'tinType',
184
+ :'fatca_filing_requirement' => :'fatcaFilingRequirement',
185
+ :'tin' => :'tin',
186
+ :'no_tin' => :'noTin',
187
+ :'second_tin_notice' => :'secondTinNotice',
188
+ :'recipient_name' => :'recipientName',
189
+ :'recipient_second_name' => :'recipientSecondName',
190
+ :'address' => :'address',
191
+ :'address2' => :'address2',
192
+ :'city' => :'city',
193
+ :'state' => :'state',
194
+ :'zip' => :'zip',
195
+ :'non_us_province' => :'nonUsProvince',
196
+ :'country_code' => :'countryCode',
197
+ :'account_number' => :'accountNumber',
198
+ :'office_code' => :'officeCode',
199
+ :'validation_errors' => :'validationErrors',
200
+ :'created_at' => :'createdAt',
201
+ :'updated_at' => :'updatedAt',
202
+ :'state_and_local_withholding' => :'stateAndLocalWithholding'
203
+ }
204
+ end
205
+
206
+ # Returns all the JSON keys this model knows about
207
+ def self.acceptable_attributes
208
+ attribute_map.values
209
+ end
210
+
211
+ # Attribute type mapping.
212
+ def self.openapi_types
213
+ {
214
+ :'unique_form_id' => :'String',
215
+ :'recipient_date_of_birth' => :'Time',
216
+ :'recipient_giin' => :'String',
217
+ :'recipient_foreign_tin' => :'String',
218
+ :'lob_code' => :'String',
219
+ :'income_code' => :'String',
220
+ :'gross_income' => :'Float',
221
+ :'withholding_indicator' => :'String',
222
+ :'tax_country_code' => :'String',
223
+ :'exemption_code_chap3' => :'String',
224
+ :'exemption_code_chap4' => :'String',
225
+ :'tax_rate_chap3' => :'String',
226
+ :'withholding_allowance' => :'Float',
227
+ :'federal_tax_withheld' => :'Float',
228
+ :'tax_not_deposited_indicator' => :'Boolean',
229
+ :'academic_indicator' => :'Boolean',
230
+ :'tax_withheld_other_agents' => :'Float',
231
+ :'amount_repaid' => :'Float',
232
+ :'tax_paid_agent' => :'Float',
233
+ :'chap3_status_code' => :'String',
234
+ :'chap4_status_code' => :'String',
235
+ :'primary_withholding_agent' => :'PrimaryWithholdingAgent',
236
+ :'intermediary_or_flow_through' => :'IntermediaryOrFlowThrough',
237
+ :'id' => :'String',
238
+ :'type' => :'String',
239
+ :'issuer_id' => :'Integer',
240
+ :'issuer_reference_id' => :'String',
241
+ :'issuer_tin' => :'String',
242
+ :'tax_year' => :'Integer',
243
+ :'federal_efile' => :'Boolean',
244
+ :'federal_efile_status' => :'Form1099StatusDetail',
245
+ :'state_efile' => :'Boolean',
246
+ :'state_efile_status' => :'Array<StateEfileStatusDetail>',
247
+ :'postal_mail' => :'Boolean',
248
+ :'postal_mail_status' => :'Form1099StatusDetail',
249
+ :'tin_match' => :'Boolean',
250
+ :'tin_match_status' => :'Form1099StatusDetail',
251
+ :'address_verification' => :'Boolean',
252
+ :'address_verification_status' => :'Form1099StatusDetail',
253
+ :'e_delivery_status' => :'Form1099StatusDetail',
254
+ :'reference_id' => :'String',
255
+ :'email' => :'String',
256
+ :'tin_type' => :'String',
257
+ :'fatca_filing_requirement' => :'Boolean',
258
+ :'tin' => :'String',
259
+ :'no_tin' => :'Boolean',
260
+ :'second_tin_notice' => :'Boolean',
261
+ :'recipient_name' => :'String',
262
+ :'recipient_second_name' => :'String',
263
+ :'address' => :'String',
264
+ :'address2' => :'String',
265
+ :'city' => :'String',
266
+ :'state' => :'String',
267
+ :'zip' => :'String',
268
+ :'non_us_province' => :'String',
269
+ :'country_code' => :'String',
270
+ :'account_number' => :'String',
271
+ :'office_code' => :'String',
272
+ :'validation_errors' => :'Array<ValidationError>',
273
+ :'created_at' => :'Time',
274
+ :'updated_at' => :'Time',
275
+ :'state_and_local_withholding' => :'StateAndLocalWithholding'
276
+ }
277
+ end
278
+
279
+ # List of attributes with nullable: true
280
+ def self.openapi_nullable
281
+ Set.new([
282
+ :'recipient_date_of_birth',
283
+ :'recipient_giin',
284
+ :'recipient_foreign_tin',
285
+ :'lob_code',
286
+ :'exemption_code_chap3',
287
+ :'exemption_code_chap4',
288
+ :'tax_rate_chap3',
289
+ :'withholding_allowance',
290
+ :'federal_tax_withheld',
291
+ :'tax_not_deposited_indicator',
292
+ :'academic_indicator',
293
+ :'tax_withheld_other_agents',
294
+ :'amount_repaid',
295
+ :'tax_paid_agent',
296
+ :'chap3_status_code',
297
+ :'chap4_status_code',
298
+ :'issuer_reference_id',
299
+ :'issuer_tin',
300
+ :'state_efile_status',
301
+ :'postal_mail_status',
302
+ :'tin_match_status',
303
+ :'address_verification_status',
304
+ :'e_delivery_status',
305
+ :'reference_id',
306
+ :'email',
307
+ :'tin_type',
308
+ :'fatca_filing_requirement',
309
+ :'tin',
310
+ :'second_tin_notice',
311
+ :'recipient_name',
312
+ :'recipient_second_name',
313
+ :'address',
314
+ :'address2',
315
+ :'city',
316
+ :'state',
317
+ :'zip',
318
+ :'non_us_province',
319
+ :'country_code',
320
+ :'account_number',
321
+ :'office_code',
322
+ :'validation_errors',
323
+ :'state_and_local_withholding'
324
+ ])
325
+ end
326
+
327
+ # List of class defined in allOf (OpenAPI v3)
328
+ def self.openapi_all_of
329
+ [
330
+ :'Form1099Base'
331
+ ]
332
+ end
333
+
334
+ # Initializes the object
335
+ # @param [Hash] attributes Model attributes in the form of hash
336
+ def initialize(attributes = {})
337
+ if (!attributes.is_a?(Hash))
338
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1042S` initialize method"
339
+ end
340
+
341
+ # check to see if the attribute exists and convert string to symbol for hash key
342
+ attributes = attributes.each_with_object({}) { |(k, v), h|
343
+ if (!self.class.attribute_map.key?(k.to_sym))
344
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1042S`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
345
+ end
346
+ h[k.to_sym] = v
347
+ }
348
+
349
+ if attributes.key?(:'unique_form_id')
350
+ self.unique_form_id = attributes[:'unique_form_id']
351
+ end
352
+
353
+ if attributes.key?(:'recipient_date_of_birth')
354
+ self.recipient_date_of_birth = attributes[:'recipient_date_of_birth']
355
+ end
356
+
357
+ if attributes.key?(:'recipient_giin')
358
+ self.recipient_giin = attributes[:'recipient_giin']
359
+ end
360
+
361
+ if attributes.key?(:'recipient_foreign_tin')
362
+ self.recipient_foreign_tin = attributes[:'recipient_foreign_tin']
363
+ end
364
+
365
+ if attributes.key?(:'lob_code')
366
+ self.lob_code = attributes[:'lob_code']
367
+ end
368
+
369
+ if attributes.key?(:'income_code')
370
+ self.income_code = attributes[:'income_code']
371
+ end
372
+
373
+ if attributes.key?(:'gross_income')
374
+ self.gross_income = attributes[:'gross_income']
375
+ end
376
+
377
+ if attributes.key?(:'withholding_indicator')
378
+ self.withholding_indicator = attributes[:'withholding_indicator']
379
+ end
380
+
381
+ if attributes.key?(:'tax_country_code')
382
+ self.tax_country_code = attributes[:'tax_country_code']
383
+ end
384
+
385
+ if attributes.key?(:'exemption_code_chap3')
386
+ self.exemption_code_chap3 = attributes[:'exemption_code_chap3']
387
+ end
388
+
389
+ if attributes.key?(:'exemption_code_chap4')
390
+ self.exemption_code_chap4 = attributes[:'exemption_code_chap4']
391
+ end
392
+
393
+ if attributes.key?(:'tax_rate_chap3')
394
+ self.tax_rate_chap3 = attributes[:'tax_rate_chap3']
395
+ end
396
+
397
+ if attributes.key?(:'withholding_allowance')
398
+ self.withholding_allowance = attributes[:'withholding_allowance']
399
+ end
400
+
401
+ if attributes.key?(:'federal_tax_withheld')
402
+ self.federal_tax_withheld = attributes[:'federal_tax_withheld']
403
+ end
404
+
405
+ if attributes.key?(:'tax_not_deposited_indicator')
406
+ self.tax_not_deposited_indicator = attributes[:'tax_not_deposited_indicator']
407
+ end
408
+
409
+ if attributes.key?(:'academic_indicator')
410
+ self.academic_indicator = attributes[:'academic_indicator']
411
+ end
412
+
413
+ if attributes.key?(:'tax_withheld_other_agents')
414
+ self.tax_withheld_other_agents = attributes[:'tax_withheld_other_agents']
415
+ end
416
+
417
+ if attributes.key?(:'amount_repaid')
418
+ self.amount_repaid = attributes[:'amount_repaid']
419
+ end
420
+
421
+ if attributes.key?(:'tax_paid_agent')
422
+ self.tax_paid_agent = attributes[:'tax_paid_agent']
423
+ end
424
+
425
+ if attributes.key?(:'chap3_status_code')
426
+ self.chap3_status_code = attributes[:'chap3_status_code']
427
+ end
428
+
429
+ if attributes.key?(:'chap4_status_code')
430
+ self.chap4_status_code = attributes[:'chap4_status_code']
431
+ end
432
+
433
+ if attributes.key?(:'primary_withholding_agent')
434
+ self.primary_withholding_agent = attributes[:'primary_withholding_agent']
435
+ end
436
+
437
+ if attributes.key?(:'intermediary_or_flow_through')
438
+ self.intermediary_or_flow_through = attributes[:'intermediary_or_flow_through']
439
+ end
440
+
441
+ if attributes.key?(:'id')
442
+ self.id = attributes[:'id']
443
+ end
444
+
445
+ if attributes.key?(:'type')
446
+ self.type = attributes[:'type']
447
+ end
448
+
449
+ if attributes.key?(:'issuer_id')
450
+ self.issuer_id = attributes[:'issuer_id']
451
+ end
452
+
453
+ if attributes.key?(:'issuer_reference_id')
454
+ self.issuer_reference_id = attributes[:'issuer_reference_id']
455
+ end
456
+
457
+ if attributes.key?(:'issuer_tin')
458
+ self.issuer_tin = attributes[:'issuer_tin']
459
+ end
460
+
461
+ if attributes.key?(:'tax_year')
462
+ self.tax_year = attributes[:'tax_year']
463
+ end
464
+
465
+ if attributes.key?(:'federal_efile')
466
+ self.federal_efile = attributes[:'federal_efile']
467
+ end
468
+
469
+ if attributes.key?(:'federal_efile_status')
470
+ self.federal_efile_status = attributes[:'federal_efile_status']
471
+ end
472
+
473
+ if attributes.key?(:'state_efile')
474
+ self.state_efile = attributes[:'state_efile']
475
+ end
476
+
477
+ if attributes.key?(:'state_efile_status')
478
+ if (value = attributes[:'state_efile_status']).is_a?(Array)
479
+ self.state_efile_status = value
480
+ end
481
+ end
482
+
483
+ if attributes.key?(:'postal_mail')
484
+ self.postal_mail = attributes[:'postal_mail']
485
+ end
486
+
487
+ if attributes.key?(:'postal_mail_status')
488
+ self.postal_mail_status = attributes[:'postal_mail_status']
489
+ end
490
+
491
+ if attributes.key?(:'tin_match')
492
+ self.tin_match = attributes[:'tin_match']
493
+ end
494
+
495
+ if attributes.key?(:'tin_match_status')
496
+ self.tin_match_status = attributes[:'tin_match_status']
497
+ end
498
+
499
+ if attributes.key?(:'address_verification')
500
+ self.address_verification = attributes[:'address_verification']
501
+ end
502
+
503
+ if attributes.key?(:'address_verification_status')
504
+ self.address_verification_status = attributes[:'address_verification_status']
505
+ end
506
+
507
+ if attributes.key?(:'e_delivery_status')
508
+ self.e_delivery_status = attributes[:'e_delivery_status']
509
+ end
510
+
511
+ if attributes.key?(:'reference_id')
512
+ self.reference_id = attributes[:'reference_id']
513
+ end
514
+
515
+ if attributes.key?(:'email')
516
+ self.email = attributes[:'email']
517
+ end
518
+
519
+ if attributes.key?(:'tin_type')
520
+ self.tin_type = attributes[:'tin_type']
521
+ end
522
+
523
+ if attributes.key?(:'fatca_filing_requirement')
524
+ self.fatca_filing_requirement = attributes[:'fatca_filing_requirement']
525
+ end
526
+
527
+ if attributes.key?(:'tin')
528
+ self.tin = attributes[:'tin']
529
+ end
530
+
531
+ if attributes.key?(:'no_tin')
532
+ self.no_tin = attributes[:'no_tin']
533
+ end
534
+
535
+ if attributes.key?(:'second_tin_notice')
536
+ self.second_tin_notice = attributes[:'second_tin_notice']
537
+ end
538
+
539
+ if attributes.key?(:'recipient_name')
540
+ self.recipient_name = attributes[:'recipient_name']
541
+ end
542
+
543
+ if attributes.key?(:'recipient_second_name')
544
+ self.recipient_second_name = attributes[:'recipient_second_name']
545
+ end
546
+
547
+ if attributes.key?(:'address')
548
+ self.address = attributes[:'address']
549
+ end
550
+
551
+ if attributes.key?(:'address2')
552
+ self.address2 = attributes[:'address2']
553
+ end
554
+
555
+ if attributes.key?(:'city')
556
+ self.city = attributes[:'city']
557
+ end
558
+
559
+ if attributes.key?(:'state')
560
+ self.state = attributes[:'state']
561
+ end
562
+
563
+ if attributes.key?(:'zip')
564
+ self.zip = attributes[:'zip']
565
+ end
566
+
567
+ if attributes.key?(:'non_us_province')
568
+ self.non_us_province = attributes[:'non_us_province']
569
+ end
570
+
571
+ if attributes.key?(:'country_code')
572
+ self.country_code = attributes[:'country_code']
573
+ end
574
+
575
+ if attributes.key?(:'account_number')
576
+ self.account_number = attributes[:'account_number']
577
+ end
578
+
579
+ if attributes.key?(:'office_code')
580
+ self.office_code = attributes[:'office_code']
581
+ end
582
+
583
+ if attributes.key?(:'validation_errors')
584
+ if (value = attributes[:'validation_errors']).is_a?(Array)
585
+ self.validation_errors = value
586
+ end
587
+ end
588
+
589
+ if attributes.key?(:'created_at')
590
+ self.created_at = attributes[:'created_at']
591
+ end
592
+
593
+ if attributes.key?(:'updated_at')
594
+ self.updated_at = attributes[:'updated_at']
595
+ end
596
+
597
+ if attributes.key?(:'state_and_local_withholding')
598
+ self.state_and_local_withholding = attributes[:'state_and_local_withholding']
599
+ end
600
+ end
601
+
602
+ # Show invalid properties with the reasons. Usually used together with valid?
603
+ # @return Array for valid properties with the reasons
604
+ def list_invalid_properties
605
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
606
+ invalid_properties = Array.new
607
+ invalid_properties
608
+ end
609
+
610
+ # Check to see if the all the properties in the model are valid
611
+ # @return true if the model is valid
612
+ def valid?
613
+ warn '[DEPRECATED] the `valid?` method is obsolete'
614
+ true
615
+ end
616
+
617
+ # Custom attribute writer method with validation
618
+ # @param [Object] state_efile_status Value to be assigned
619
+ def state_efile_status=(state_efile_status)
620
+ @state_efile_status = state_efile_status
621
+ end
622
+
623
+ # Custom attribute writer method with validation
624
+ # @param [Object] validation_errors Value to be assigned
625
+ def validation_errors=(validation_errors)
626
+ @validation_errors = validation_errors
627
+ end
628
+
629
+ # Checks equality by comparing each attribute.
630
+ # @param [Object] Object to be compared
631
+ def ==(o)
632
+ return true if self.equal?(o)
633
+ self.class == o.class &&
634
+ unique_form_id == o.unique_form_id &&
635
+ recipient_date_of_birth == o.recipient_date_of_birth &&
636
+ recipient_giin == o.recipient_giin &&
637
+ recipient_foreign_tin == o.recipient_foreign_tin &&
638
+ lob_code == o.lob_code &&
639
+ income_code == o.income_code &&
640
+ gross_income == o.gross_income &&
641
+ withholding_indicator == o.withholding_indicator &&
642
+ tax_country_code == o.tax_country_code &&
643
+ exemption_code_chap3 == o.exemption_code_chap3 &&
644
+ exemption_code_chap4 == o.exemption_code_chap4 &&
645
+ tax_rate_chap3 == o.tax_rate_chap3 &&
646
+ withholding_allowance == o.withholding_allowance &&
647
+ federal_tax_withheld == o.federal_tax_withheld &&
648
+ tax_not_deposited_indicator == o.tax_not_deposited_indicator &&
649
+ academic_indicator == o.academic_indicator &&
650
+ tax_withheld_other_agents == o.tax_withheld_other_agents &&
651
+ amount_repaid == o.amount_repaid &&
652
+ tax_paid_agent == o.tax_paid_agent &&
653
+ chap3_status_code == o.chap3_status_code &&
654
+ chap4_status_code == o.chap4_status_code &&
655
+ primary_withholding_agent == o.primary_withholding_agent &&
656
+ intermediary_or_flow_through == o.intermediary_or_flow_through &&
657
+ id == o.id &&
658
+ type == o.type &&
659
+ issuer_id == o.issuer_id &&
660
+ issuer_reference_id == o.issuer_reference_id &&
661
+ issuer_tin == o.issuer_tin &&
662
+ tax_year == o.tax_year &&
663
+ federal_efile == o.federal_efile &&
664
+ federal_efile_status == o.federal_efile_status &&
665
+ state_efile == o.state_efile &&
666
+ state_efile_status == o.state_efile_status &&
667
+ postal_mail == o.postal_mail &&
668
+ postal_mail_status == o.postal_mail_status &&
669
+ tin_match == o.tin_match &&
670
+ tin_match_status == o.tin_match_status &&
671
+ address_verification == o.address_verification &&
672
+ address_verification_status == o.address_verification_status &&
673
+ e_delivery_status == o.e_delivery_status &&
674
+ reference_id == o.reference_id &&
675
+ email == o.email &&
676
+ tin_type == o.tin_type &&
677
+ fatca_filing_requirement == o.fatca_filing_requirement &&
678
+ tin == o.tin &&
679
+ no_tin == o.no_tin &&
680
+ second_tin_notice == o.second_tin_notice &&
681
+ recipient_name == o.recipient_name &&
682
+ recipient_second_name == o.recipient_second_name &&
683
+ address == o.address &&
684
+ address2 == o.address2 &&
685
+ city == o.city &&
686
+ state == o.state &&
687
+ zip == o.zip &&
688
+ non_us_province == o.non_us_province &&
689
+ country_code == o.country_code &&
690
+ account_number == o.account_number &&
691
+ office_code == o.office_code &&
692
+ validation_errors == o.validation_errors &&
693
+ created_at == o.created_at &&
694
+ updated_at == o.updated_at &&
695
+ state_and_local_withholding == o.state_and_local_withholding
696
+ end
697
+
698
+ # @see the `==` method
699
+ # @param [Object] Object to be compared
700
+ def eql?(o)
701
+ self == o
702
+ end
703
+
704
+ # Calculates hash code according to all attributes.
705
+ # @return [Integer] Hash code
706
+ def hash
707
+ [unique_form_id, 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, id, type, issuer_id, issuer_reference_id, issuer_tin, tax_year, federal_efile, federal_efile_status, state_efile, state_efile_status, postal_mail, postal_mail_status, tin_match, tin_match_status, address_verification, address_verification_status, e_delivery_status, reference_id, email, tin_type, fatca_filing_requirement, tin, no_tin, second_tin_notice, recipient_name, recipient_second_name, address, address2, city, state, zip, non_us_province, country_code, account_number, office_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash
708
+ end
709
+
710
+ # Builds the object from hash
711
+ # @param [Hash] attributes Model attributes in the form of hash
712
+ # @return [Object] Returns the model itself
713
+ def self.build_from_hash(attributes)
714
+ return nil unless attributes.is_a?(Hash)
715
+ attributes = attributes.transform_keys(&:to_sym)
716
+ transformed_hash = {}
717
+ openapi_types.each_pair do |key, type|
718
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
719
+ transformed_hash["#{key}"] = nil
720
+ elsif type =~ /\AArray<(.*)>/i
721
+ # check to ensure the input is an array given that the attribute
722
+ # is documented as an array but the input is not
723
+ if attributes[attribute_map[key]].is_a?(Array)
724
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
725
+ end
726
+ elsif !attributes[attribute_map[key]].nil?
727
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
728
+ end
729
+ end
730
+ new(transformed_hash)
731
+ end
732
+
733
+ # Deserializes the data based on type
734
+ # @param string type Data type
735
+ # @param string value Value to be deserialized
736
+ # @return [Object] Deserialized data
737
+ def self._deserialize(type, value)
738
+ case type.to_sym
739
+ when :Time
740
+ Time.parse(value)
741
+ when :Date
742
+ Date.parse(value)
743
+ when :String
744
+ value.to_s
745
+ when :Integer
746
+ value.to_i
747
+ when :Float
748
+ value.to_f
749
+ when :Boolean
750
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
751
+ true
752
+ else
753
+ false
754
+ end
755
+ when :Object
756
+ # generic object (usually a Hash), return directly
757
+ value
758
+ when /\AArray<(?<inner_type>.+)>\z/
759
+ inner_type = Regexp.last_match[:inner_type]
760
+ value.map { |v| _deserialize(inner_type, v) }
761
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
762
+ k_type = Regexp.last_match[:k_type]
763
+ v_type = Regexp.last_match[:v_type]
764
+ {}.tap do |hash|
765
+ value.each do |k, v|
766
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
767
+ end
768
+ end
769
+ else # model
770
+ # models (e.g. Pet) or oneOf
771
+ klass = AvalaraSdk::A1099::V2.const_get(type)
772
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
773
+ end
774
+ end
775
+
776
+ # Returns the string representation of the object
777
+ # @return [String] String presentation of the object
778
+ def to_s
779
+ to_hash.to_s
780
+ end
781
+
782
+ # to_body is an alias to to_hash (backward compatibility)
783
+ # @return [Hash] Returns the object in the form of hash
784
+ def to_body
785
+ to_hash
786
+ end
787
+
788
+ # Returns the object in the form of hash
789
+ # @return [Hash] Returns the object in the form of hash
790
+ def to_hash
791
+ hash = {}
792
+ self.class.attribute_map.each_pair do |attr, param|
793
+ value = self.send(attr)
794
+ if value.nil?
795
+ is_nullable = self.class.openapi_nullable.include?(attr)
796
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
797
+ end
798
+
799
+ hash[param] = _to_hash(value)
800
+ end
801
+ hash
802
+ end
803
+
804
+ # Outputs non-array value in the form of hash
805
+ # For object, use to_hash. Otherwise, just return the value
806
+ # @param [Object] value Any valid value
807
+ # @return [Hash] Returns the value in the form of hash
808
+ def _to_hash(value)
809
+ if value.is_a?(Array)
810
+ value.compact.map { |v| _to_hash(v) }
811
+ elsif value.is_a?(Hash)
812
+ {}.tap do |hash|
813
+ value.each { |k, v| hash[k] = _to_hash(v) }
814
+ end
815
+ elsif value.respond_to? :to_hash
816
+ value.to_hash
817
+ else
818
+ value
819
+ end
820
+ end
821
+
822
+ end
823
+
824
+ end