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,839 @@
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 Form1099RResponse
14
+ # Gross distribution
15
+ attr_accessor :gross_distribution
16
+
17
+ # Taxable amount
18
+ attr_accessor :taxable_amount
19
+
20
+ # Taxable amount not determined
21
+ attr_accessor :taxable_amount_not_determined
22
+
23
+ # Total distribution
24
+ attr_accessor :total_distribution_determined
25
+
26
+ # Capital gain (included in Box 2a)
27
+ attr_accessor :capital_gain
28
+
29
+ # Federal income tax withheld
30
+ attr_accessor :federal_income_tax_withheld
31
+
32
+ # Employee contributions/Designated Roth contributions or insurance premiums
33
+ attr_accessor :employee_contributions_or_designated_roth_or_insurance_premiums
34
+
35
+ # Net unrealized appreciation in employer's securities
36
+ attr_accessor :net_unrealized_appreciation_in_employer_securities
37
+
38
+ # Distribution code
39
+ attr_accessor :distribution_code
40
+
41
+ # Second distribution code
42
+ attr_accessor :second_distribution_code
43
+
44
+ # IRA/SEP/SIMPLE
45
+ attr_accessor :ira_sep_simple
46
+
47
+ # Traditional IRA/SEP/SIMPLE or Roth conversion amount
48
+ attr_accessor :traditional_ira_sep_simple_or_roth_conversion_amount
49
+
50
+ # Other amount
51
+ attr_accessor :other_amount
52
+
53
+ # Other percentage
54
+ attr_accessor :other_percentage
55
+
56
+ # Total distribution percentage
57
+ attr_accessor :total_distribution_percentage
58
+
59
+ # Total employee contributions
60
+ attr_accessor :total_employee_contributions
61
+
62
+ # Amount allocable to IRR within 5 years
63
+ attr_accessor :amount_allocable_to_irr_within5_years
64
+
65
+ # First year of designated Roth contribution
66
+ attr_accessor :first_year_of_designated_roth_contribution
67
+
68
+ # FATCA filing requirement
69
+ attr_accessor :fatca_filing_requirement
70
+
71
+ # Date of payment
72
+ attr_accessor :date_of_payment
73
+
74
+ attr_accessor :type
75
+
76
+ attr_accessor :created_at
77
+
78
+ attr_accessor :updated_at
79
+
80
+ attr_accessor :state_and_local_withholding
81
+
82
+ attr_accessor :tin_type
83
+
84
+ attr_accessor :id
85
+
86
+ attr_accessor :issuer_id
87
+
88
+ attr_accessor :issuer_reference_id
89
+
90
+ attr_accessor :issuer_tin
91
+
92
+ attr_accessor :tax_year
93
+
94
+ attr_accessor :reference_id
95
+
96
+ attr_accessor :recipient_name
97
+
98
+ attr_accessor :recipient_tin
99
+
100
+ attr_accessor :recipient_second_name
101
+
102
+ attr_accessor :address
103
+
104
+ attr_accessor :address2
105
+
106
+ attr_accessor :city
107
+
108
+ attr_accessor :state
109
+
110
+ attr_accessor :zip
111
+
112
+ attr_accessor :email
113
+
114
+ attr_accessor :account_number
115
+
116
+ attr_accessor :office_code
117
+
118
+ attr_accessor :non_us_province
119
+
120
+ attr_accessor :country_code
121
+
122
+ attr_accessor :federal_e_file
123
+
124
+ attr_accessor :postal_mail
125
+
126
+ attr_accessor :state_e_file
127
+
128
+ attr_accessor :tin_match
129
+
130
+ attr_accessor :no_tin
131
+
132
+ attr_accessor :second_tin_notice
133
+
134
+ attr_accessor :address_verification
135
+
136
+ attr_accessor :federal_efile_status
137
+
138
+ attr_accessor :e_delivery_status
139
+
140
+ attr_accessor :state_efile_status
141
+
142
+ attr_accessor :postal_mail_status
143
+
144
+ attr_accessor :tin_match_status
145
+
146
+ attr_accessor :address_verification_status
147
+
148
+ attr_accessor :validation_errors
149
+
150
+ class EnumAttributeValidator
151
+ attr_reader :datatype
152
+ attr_reader :allowable_values
153
+
154
+ def initialize(datatype, allowable_values)
155
+ @allowable_values = allowable_values.map do |value|
156
+ case datatype.to_s
157
+ when /Integer/i
158
+ value.to_i
159
+ when /Float/i
160
+ value.to_f
161
+ else
162
+ value
163
+ end
164
+ end
165
+ end
166
+
167
+ def valid?(value)
168
+ !value || allowable_values.include?(value)
169
+ end
170
+ end
171
+
172
+ # Attribute mapping from ruby-style variable name to JSON key.
173
+ def self.attribute_map
174
+ {
175
+ :'gross_distribution' => :'grossDistribution',
176
+ :'taxable_amount' => :'taxableAmount',
177
+ :'taxable_amount_not_determined' => :'taxableAmountNotDetermined',
178
+ :'total_distribution_determined' => :'totalDistributionDetermined',
179
+ :'capital_gain' => :'capitalGain',
180
+ :'federal_income_tax_withheld' => :'federalIncomeTaxWithheld',
181
+ :'employee_contributions_or_designated_roth_or_insurance_premiums' => :'employeeContributionsOrDesignatedRothOrInsurancePremiums',
182
+ :'net_unrealized_appreciation_in_employer_securities' => :'netUnrealizedAppreciationInEmployerSecurities',
183
+ :'distribution_code' => :'distributionCode',
184
+ :'second_distribution_code' => :'secondDistributionCode',
185
+ :'ira_sep_simple' => :'iraSepSimple',
186
+ :'traditional_ira_sep_simple_or_roth_conversion_amount' => :'traditionalIraSepSimpleOrRothConversionAmount',
187
+ :'other_amount' => :'otherAmount',
188
+ :'other_percentage' => :'otherPercentage',
189
+ :'total_distribution_percentage' => :'totalDistributionPercentage',
190
+ :'total_employee_contributions' => :'totalEmployeeContributions',
191
+ :'amount_allocable_to_irr_within5_years' => :'amountAllocableToIrrWithin5Years',
192
+ :'first_year_of_designated_roth_contribution' => :'firstYearOfDesignatedRothContribution',
193
+ :'fatca_filing_requirement' => :'fatcaFilingRequirement',
194
+ :'date_of_payment' => :'dateOfPayment',
195
+ :'type' => :'type',
196
+ :'created_at' => :'createdAt',
197
+ :'updated_at' => :'updatedAt',
198
+ :'state_and_local_withholding' => :'stateAndLocalWithholding',
199
+ :'tin_type' => :'tinType',
200
+ :'id' => :'id',
201
+ :'issuer_id' => :'issuerId',
202
+ :'issuer_reference_id' => :'issuerReferenceId',
203
+ :'issuer_tin' => :'issuerTin',
204
+ :'tax_year' => :'taxYear',
205
+ :'reference_id' => :'referenceId',
206
+ :'recipient_name' => :'recipientName',
207
+ :'recipient_tin' => :'recipientTin',
208
+ :'recipient_second_name' => :'recipientSecondName',
209
+ :'address' => :'address',
210
+ :'address2' => :'address2',
211
+ :'city' => :'city',
212
+ :'state' => :'state',
213
+ :'zip' => :'zip',
214
+ :'email' => :'email',
215
+ :'account_number' => :'accountNumber',
216
+ :'office_code' => :'officeCode',
217
+ :'non_us_province' => :'nonUsProvince',
218
+ :'country_code' => :'countryCode',
219
+ :'federal_e_file' => :'federalEFile',
220
+ :'postal_mail' => :'postalMail',
221
+ :'state_e_file' => :'stateEFile',
222
+ :'tin_match' => :'tinMatch',
223
+ :'no_tin' => :'noTin',
224
+ :'second_tin_notice' => :'secondTinNotice',
225
+ :'address_verification' => :'addressVerification',
226
+ :'federal_efile_status' => :'federalEfileStatus',
227
+ :'e_delivery_status' => :'eDeliveryStatus',
228
+ :'state_efile_status' => :'stateEfileStatus',
229
+ :'postal_mail_status' => :'postalMailStatus',
230
+ :'tin_match_status' => :'tinMatchStatus',
231
+ :'address_verification_status' => :'addressVerificationStatus',
232
+ :'validation_errors' => :'validationErrors'
233
+ }
234
+ end
235
+
236
+ # Returns all the JSON keys this model knows about
237
+ def self.acceptable_attributes
238
+ attribute_map.values
239
+ end
240
+
241
+ # Attribute type mapping.
242
+ def self.openapi_types
243
+ {
244
+ :'gross_distribution' => :'Float',
245
+ :'taxable_amount' => :'Float',
246
+ :'taxable_amount_not_determined' => :'Boolean',
247
+ :'total_distribution_determined' => :'Boolean',
248
+ :'capital_gain' => :'Float',
249
+ :'federal_income_tax_withheld' => :'Float',
250
+ :'employee_contributions_or_designated_roth_or_insurance_premiums' => :'Float',
251
+ :'net_unrealized_appreciation_in_employer_securities' => :'Float',
252
+ :'distribution_code' => :'String',
253
+ :'second_distribution_code' => :'String',
254
+ :'ira_sep_simple' => :'Boolean',
255
+ :'traditional_ira_sep_simple_or_roth_conversion_amount' => :'Float',
256
+ :'other_amount' => :'Float',
257
+ :'other_percentage' => :'String',
258
+ :'total_distribution_percentage' => :'String',
259
+ :'total_employee_contributions' => :'Float',
260
+ :'amount_allocable_to_irr_within5_years' => :'Float',
261
+ :'first_year_of_designated_roth_contribution' => :'String',
262
+ :'fatca_filing_requirement' => :'Boolean',
263
+ :'date_of_payment' => :'Time',
264
+ :'type' => :'String',
265
+ :'created_at' => :'Time',
266
+ :'updated_at' => :'Time',
267
+ :'state_and_local_withholding' => :'StateAndLocalWithholdingResponse',
268
+ :'tin_type' => :'String',
269
+ :'id' => :'String',
270
+ :'issuer_id' => :'String',
271
+ :'issuer_reference_id' => :'String',
272
+ :'issuer_tin' => :'String',
273
+ :'tax_year' => :'Integer',
274
+ :'reference_id' => :'String',
275
+ :'recipient_name' => :'String',
276
+ :'recipient_tin' => :'String',
277
+ :'recipient_second_name' => :'String',
278
+ :'address' => :'String',
279
+ :'address2' => :'String',
280
+ :'city' => :'String',
281
+ :'state' => :'String',
282
+ :'zip' => :'String',
283
+ :'email' => :'String',
284
+ :'account_number' => :'String',
285
+ :'office_code' => :'String',
286
+ :'non_us_province' => :'String',
287
+ :'country_code' => :'String',
288
+ :'federal_e_file' => :'Boolean',
289
+ :'postal_mail' => :'Boolean',
290
+ :'state_e_file' => :'Boolean',
291
+ :'tin_match' => :'Boolean',
292
+ :'no_tin' => :'Boolean',
293
+ :'second_tin_notice' => :'Boolean',
294
+ :'address_verification' => :'Boolean',
295
+ :'federal_efile_status' => :'StatusDetail',
296
+ :'e_delivery_status' => :'StatusDetail',
297
+ :'state_efile_status' => :'Array<StateEfileStatusDetailResponse>',
298
+ :'postal_mail_status' => :'StatusDetail',
299
+ :'tin_match_status' => :'StatusDetail',
300
+ :'address_verification_status' => :'StatusDetail',
301
+ :'validation_errors' => :'Array<ValidationErrorResponse>'
302
+ }
303
+ end
304
+
305
+ # List of attributes with nullable: true
306
+ def self.openapi_nullable
307
+ Set.new([
308
+ :'gross_distribution',
309
+ :'taxable_amount',
310
+ :'taxable_amount_not_determined',
311
+ :'total_distribution_determined',
312
+ :'capital_gain',
313
+ :'federal_income_tax_withheld',
314
+ :'employee_contributions_or_designated_roth_or_insurance_premiums',
315
+ :'net_unrealized_appreciation_in_employer_securities',
316
+ :'distribution_code',
317
+ :'second_distribution_code',
318
+ :'ira_sep_simple',
319
+ :'traditional_ira_sep_simple_or_roth_conversion_amount',
320
+ :'other_amount',
321
+ :'other_percentage',
322
+ :'total_distribution_percentage',
323
+ :'total_employee_contributions',
324
+ :'amount_allocable_to_irr_within5_years',
325
+ :'first_year_of_designated_roth_contribution',
326
+ :'fatca_filing_requirement',
327
+ :'date_of_payment',
328
+ :'federal_efile_status',
329
+ :'e_delivery_status',
330
+ :'state_efile_status',
331
+ :'postal_mail_status',
332
+ :'tin_match_status',
333
+ :'address_verification_status',
334
+ :'validation_errors'
335
+ ])
336
+ end
337
+
338
+ # List of class defined in allOf (OpenAPI v3)
339
+ def self.openapi_all_of
340
+ [
341
+ :'FormResponseBase'
342
+ ]
343
+ end
344
+
345
+ # Initializes the object
346
+ # @param [Hash] attributes Model attributes in the form of hash
347
+ def initialize(attributes = {})
348
+ if (!attributes.is_a?(Hash))
349
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::Form1099RResponse` initialize method"
350
+ end
351
+
352
+ # check to see if the attribute exists and convert string to symbol for hash key
353
+ attributes = attributes.each_with_object({}) { |(k, v), h|
354
+ if (!self.class.attribute_map.key?(k.to_sym))
355
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::Form1099RResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
356
+ end
357
+ h[k.to_sym] = v
358
+ }
359
+
360
+ if attributes.key?(:'gross_distribution')
361
+ self.gross_distribution = attributes[:'gross_distribution']
362
+ end
363
+
364
+ if attributes.key?(:'taxable_amount')
365
+ self.taxable_amount = attributes[:'taxable_amount']
366
+ end
367
+
368
+ if attributes.key?(:'taxable_amount_not_determined')
369
+ self.taxable_amount_not_determined = attributes[:'taxable_amount_not_determined']
370
+ end
371
+
372
+ if attributes.key?(:'total_distribution_determined')
373
+ self.total_distribution_determined = attributes[:'total_distribution_determined']
374
+ end
375
+
376
+ if attributes.key?(:'capital_gain')
377
+ self.capital_gain = attributes[:'capital_gain']
378
+ end
379
+
380
+ if attributes.key?(:'federal_income_tax_withheld')
381
+ self.federal_income_tax_withheld = attributes[:'federal_income_tax_withheld']
382
+ end
383
+
384
+ if attributes.key?(:'employee_contributions_or_designated_roth_or_insurance_premiums')
385
+ self.employee_contributions_or_designated_roth_or_insurance_premiums = attributes[:'employee_contributions_or_designated_roth_or_insurance_premiums']
386
+ end
387
+
388
+ if attributes.key?(:'net_unrealized_appreciation_in_employer_securities')
389
+ self.net_unrealized_appreciation_in_employer_securities = attributes[:'net_unrealized_appreciation_in_employer_securities']
390
+ end
391
+
392
+ if attributes.key?(:'distribution_code')
393
+ self.distribution_code = attributes[:'distribution_code']
394
+ end
395
+
396
+ if attributes.key?(:'second_distribution_code')
397
+ self.second_distribution_code = attributes[:'second_distribution_code']
398
+ end
399
+
400
+ if attributes.key?(:'ira_sep_simple')
401
+ self.ira_sep_simple = attributes[:'ira_sep_simple']
402
+ end
403
+
404
+ if attributes.key?(:'traditional_ira_sep_simple_or_roth_conversion_amount')
405
+ self.traditional_ira_sep_simple_or_roth_conversion_amount = attributes[:'traditional_ira_sep_simple_or_roth_conversion_amount']
406
+ end
407
+
408
+ if attributes.key?(:'other_amount')
409
+ self.other_amount = attributes[:'other_amount']
410
+ end
411
+
412
+ if attributes.key?(:'other_percentage')
413
+ self.other_percentage = attributes[:'other_percentage']
414
+ end
415
+
416
+ if attributes.key?(:'total_distribution_percentage')
417
+ self.total_distribution_percentage = attributes[:'total_distribution_percentage']
418
+ end
419
+
420
+ if attributes.key?(:'total_employee_contributions')
421
+ self.total_employee_contributions = attributes[:'total_employee_contributions']
422
+ end
423
+
424
+ if attributes.key?(:'amount_allocable_to_irr_within5_years')
425
+ self.amount_allocable_to_irr_within5_years = attributes[:'amount_allocable_to_irr_within5_years']
426
+ end
427
+
428
+ if attributes.key?(:'first_year_of_designated_roth_contribution')
429
+ self.first_year_of_designated_roth_contribution = attributes[:'first_year_of_designated_roth_contribution']
430
+ end
431
+
432
+ if attributes.key?(:'fatca_filing_requirement')
433
+ self.fatca_filing_requirement = attributes[:'fatca_filing_requirement']
434
+ end
435
+
436
+ if attributes.key?(:'date_of_payment')
437
+ self.date_of_payment = attributes[:'date_of_payment']
438
+ end
439
+
440
+ if attributes.key?(:'type')
441
+ self.type = attributes[:'type']
442
+ end
443
+
444
+ if attributes.key?(:'created_at')
445
+ self.created_at = attributes[:'created_at']
446
+ end
447
+
448
+ if attributes.key?(:'updated_at')
449
+ self.updated_at = attributes[:'updated_at']
450
+ end
451
+
452
+ if attributes.key?(:'state_and_local_withholding')
453
+ self.state_and_local_withholding = attributes[:'state_and_local_withholding']
454
+ end
455
+
456
+ if attributes.key?(:'tin_type')
457
+ self.tin_type = attributes[:'tin_type']
458
+ end
459
+
460
+ if attributes.key?(:'id')
461
+ self.id = attributes[:'id']
462
+ end
463
+
464
+ if attributes.key?(:'issuer_id')
465
+ self.issuer_id = attributes[:'issuer_id']
466
+ end
467
+
468
+ if attributes.key?(:'issuer_reference_id')
469
+ self.issuer_reference_id = attributes[:'issuer_reference_id']
470
+ end
471
+
472
+ if attributes.key?(:'issuer_tin')
473
+ self.issuer_tin = attributes[:'issuer_tin']
474
+ end
475
+
476
+ if attributes.key?(:'tax_year')
477
+ self.tax_year = attributes[:'tax_year']
478
+ end
479
+
480
+ if attributes.key?(:'reference_id')
481
+ self.reference_id = attributes[:'reference_id']
482
+ end
483
+
484
+ if attributes.key?(:'recipient_name')
485
+ self.recipient_name = attributes[:'recipient_name']
486
+ end
487
+
488
+ if attributes.key?(:'recipient_tin')
489
+ self.recipient_tin = attributes[:'recipient_tin']
490
+ end
491
+
492
+ if attributes.key?(:'recipient_second_name')
493
+ self.recipient_second_name = attributes[:'recipient_second_name']
494
+ end
495
+
496
+ if attributes.key?(:'address')
497
+ self.address = attributes[:'address']
498
+ end
499
+
500
+ if attributes.key?(:'address2')
501
+ self.address2 = attributes[:'address2']
502
+ end
503
+
504
+ if attributes.key?(:'city')
505
+ self.city = attributes[:'city']
506
+ end
507
+
508
+ if attributes.key?(:'state')
509
+ self.state = attributes[:'state']
510
+ end
511
+
512
+ if attributes.key?(:'zip')
513
+ self.zip = attributes[:'zip']
514
+ end
515
+
516
+ if attributes.key?(:'email')
517
+ self.email = attributes[:'email']
518
+ end
519
+
520
+ if attributes.key?(:'account_number')
521
+ self.account_number = attributes[:'account_number']
522
+ end
523
+
524
+ if attributes.key?(:'office_code')
525
+ self.office_code = attributes[:'office_code']
526
+ end
527
+
528
+ if attributes.key?(:'non_us_province')
529
+ self.non_us_province = attributes[:'non_us_province']
530
+ end
531
+
532
+ if attributes.key?(:'country_code')
533
+ self.country_code = attributes[:'country_code']
534
+ end
535
+
536
+ if attributes.key?(:'federal_e_file')
537
+ self.federal_e_file = attributes[:'federal_e_file']
538
+ end
539
+
540
+ if attributes.key?(:'postal_mail')
541
+ self.postal_mail = attributes[:'postal_mail']
542
+ end
543
+
544
+ if attributes.key?(:'state_e_file')
545
+ self.state_e_file = attributes[:'state_e_file']
546
+ end
547
+
548
+ if attributes.key?(:'tin_match')
549
+ self.tin_match = attributes[:'tin_match']
550
+ end
551
+
552
+ if attributes.key?(:'no_tin')
553
+ self.no_tin = attributes[:'no_tin']
554
+ end
555
+
556
+ if attributes.key?(:'second_tin_notice')
557
+ self.second_tin_notice = attributes[:'second_tin_notice']
558
+ end
559
+
560
+ if attributes.key?(:'address_verification')
561
+ self.address_verification = attributes[:'address_verification']
562
+ end
563
+
564
+ if attributes.key?(:'federal_efile_status')
565
+ self.federal_efile_status = attributes[:'federal_efile_status']
566
+ end
567
+
568
+ if attributes.key?(:'e_delivery_status')
569
+ self.e_delivery_status = attributes[:'e_delivery_status']
570
+ end
571
+
572
+ if attributes.key?(:'state_efile_status')
573
+ if (value = attributes[:'state_efile_status']).is_a?(Array)
574
+ self.state_efile_status = value
575
+ end
576
+ end
577
+
578
+ if attributes.key?(:'postal_mail_status')
579
+ self.postal_mail_status = attributes[:'postal_mail_status']
580
+ end
581
+
582
+ if attributes.key?(:'tin_match_status')
583
+ self.tin_match_status = attributes[:'tin_match_status']
584
+ end
585
+
586
+ if attributes.key?(:'address_verification_status')
587
+ self.address_verification_status = attributes[:'address_verification_status']
588
+ end
589
+
590
+ if attributes.key?(:'validation_errors')
591
+ if (value = attributes[:'validation_errors']).is_a?(Array)
592
+ self.validation_errors = value
593
+ end
594
+ end
595
+ end
596
+
597
+ # Show invalid properties with the reasons. Usually used together with valid?
598
+ # @return Array for valid properties with the reasons
599
+ def list_invalid_properties
600
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
601
+ invalid_properties = Array.new
602
+ invalid_properties
603
+ end
604
+
605
+ # Check to see if the all the properties in the model are valid
606
+ # @return true if the model is valid
607
+ def valid?
608
+ warn '[DEPRECATED] the `valid?` method is obsolete'
609
+ type_validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S", "1095-C", "1099-INT"])
610
+ return false unless type_validator.valid?(@type)
611
+ tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
612
+ return false unless tin_type_validator.valid?(@tin_type)
613
+ true
614
+ end
615
+
616
+ # Custom attribute writer method checking allowed values (enum).
617
+ # @param [Object] type Object to be assigned
618
+ def type=(type)
619
+ validator = EnumAttributeValidator.new('String', ["1099-NEC", "1099-MISC", "1099-DIV", "1099-R", "1099-K", "1095-B", "1042-S", "1095-C", "1099-INT"])
620
+ unless validator.valid?(type)
621
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
622
+ end
623
+ @type = type
624
+ end
625
+
626
+ # Custom attribute writer method checking allowed values (enum).
627
+ # @param [Object] tin_type Object to be assigned
628
+ def tin_type=(tin_type)
629
+ validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
630
+ unless validator.valid?(tin_type)
631
+ fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}."
632
+ end
633
+ @tin_type = tin_type
634
+ end
635
+
636
+ # Custom attribute writer method with validation
637
+ # @param [Object] state_efile_status Value to be assigned
638
+ def state_efile_status=(state_efile_status)
639
+ @state_efile_status = state_efile_status
640
+ end
641
+
642
+ # Custom attribute writer method with validation
643
+ # @param [Object] validation_errors Value to be assigned
644
+ def validation_errors=(validation_errors)
645
+ @validation_errors = validation_errors
646
+ end
647
+
648
+ # Checks equality by comparing each attribute.
649
+ # @param [Object] Object to be compared
650
+ def ==(o)
651
+ return true if self.equal?(o)
652
+ self.class == o.class &&
653
+ gross_distribution == o.gross_distribution &&
654
+ taxable_amount == o.taxable_amount &&
655
+ taxable_amount_not_determined == o.taxable_amount_not_determined &&
656
+ total_distribution_determined == o.total_distribution_determined &&
657
+ capital_gain == o.capital_gain &&
658
+ federal_income_tax_withheld == o.federal_income_tax_withheld &&
659
+ employee_contributions_or_designated_roth_or_insurance_premiums == o.employee_contributions_or_designated_roth_or_insurance_premiums &&
660
+ net_unrealized_appreciation_in_employer_securities == o.net_unrealized_appreciation_in_employer_securities &&
661
+ distribution_code == o.distribution_code &&
662
+ second_distribution_code == o.second_distribution_code &&
663
+ ira_sep_simple == o.ira_sep_simple &&
664
+ traditional_ira_sep_simple_or_roth_conversion_amount == o.traditional_ira_sep_simple_or_roth_conversion_amount &&
665
+ other_amount == o.other_amount &&
666
+ other_percentage == o.other_percentage &&
667
+ total_distribution_percentage == o.total_distribution_percentage &&
668
+ total_employee_contributions == o.total_employee_contributions &&
669
+ amount_allocable_to_irr_within5_years == o.amount_allocable_to_irr_within5_years &&
670
+ first_year_of_designated_roth_contribution == o.first_year_of_designated_roth_contribution &&
671
+ fatca_filing_requirement == o.fatca_filing_requirement &&
672
+ date_of_payment == o.date_of_payment &&
673
+ type == o.type &&
674
+ created_at == o.created_at &&
675
+ updated_at == o.updated_at &&
676
+ state_and_local_withholding == o.state_and_local_withholding &&
677
+ tin_type == o.tin_type &&
678
+ id == o.id &&
679
+ issuer_id == o.issuer_id &&
680
+ issuer_reference_id == o.issuer_reference_id &&
681
+ issuer_tin == o.issuer_tin &&
682
+ tax_year == o.tax_year &&
683
+ reference_id == o.reference_id &&
684
+ recipient_name == o.recipient_name &&
685
+ recipient_tin == o.recipient_tin &&
686
+ recipient_second_name == o.recipient_second_name &&
687
+ address == o.address &&
688
+ address2 == o.address2 &&
689
+ city == o.city &&
690
+ state == o.state &&
691
+ zip == o.zip &&
692
+ email == o.email &&
693
+ account_number == o.account_number &&
694
+ office_code == o.office_code &&
695
+ non_us_province == o.non_us_province &&
696
+ country_code == o.country_code &&
697
+ federal_e_file == o.federal_e_file &&
698
+ postal_mail == o.postal_mail &&
699
+ state_e_file == o.state_e_file &&
700
+ tin_match == o.tin_match &&
701
+ no_tin == o.no_tin &&
702
+ second_tin_notice == o.second_tin_notice &&
703
+ address_verification == o.address_verification &&
704
+ federal_efile_status == o.federal_efile_status &&
705
+ e_delivery_status == o.e_delivery_status &&
706
+ state_efile_status == o.state_efile_status &&
707
+ postal_mail_status == o.postal_mail_status &&
708
+ tin_match_status == o.tin_match_status &&
709
+ address_verification_status == o.address_verification_status &&
710
+ validation_errors == o.validation_errors
711
+ end
712
+
713
+ # @see the `==` method
714
+ # @param [Object] Object to be compared
715
+ def eql?(o)
716
+ self == o
717
+ end
718
+
719
+ # Calculates hash code according to all attributes.
720
+ # @return [Integer] Hash code
721
+ def hash
722
+ [gross_distribution, taxable_amount, taxable_amount_not_determined, total_distribution_determined, capital_gain, federal_income_tax_withheld, employee_contributions_or_designated_roth_or_insurance_premiums, net_unrealized_appreciation_in_employer_securities, distribution_code, second_distribution_code, ira_sep_simple, traditional_ira_sep_simple_or_roth_conversion_amount, other_amount, other_percentage, total_distribution_percentage, total_employee_contributions, amount_allocable_to_irr_within5_years, first_year_of_designated_roth_contribution, fatca_filing_requirement, date_of_payment, type, created_at, updated_at, state_and_local_withholding, tin_type, id, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, recipient_second_name, address, address2, city, state, zip, email, account_number, office_code, non_us_province, country_code, federal_e_file, postal_mail, state_e_file, tin_match, no_tin, second_tin_notice, address_verification, federal_efile_status, e_delivery_status, state_efile_status, postal_mail_status, tin_match_status, address_verification_status, validation_errors].hash
723
+ end
724
+
725
+ # Builds the object from hash
726
+ # @param [Hash] attributes Model attributes in the form of hash
727
+ # @return [Object] Returns the model itself
728
+ def self.build_from_hash(attributes)
729
+ return nil unless attributes.is_a?(Hash)
730
+ attributes = attributes.transform_keys(&:to_sym)
731
+ transformed_hash = {}
732
+ openapi_types.each_pair do |key, type|
733
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
734
+ transformed_hash["#{key}"] = nil
735
+ elsif type =~ /\AArray<(.*)>/i
736
+ # check to ensure the input is an array given that the attribute
737
+ # is documented as an array but the input is not
738
+ if attributes[attribute_map[key]].is_a?(Array)
739
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
740
+ end
741
+ elsif !attributes[attribute_map[key]].nil?
742
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
743
+ end
744
+ end
745
+ new(transformed_hash)
746
+ end
747
+
748
+ # Deserializes the data based on type
749
+ # @param string type Data type
750
+ # @param string value Value to be deserialized
751
+ # @return [Object] Deserialized data
752
+ def self._deserialize(type, value)
753
+ case type.to_sym
754
+ when :Time
755
+ Time.parse(value)
756
+ when :Date
757
+ Date.parse(value)
758
+ when :String
759
+ value.to_s
760
+ when :Integer
761
+ value.to_i
762
+ when :Float
763
+ value.to_f
764
+ when :Boolean
765
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
766
+ true
767
+ else
768
+ false
769
+ end
770
+ when :Object
771
+ # generic object (usually a Hash), return directly
772
+ value
773
+ when /\AArray<(?<inner_type>.+)>\z/
774
+ inner_type = Regexp.last_match[:inner_type]
775
+ value.map { |v| _deserialize(inner_type, v) }
776
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
777
+ k_type = Regexp.last_match[:k_type]
778
+ v_type = Regexp.last_match[:v_type]
779
+ {}.tap do |hash|
780
+ value.each do |k, v|
781
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
782
+ end
783
+ end
784
+ else # model
785
+ # models (e.g. Pet) or oneOf
786
+ klass = AvalaraSdk::A1099::V2.const_get(type)
787
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
788
+ end
789
+ end
790
+
791
+ # Returns the string representation of the object
792
+ # @return [String] String presentation of the object
793
+ def to_s
794
+ to_hash.to_s
795
+ end
796
+
797
+ # to_body is an alias to to_hash (backward compatibility)
798
+ # @return [Hash] Returns the object in the form of hash
799
+ def to_body
800
+ to_hash
801
+ end
802
+
803
+ # Returns the object in the form of hash
804
+ # @return [Hash] Returns the object in the form of hash
805
+ def to_hash
806
+ hash = {}
807
+ self.class.attribute_map.each_pair do |attr, param|
808
+ value = self.send(attr)
809
+ if value.nil?
810
+ is_nullable = self.class.openapi_nullable.include?(attr)
811
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
812
+ end
813
+
814
+ hash[param] = _to_hash(value)
815
+ end
816
+ hash
817
+ end
818
+
819
+ # Outputs non-array value in the form of hash
820
+ # For object, use to_hash. Otherwise, just return the value
821
+ # @param [Object] value Any valid value
822
+ # @return [Hash] Returns the value in the form of hash
823
+ def _to_hash(value)
824
+ if value.is_a?(Array)
825
+ value.compact.map { |v| _to_hash(v) }
826
+ elsif value.is_a?(Hash)
827
+ {}.tap do |hash|
828
+ value.each { |k, v| hash[k] = _to_hash(v) }
829
+ end
830
+ elsif value.respond_to? :to_hash
831
+ value.to_hash
832
+ else
833
+ value
834
+ end
835
+ end
836
+
837
+ end
838
+
839
+ end