avalara_sdk 25.6.0 → 25.7.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.
- checksums.yaml +4 -4
- data/README.md +17 -3
- data/docs/A1099/V2/BulkUpsert1099FormsRequest.md +3 -1
- data/docs/A1099/V2/CompaniesW9Api.md +45 -31
- data/docs/A1099/V2/CoveredIndividualReference.md +58 -0
- data/docs/A1099/V2/CoveredIndividualRequest.md +54 -0
- data/docs/A1099/V2/Form1095B.md +86 -0
- data/docs/A1099/V2/Form1095BList.md +20 -0
- data/docs/A1099/V2/Form1095BListItem.md +74 -0
- data/docs/A1099/V2/Form1095BRequest.md +76 -0
- data/docs/A1099/V2/Form1099Base.md +8 -8
- data/docs/A1099/V2/Form1099DivListItem.md +11 -11
- data/docs/A1099/V2/Form1099DivRequest.md +11 -17
- data/docs/A1099/V2/Form1099DivResponse.md +88 -0
- data/docs/A1099/V2/Form1099K.md +8 -8
- data/docs/A1099/V2/Form1099KListItem.md +11 -11
- data/docs/A1099/V2/Form1099KRequest.md +11 -17
- data/docs/A1099/V2/Form1099List.md +1 -1
- data/docs/A1099/V2/Form1099ListDataInner.md +32 -0
- data/docs/A1099/V2/Form1099Misc.md +8 -8
- data/docs/A1099/V2/Form1099MiscListItem.md +11 -11
- data/docs/A1099/V2/Form1099MiscRequest.md +11 -17
- data/docs/A1099/V2/Form1099MiscResponse.md +120 -0
- data/docs/A1099/V2/Form1099Nec.md +8 -8
- data/docs/A1099/V2/Form1099NecListItem.md +11 -11
- data/docs/A1099/V2/Form1099NecRequest.md +11 -17
- data/docs/A1099/V2/Form1099NecResponse.md +96 -0
- data/docs/A1099/V2/Form1099R.md +8 -8
- data/docs/A1099/V2/Form1099RListItem.md +11 -11
- data/docs/A1099/V2/Form1099RRequest.md +11 -17
- data/docs/A1099/V2/FormRequestBase.md +9 -13
- data/docs/A1099/V2/FormRequestCsvBase.md +66 -0
- data/docs/A1099/V2/FormResponseBase.md +43 -9
- data/docs/A1099/V2/FormSingleRequestBase.md +11 -15
- data/docs/A1099/V2/Forms1099Api.md +75 -57
- data/docs/A1099/V2/FormsW9Api.md +63 -123
- data/docs/A1099/V2/Get1099Form200Response.md +55 -0
- data/docs/A1099/V2/IncludedBase.md +20 -0
- data/docs/A1099/V2/Issuers1099Api.md +45 -31
- data/docs/A1099/V2/Jobs1099Api.md +10 -6
- data/docs/A1099/V2/StateAndLocalWithholdingResponse.md +32 -0
- data/docs/A1099/V2/StateEfileStatusDetail.md +1 -1
- data/docs/A1099/V2/StateEfileStatusDetailApp.md +22 -0
- data/docs/A1099/V2/StatusDetail.md +20 -0
- data/docs/A1099/V2/Update1099Form200Response.md +53 -0
- data/docs/A1099/V2/ValidationErrorApp.md +20 -0
- data/docs/EInvoicing/V1/DataInputFieldsApi.md +4 -4
- data/docs/EInvoicing/V1/DocumentsApi.md +2 -2
- data/docs/EInvoicing/V1/MandatesApi.md +4 -4
- data/docs/EInvoicing/V1/SubscriptionsApi.md +4 -4
- data/docs/EInvoicing/V1/TradingPartnersApi.md +4 -4
- data/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb +103 -43
- data/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb +171 -87
- data/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb +135 -176
- data/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb +103 -43
- data/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb +19 -7
- data/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb +6 -6
- data/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb +4 -4
- data/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb +1 -1
- data/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb +6 -6
- data/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb +6 -6
- data/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb +7 -7
- data/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb +1 -0
- data/lib/avalara_sdk/models/A1099/V2/covered_individual_reference.rb +403 -0
- data/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb +378 -0
- data/lib/avalara_sdk/models/A1099/V2/form1095_b.rb +572 -0
- data/lib/avalara_sdk/models/A1099/V2/form1095_b_list.rb +238 -0
- data/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb +538 -0
- data/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb +559 -0
- data/lib/avalara_sdk/models/A1099/V2/form1099_base.rb +29 -29
- data/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb +78 -36
- data/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb +80 -53
- data/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb +600 -0
- data/lib/avalara_sdk/models/A1099/V2/form1099_k.rb +29 -29
- data/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb +56 -37
- data/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb +80 -54
- data/lib/avalara_sdk/models/A1099/V2/form1099_list.rb +1 -1
- data/lib/avalara_sdk/models/A1099/V2/form1099_list_data_inner.rb +20 -68
- data/lib/avalara_sdk/models/A1099/V2/form1099_misc.rb +29 -29
- data/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb +78 -36
- data/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb +80 -53
- data/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb +744 -0
- data/lib/avalara_sdk/models/A1099/V2/form1099_nec.rb +29 -29
- data/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb +78 -36
- data/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb +80 -53
- data/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb +636 -0
- data/lib/avalara_sdk/models/A1099/V2/form1099_r.rb +29 -29
- data/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb +56 -36
- data/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb +80 -53
- data/lib/avalara_sdk/models/A1099/V2/form_request_base.rb +68 -44
- data/lib/avalara_sdk/models/A1099/V2/form_request_csv_base.rb +475 -0
- data/lib/avalara_sdk/models/A1099/V2/form_response_base.rb +252 -31
- data/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb +80 -44
- data/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb +104 -0
- data/lib/avalara_sdk/models/A1099/V2/included_base.rb +219 -0
- data/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb +1 -0
- data/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb +274 -0
- data/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail_app.rb +231 -0
- data/lib/avalara_sdk/models/A1099/V2/status_detail.rb +221 -0
- data/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb +103 -0
- data/lib/avalara_sdk/models/A1099/V2/validation_error_app.rb +229 -0
- data/lib/avalara_sdk/version.rb +1 -1
- data/lib/avalara_sdk.rb +17 -0
- data/spec/integration/a1099_spec.rb +12 -12
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-11.1.3/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debug-1.10.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/erb-5.0.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/prism-1.4.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/gem_make.out +5 -5
- metadata +36 -2
@@ -11,8 +11,6 @@ require 'time'
|
|
11
11
|
|
12
12
|
module AvalaraSdk::A1099::V2
|
13
13
|
class Form1099KRequest
|
14
|
-
attr_accessor :state_and_local_withholding
|
15
|
-
|
16
14
|
attr_accessor :filer_type
|
17
15
|
|
18
16
|
attr_accessor :payment_type
|
@@ -57,12 +55,6 @@ module AvalaraSdk::A1099::V2
|
|
57
55
|
|
58
56
|
attr_accessor :issuer_id
|
59
57
|
|
60
|
-
attr_accessor :issuer_reference_id
|
61
|
-
|
62
|
-
attr_accessor :issuer_tin
|
63
|
-
|
64
|
-
attr_accessor :tax_year
|
65
|
-
|
66
58
|
attr_accessor :reference_id
|
67
59
|
|
68
60
|
attr_accessor :recipient_name
|
@@ -73,9 +65,9 @@ module AvalaraSdk::A1099::V2
|
|
73
65
|
|
74
66
|
attr_accessor :recipient_second_name
|
75
67
|
|
76
|
-
attr_accessor :
|
68
|
+
attr_accessor :address
|
77
69
|
|
78
|
-
attr_accessor :
|
70
|
+
attr_accessor :address2
|
79
71
|
|
80
72
|
attr_accessor :city
|
81
73
|
|
@@ -103,10 +95,33 @@ module AvalaraSdk::A1099::V2
|
|
103
95
|
|
104
96
|
attr_accessor :address_verification
|
105
97
|
|
98
|
+
attr_accessor :state_and_local_withholding
|
99
|
+
|
100
|
+
class EnumAttributeValidator
|
101
|
+
attr_reader :datatype
|
102
|
+
attr_reader :allowable_values
|
103
|
+
|
104
|
+
def initialize(datatype, allowable_values)
|
105
|
+
@allowable_values = allowable_values.map do |value|
|
106
|
+
case datatype.to_s
|
107
|
+
when /Integer/i
|
108
|
+
value.to_i
|
109
|
+
when /Float/i
|
110
|
+
value.to_f
|
111
|
+
else
|
112
|
+
value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def valid?(value)
|
118
|
+
!value || allowable_values.include?(value)
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
106
122
|
# Attribute mapping from ruby-style variable name to JSON key.
|
107
123
|
def self.attribute_map
|
108
124
|
{
|
109
|
-
:'state_and_local_withholding' => :'stateAndLocalWithholding',
|
110
125
|
:'filer_type' => :'filerType',
|
111
126
|
:'payment_type' => :'paymentType',
|
112
127
|
:'payment_settlement_entity_name_phone_number' => :'paymentSettlementEntityNamePhoneNumber',
|
@@ -129,16 +144,13 @@ module AvalaraSdk::A1099::V2
|
|
129
144
|
:'december' => :'december',
|
130
145
|
:'type' => :'type',
|
131
146
|
:'issuer_id' => :'issuerId',
|
132
|
-
:'issuer_reference_id' => :'issuerReferenceId',
|
133
|
-
:'issuer_tin' => :'issuerTin',
|
134
|
-
:'tax_year' => :'taxYear',
|
135
147
|
:'reference_id' => :'referenceId',
|
136
148
|
:'recipient_name' => :'recipientName',
|
137
149
|
:'recipient_tin' => :'recipientTin',
|
138
150
|
:'tin_type' => :'tinType',
|
139
151
|
:'recipient_second_name' => :'recipientSecondName',
|
140
|
-
:'
|
141
|
-
:'
|
152
|
+
:'address' => :'address',
|
153
|
+
:'address2' => :'address2',
|
142
154
|
:'city' => :'city',
|
143
155
|
:'state' => :'state',
|
144
156
|
:'zip' => :'zip',
|
@@ -151,7 +163,8 @@ module AvalaraSdk::A1099::V2
|
|
151
163
|
:'postal_mail' => :'postalMail',
|
152
164
|
:'state_e_file' => :'stateEFile',
|
153
165
|
:'tin_match' => :'tinMatch',
|
154
|
-
:'address_verification' => :'addressVerification'
|
166
|
+
:'address_verification' => :'addressVerification',
|
167
|
+
:'state_and_local_withholding' => :'stateAndLocalWithholding'
|
155
168
|
}
|
156
169
|
end
|
157
170
|
|
@@ -163,7 +176,6 @@ module AvalaraSdk::A1099::V2
|
|
163
176
|
# Attribute type mapping.
|
164
177
|
def self.openapi_types
|
165
178
|
{
|
166
|
-
:'state_and_local_withholding' => :'StateAndLocalWithholding',
|
167
179
|
:'filer_type' => :'Integer',
|
168
180
|
:'payment_type' => :'Integer',
|
169
181
|
:'payment_settlement_entity_name_phone_number' => :'String',
|
@@ -186,16 +198,13 @@ module AvalaraSdk::A1099::V2
|
|
186
198
|
:'december' => :'Float',
|
187
199
|
:'type' => :'String',
|
188
200
|
:'issuer_id' => :'String',
|
189
|
-
:'issuer_reference_id' => :'String',
|
190
|
-
:'issuer_tin' => :'String',
|
191
|
-
:'tax_year' => :'Integer',
|
192
201
|
:'reference_id' => :'String',
|
193
202
|
:'recipient_name' => :'String',
|
194
203
|
:'recipient_tin' => :'String',
|
195
|
-
:'tin_type' => :'
|
204
|
+
:'tin_type' => :'String',
|
196
205
|
:'recipient_second_name' => :'String',
|
197
|
-
:'
|
198
|
-
:'
|
206
|
+
:'address' => :'String',
|
207
|
+
:'address2' => :'String',
|
199
208
|
:'city' => :'String',
|
200
209
|
:'state' => :'String',
|
201
210
|
:'zip' => :'String',
|
@@ -208,14 +217,14 @@ module AvalaraSdk::A1099::V2
|
|
208
217
|
:'postal_mail' => :'Boolean',
|
209
218
|
:'state_e_file' => :'Boolean',
|
210
219
|
:'tin_match' => :'Boolean',
|
211
|
-
:'address_verification' => :'Boolean'
|
220
|
+
:'address_verification' => :'Boolean',
|
221
|
+
:'state_and_local_withholding' => :'StateAndLocalWithholdingRequest'
|
212
222
|
}
|
213
223
|
end
|
214
224
|
|
215
225
|
# List of attributes with nullable: true
|
216
226
|
def self.openapi_nullable
|
217
227
|
Set.new([
|
218
|
-
:'state_and_local_withholding',
|
219
228
|
:'payment_settlement_entity_name_phone_number',
|
220
229
|
:'card_not_present_transactions',
|
221
230
|
:'merchant_category_code',
|
@@ -232,6 +241,14 @@ module AvalaraSdk::A1099::V2
|
|
232
241
|
:'october',
|
233
242
|
:'november',
|
234
243
|
:'december',
|
244
|
+
:'issuer_id',
|
245
|
+
:'reference_id',
|
246
|
+
:'recipient_name',
|
247
|
+
:'address2',
|
248
|
+
:'recipient_email',
|
249
|
+
:'account_number',
|
250
|
+
:'office_code',
|
251
|
+
:'recipient_non_us_province',
|
235
252
|
])
|
236
253
|
end
|
237
254
|
|
@@ -257,10 +274,6 @@ module AvalaraSdk::A1099::V2
|
|
257
274
|
h[k.to_sym] = v
|
258
275
|
}
|
259
276
|
|
260
|
-
if attributes.key?(:'state_and_local_withholding')
|
261
|
-
self.state_and_local_withholding = attributes[:'state_and_local_withholding']
|
262
|
-
end
|
263
|
-
|
264
277
|
if attributes.key?(:'filer_type')
|
265
278
|
self.filer_type = attributes[:'filer_type']
|
266
279
|
end
|
@@ -349,18 +362,6 @@ module AvalaraSdk::A1099::V2
|
|
349
362
|
self.issuer_id = attributes[:'issuer_id']
|
350
363
|
end
|
351
364
|
|
352
|
-
if attributes.key?(:'issuer_reference_id')
|
353
|
-
self.issuer_reference_id = attributes[:'issuer_reference_id']
|
354
|
-
end
|
355
|
-
|
356
|
-
if attributes.key?(:'issuer_tin')
|
357
|
-
self.issuer_tin = attributes[:'issuer_tin']
|
358
|
-
end
|
359
|
-
|
360
|
-
if attributes.key?(:'tax_year')
|
361
|
-
self.tax_year = attributes[:'tax_year']
|
362
|
-
end
|
363
|
-
|
364
365
|
if attributes.key?(:'reference_id')
|
365
366
|
self.reference_id = attributes[:'reference_id']
|
366
367
|
end
|
@@ -381,12 +382,12 @@ module AvalaraSdk::A1099::V2
|
|
381
382
|
self.recipient_second_name = attributes[:'recipient_second_name']
|
382
383
|
end
|
383
384
|
|
384
|
-
if attributes.key?(:'
|
385
|
-
self.
|
385
|
+
if attributes.key?(:'address')
|
386
|
+
self.address = attributes[:'address']
|
386
387
|
end
|
387
388
|
|
388
|
-
if attributes.key?(:'
|
389
|
-
self.
|
389
|
+
if attributes.key?(:'address2')
|
390
|
+
self.address2 = attributes[:'address2']
|
390
391
|
end
|
391
392
|
|
392
393
|
if attributes.key?(:'city')
|
@@ -440,6 +441,10 @@ module AvalaraSdk::A1099::V2
|
|
440
441
|
if attributes.key?(:'address_verification')
|
441
442
|
self.address_verification = attributes[:'address_verification']
|
442
443
|
end
|
444
|
+
|
445
|
+
if attributes.key?(:'state_and_local_withholding')
|
446
|
+
self.state_and_local_withholding = attributes[:'state_and_local_withholding']
|
447
|
+
end
|
443
448
|
end
|
444
449
|
|
445
450
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -454,15 +459,38 @@ module AvalaraSdk::A1099::V2
|
|
454
459
|
# @return true if the model is valid
|
455
460
|
def valid?
|
456
461
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
462
|
+
type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"])
|
463
|
+
return false unless type_validator.valid?(@type)
|
464
|
+
tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
|
465
|
+
return false unless tin_type_validator.valid?(@tin_type)
|
457
466
|
true
|
458
467
|
end
|
459
468
|
|
469
|
+
# Custom attribute writer method checking allowed values (enum).
|
470
|
+
# @param [Object] type Object to be assigned
|
471
|
+
def type=(type)
|
472
|
+
validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"])
|
473
|
+
unless validator.valid?(type)
|
474
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
475
|
+
end
|
476
|
+
@type = type
|
477
|
+
end
|
478
|
+
|
479
|
+
# Custom attribute writer method checking allowed values (enum).
|
480
|
+
# @param [Object] tin_type Object to be assigned
|
481
|
+
def tin_type=(tin_type)
|
482
|
+
validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
|
483
|
+
unless validator.valid?(tin_type)
|
484
|
+
fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}."
|
485
|
+
end
|
486
|
+
@tin_type = tin_type
|
487
|
+
end
|
488
|
+
|
460
489
|
# Checks equality by comparing each attribute.
|
461
490
|
# @param [Object] Object to be compared
|
462
491
|
def ==(o)
|
463
492
|
return true if self.equal?(o)
|
464
493
|
self.class == o.class &&
|
465
|
-
state_and_local_withholding == o.state_and_local_withholding &&
|
466
494
|
filer_type == o.filer_type &&
|
467
495
|
payment_type == o.payment_type &&
|
468
496
|
payment_settlement_entity_name_phone_number == o.payment_settlement_entity_name_phone_number &&
|
@@ -485,16 +513,13 @@ module AvalaraSdk::A1099::V2
|
|
485
513
|
december == o.december &&
|
486
514
|
type == o.type &&
|
487
515
|
issuer_id == o.issuer_id &&
|
488
|
-
issuer_reference_id == o.issuer_reference_id &&
|
489
|
-
issuer_tin == o.issuer_tin &&
|
490
|
-
tax_year == o.tax_year &&
|
491
516
|
reference_id == o.reference_id &&
|
492
517
|
recipient_name == o.recipient_name &&
|
493
518
|
recipient_tin == o.recipient_tin &&
|
494
519
|
tin_type == o.tin_type &&
|
495
520
|
recipient_second_name == o.recipient_second_name &&
|
496
|
-
|
497
|
-
|
521
|
+
address == o.address &&
|
522
|
+
address2 == o.address2 &&
|
498
523
|
city == o.city &&
|
499
524
|
state == o.state &&
|
500
525
|
zip == o.zip &&
|
@@ -507,7 +532,8 @@ module AvalaraSdk::A1099::V2
|
|
507
532
|
postal_mail == o.postal_mail &&
|
508
533
|
state_e_file == o.state_e_file &&
|
509
534
|
tin_match == o.tin_match &&
|
510
|
-
address_verification == o.address_verification
|
535
|
+
address_verification == o.address_verification &&
|
536
|
+
state_and_local_withholding == o.state_and_local_withholding
|
511
537
|
end
|
512
538
|
|
513
539
|
# @see the `==` method
|
@@ -519,7 +545,7 @@ module AvalaraSdk::A1099::V2
|
|
519
545
|
# Calculates hash code according to all attributes.
|
520
546
|
# @return [Integer] Hash code
|
521
547
|
def hash
|
522
|
-
[
|
548
|
+
[filer_type, payment_type, payment_settlement_entity_name_phone_number, gross_amount_payment_card, card_not_present_transactions, merchant_category_code, payment_transaction_number, federal_income_tax_withheld, january, february, march, april, may, june, july, august, sept, october, november, december, type, issuer_id, reference_id, recipient_name, recipient_tin, 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
|
523
549
|
end
|
524
550
|
|
525
551
|
# Builds the object from hash
|
@@ -22,80 +22,32 @@ module AvalaraSdk::A1099::V2
|
|
22
22
|
]
|
23
23
|
end
|
24
24
|
|
25
|
+
# Discriminator's property name (OpenAPI v3)
|
26
|
+
def openapi_discriminator_name
|
27
|
+
:'type'
|
28
|
+
end
|
29
|
+
|
30
|
+
# Discriminator's mapping (OpenAPI v3)
|
31
|
+
def openapi_discriminator_mapping
|
32
|
+
{
|
33
|
+
:'1099-K' => :'Form1099K',
|
34
|
+
:'1099-MISC' => :'Form1099Misc',
|
35
|
+
:'1099-NEC' => :'Form1099Nec',
|
36
|
+
:'1099-R' => :'Form1099R'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
25
40
|
# Builds the object
|
26
41
|
# @param [Mixed] Data to be matched against the list of oneOf items
|
27
42
|
# @return [Object] Returns the model or the data itself
|
28
43
|
def build(data)
|
29
|
-
|
30
|
-
|
31
|
-
# - We do not attempt to check whether exactly one item matches.
|
32
|
-
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
33
|
-
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
34
|
-
# - TODO: scalar values are de facto behaving as if they were nullable.
|
35
|
-
# - TODO: logging when debugging is set.
|
36
|
-
openapi_one_of.each do |klass|
|
37
|
-
begin
|
38
|
-
next if klass == :AnyType # "nullable: true"
|
39
|
-
typed_data = find_and_cast_into_type(klass, data)
|
40
|
-
return typed_data if typed_data
|
41
|
-
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
openapi_one_of.include?(:AnyType) ? data : nil
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
SchemaMismatchError = Class.new(StandardError)
|
51
|
-
|
52
|
-
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
53
|
-
def find_and_cast_into_type(klass, data)
|
54
|
-
return if data.nil?
|
44
|
+
discriminator_value = data[openapi_discriminator_name]
|
45
|
+
return nil if discriminator_value.nil?
|
55
46
|
|
56
|
-
|
57
|
-
|
58
|
-
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
59
|
-
when 'Float'
|
60
|
-
return data if data.instance_of?(Float)
|
61
|
-
when 'Integer'
|
62
|
-
return data if data.instance_of?(Integer)
|
63
|
-
when 'Time'
|
64
|
-
return Time.parse(data)
|
65
|
-
when 'Date'
|
66
|
-
return Date.parse(data)
|
67
|
-
when 'String'
|
68
|
-
return data if data.instance_of?(String)
|
69
|
-
when 'Object' # "type: object"
|
70
|
-
return data if data.instance_of?(Hash)
|
71
|
-
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
72
|
-
if data.instance_of?(Array)
|
73
|
-
sub_type = Regexp.last_match[:sub_type]
|
74
|
-
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
75
|
-
end
|
76
|
-
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
77
|
-
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
78
|
-
sub_type = Regexp.last_match[:sub_type]
|
79
|
-
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
80
|
-
end
|
81
|
-
else # model
|
82
|
-
const = AvalaraSdk::A1099::V2.const_get(klass)
|
83
|
-
if const
|
84
|
-
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
85
|
-
model = const.build(data)
|
86
|
-
return model if model
|
87
|
-
else
|
88
|
-
# raise if data contains keys that are not known to the model
|
89
|
-
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
90
|
-
model = const.build_from_hash(data)
|
91
|
-
return model if model
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
47
|
+
klass = openapi_discriminator_mapping[discriminator_value.to_s.to_sym]
|
48
|
+
return nil unless klass
|
95
49
|
|
96
|
-
|
97
|
-
rescue
|
98
|
-
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
50
|
+
AvalaraSdk::A1099::V2.const_get(klass).build_from_hash(data)
|
99
51
|
end
|
100
52
|
end
|
101
53
|
end
|
@@ -75,17 +75,17 @@ module AvalaraSdk::A1099::V2
|
|
75
75
|
|
76
76
|
attr_accessor :email
|
77
77
|
|
78
|
-
attr_accessor :
|
78
|
+
attr_accessor :tin_type
|
79
79
|
|
80
80
|
attr_accessor :tin
|
81
81
|
|
82
|
-
attr_accessor :
|
82
|
+
attr_accessor :recipient_name
|
83
83
|
|
84
|
-
attr_accessor :
|
84
|
+
attr_accessor :recipient_second_name
|
85
85
|
|
86
86
|
attr_accessor :address
|
87
87
|
|
88
|
-
attr_accessor :
|
88
|
+
attr_accessor :address2
|
89
89
|
|
90
90
|
attr_accessor :city
|
91
91
|
|
@@ -140,12 +140,12 @@ module AvalaraSdk::A1099::V2
|
|
140
140
|
:'address_verification_status' => :'addressVerificationStatus',
|
141
141
|
:'reference_id' => :'referenceId',
|
142
142
|
:'email' => :'email',
|
143
|
-
:'
|
143
|
+
:'tin_type' => :'tinType',
|
144
144
|
:'tin' => :'tin',
|
145
|
-
:'
|
146
|
-
:'
|
145
|
+
:'recipient_name' => :'recipientName',
|
146
|
+
:'recipient_second_name' => :'recipientSecondName',
|
147
147
|
:'address' => :'address',
|
148
|
-
:'
|
148
|
+
:'address2' => :'address2',
|
149
149
|
:'city' => :'city',
|
150
150
|
:'state' => :'state',
|
151
151
|
:'zip' => :'zip',
|
@@ -198,12 +198,12 @@ module AvalaraSdk::A1099::V2
|
|
198
198
|
:'address_verification_status' => :'Form1099StatusDetail',
|
199
199
|
:'reference_id' => :'String',
|
200
200
|
:'email' => :'String',
|
201
|
-
:'
|
201
|
+
:'tin_type' => :'String',
|
202
202
|
:'tin' => :'String',
|
203
|
-
:'
|
204
|
-
:'
|
203
|
+
:'recipient_name' => :'String',
|
204
|
+
:'recipient_second_name' => :'String',
|
205
205
|
:'address' => :'String',
|
206
|
-
:'
|
206
|
+
:'address2' => :'String',
|
207
207
|
:'city' => :'String',
|
208
208
|
:'state' => :'String',
|
209
209
|
:'zip' => :'String',
|
@@ -240,12 +240,12 @@ module AvalaraSdk::A1099::V2
|
|
240
240
|
:'address_verification_status',
|
241
241
|
:'reference_id',
|
242
242
|
:'email',
|
243
|
-
:'
|
243
|
+
:'tin_type',
|
244
244
|
:'tin',
|
245
|
-
:'
|
246
|
-
:'
|
245
|
+
:'recipient_name',
|
246
|
+
:'recipient_second_name',
|
247
247
|
:'address',
|
248
|
-
:'
|
248
|
+
:'address2',
|
249
249
|
:'city',
|
250
250
|
:'state',
|
251
251
|
:'zip',
|
@@ -408,28 +408,28 @@ module AvalaraSdk::A1099::V2
|
|
408
408
|
self.email = attributes[:'email']
|
409
409
|
end
|
410
410
|
|
411
|
-
if attributes.key?(:'
|
412
|
-
self.
|
411
|
+
if attributes.key?(:'tin_type')
|
412
|
+
self.tin_type = attributes[:'tin_type']
|
413
413
|
end
|
414
414
|
|
415
415
|
if attributes.key?(:'tin')
|
416
416
|
self.tin = attributes[:'tin']
|
417
417
|
end
|
418
418
|
|
419
|
-
if attributes.key?(:'
|
420
|
-
self.
|
419
|
+
if attributes.key?(:'recipient_name')
|
420
|
+
self.recipient_name = attributes[:'recipient_name']
|
421
421
|
end
|
422
422
|
|
423
|
-
if attributes.key?(:'
|
424
|
-
self.
|
423
|
+
if attributes.key?(:'recipient_second_name')
|
424
|
+
self.recipient_second_name = attributes[:'recipient_second_name']
|
425
425
|
end
|
426
426
|
|
427
427
|
if attributes.key?(:'address')
|
428
428
|
self.address = attributes[:'address']
|
429
429
|
end
|
430
430
|
|
431
|
-
if attributes.key?(:'
|
432
|
-
self.
|
431
|
+
if attributes.key?(:'address2')
|
432
|
+
self.address2 = attributes[:'address2']
|
433
433
|
end
|
434
434
|
|
435
435
|
if attributes.key?(:'city')
|
@@ -535,12 +535,12 @@ module AvalaraSdk::A1099::V2
|
|
535
535
|
address_verification_status == o.address_verification_status &&
|
536
536
|
reference_id == o.reference_id &&
|
537
537
|
email == o.email &&
|
538
|
-
|
538
|
+
tin_type == o.tin_type &&
|
539
539
|
tin == o.tin &&
|
540
|
-
|
541
|
-
|
540
|
+
recipient_name == o.recipient_name &&
|
541
|
+
recipient_second_name == o.recipient_second_name &&
|
542
542
|
address == o.address &&
|
543
|
-
|
543
|
+
address2 == o.address2 &&
|
544
544
|
city == o.city &&
|
545
545
|
state == o.state &&
|
546
546
|
zip == o.zip &&
|
@@ -561,7 +561,7 @@ module AvalaraSdk::A1099::V2
|
|
561
561
|
# Calculates hash code according to all attributes.
|
562
562
|
# @return [Integer] Hash code
|
563
563
|
def hash
|
564
|
-
[rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_and_health_care, nonemployee_compensation, substitute_payments, direct_sales_indicator, crop_insurance_proceeds, excess_golden_parachute, gross_amount_paid_attorney, section409_a_deferrals, section409_a_income, 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, reference_id, email,
|
564
|
+
[rents, royalties, other_income, fed_income_tax_withheld, fishing_boat_proceeds, medical_and_health_care, nonemployee_compensation, substitute_payments, direct_sales_indicator, crop_insurance_proceeds, excess_golden_parachute, gross_amount_paid_attorney, section409_a_deferrals, section409_a_income, 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, reference_id, email, tin_type, tin, recipient_name, recipient_second_name, address, address2, city, state, zip, foreign_province, country_code, validation_errors, created_at, updated_at, state_and_local_withholding].hash
|
565
565
|
end
|
566
566
|
|
567
567
|
# Builds the object from hash
|