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.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +17 -3
  3. data/docs/A1099/V2/BulkUpsert1099FormsRequest.md +3 -1
  4. data/docs/A1099/V2/CompaniesW9Api.md +45 -31
  5. data/docs/A1099/V2/CoveredIndividualReference.md +58 -0
  6. data/docs/A1099/V2/CoveredIndividualRequest.md +54 -0
  7. data/docs/A1099/V2/Form1095B.md +86 -0
  8. data/docs/A1099/V2/Form1095BList.md +20 -0
  9. data/docs/A1099/V2/Form1095BListItem.md +74 -0
  10. data/docs/A1099/V2/Form1095BRequest.md +76 -0
  11. data/docs/A1099/V2/Form1099Base.md +8 -8
  12. data/docs/A1099/V2/Form1099DivListItem.md +11 -11
  13. data/docs/A1099/V2/Form1099DivRequest.md +11 -17
  14. data/docs/A1099/V2/Form1099DivResponse.md +88 -0
  15. data/docs/A1099/V2/Form1099K.md +8 -8
  16. data/docs/A1099/V2/Form1099KListItem.md +11 -11
  17. data/docs/A1099/V2/Form1099KRequest.md +11 -17
  18. data/docs/A1099/V2/Form1099List.md +1 -1
  19. data/docs/A1099/V2/Form1099ListDataInner.md +32 -0
  20. data/docs/A1099/V2/Form1099Misc.md +8 -8
  21. data/docs/A1099/V2/Form1099MiscListItem.md +11 -11
  22. data/docs/A1099/V2/Form1099MiscRequest.md +11 -17
  23. data/docs/A1099/V2/Form1099MiscResponse.md +120 -0
  24. data/docs/A1099/V2/Form1099Nec.md +8 -8
  25. data/docs/A1099/V2/Form1099NecListItem.md +11 -11
  26. data/docs/A1099/V2/Form1099NecRequest.md +11 -17
  27. data/docs/A1099/V2/Form1099NecResponse.md +96 -0
  28. data/docs/A1099/V2/Form1099R.md +8 -8
  29. data/docs/A1099/V2/Form1099RListItem.md +11 -11
  30. data/docs/A1099/V2/Form1099RRequest.md +11 -17
  31. data/docs/A1099/V2/FormRequestBase.md +9 -13
  32. data/docs/A1099/V2/FormRequestCsvBase.md +66 -0
  33. data/docs/A1099/V2/FormResponseBase.md +43 -9
  34. data/docs/A1099/V2/FormSingleRequestBase.md +11 -15
  35. data/docs/A1099/V2/Forms1099Api.md +75 -57
  36. data/docs/A1099/V2/FormsW9Api.md +63 -123
  37. data/docs/A1099/V2/Get1099Form200Response.md +55 -0
  38. data/docs/A1099/V2/IncludedBase.md +20 -0
  39. data/docs/A1099/V2/Issuers1099Api.md +45 -31
  40. data/docs/A1099/V2/Jobs1099Api.md +10 -6
  41. data/docs/A1099/V2/StateAndLocalWithholdingResponse.md +32 -0
  42. data/docs/A1099/V2/StateEfileStatusDetail.md +1 -1
  43. data/docs/A1099/V2/StateEfileStatusDetailApp.md +22 -0
  44. data/docs/A1099/V2/StatusDetail.md +20 -0
  45. data/docs/A1099/V2/Update1099Form200Response.md +53 -0
  46. data/docs/A1099/V2/ValidationErrorApp.md +20 -0
  47. data/docs/EInvoicing/V1/DataInputFieldsApi.md +4 -4
  48. data/docs/EInvoicing/V1/DocumentsApi.md +2 -2
  49. data/docs/EInvoicing/V1/MandatesApi.md +4 -4
  50. data/docs/EInvoicing/V1/SubscriptionsApi.md +4 -4
  51. data/docs/EInvoicing/V1/TradingPartnersApi.md +4 -4
  52. data/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb +103 -43
  53. data/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb +171 -87
  54. data/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb +135 -176
  55. data/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb +103 -43
  56. data/lib/avalara_sdk/api/A1099/V2/jobs1099_api.rb +19 -7
  57. data/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb +6 -6
  58. data/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb +4 -4
  59. data/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb +1 -1
  60. data/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb +6 -6
  61. data/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb +6 -6
  62. data/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb +7 -7
  63. data/lib/avalara_sdk/models/A1099/V2/bulk_upsert1099_forms_request.rb +1 -0
  64. data/lib/avalara_sdk/models/A1099/V2/covered_individual_reference.rb +403 -0
  65. data/lib/avalara_sdk/models/A1099/V2/covered_individual_request.rb +378 -0
  66. data/lib/avalara_sdk/models/A1099/V2/form1095_b.rb +572 -0
  67. data/lib/avalara_sdk/models/A1099/V2/form1095_b_list.rb +238 -0
  68. data/lib/avalara_sdk/models/A1099/V2/form1095_b_list_item.rb +538 -0
  69. data/lib/avalara_sdk/models/A1099/V2/form1095_b_request.rb +559 -0
  70. data/lib/avalara_sdk/models/A1099/V2/form1099_base.rb +29 -29
  71. data/lib/avalara_sdk/models/A1099/V2/form1099_div_list_item.rb +78 -36
  72. data/lib/avalara_sdk/models/A1099/V2/form1099_div_request.rb +80 -53
  73. data/lib/avalara_sdk/models/A1099/V2/form1099_div_response.rb +600 -0
  74. data/lib/avalara_sdk/models/A1099/V2/form1099_k.rb +29 -29
  75. data/lib/avalara_sdk/models/A1099/V2/form1099_k_list_item.rb +56 -37
  76. data/lib/avalara_sdk/models/A1099/V2/form1099_k_request.rb +80 -54
  77. data/lib/avalara_sdk/models/A1099/V2/form1099_list.rb +1 -1
  78. data/lib/avalara_sdk/models/A1099/V2/form1099_list_data_inner.rb +20 -68
  79. data/lib/avalara_sdk/models/A1099/V2/form1099_misc.rb +29 -29
  80. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_list_item.rb +78 -36
  81. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_request.rb +80 -53
  82. data/lib/avalara_sdk/models/A1099/V2/form1099_misc_response.rb +744 -0
  83. data/lib/avalara_sdk/models/A1099/V2/form1099_nec.rb +29 -29
  84. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_list_item.rb +78 -36
  85. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_request.rb +80 -53
  86. data/lib/avalara_sdk/models/A1099/V2/form1099_nec_response.rb +636 -0
  87. data/lib/avalara_sdk/models/A1099/V2/form1099_r.rb +29 -29
  88. data/lib/avalara_sdk/models/A1099/V2/form1099_r_list_item.rb +56 -36
  89. data/lib/avalara_sdk/models/A1099/V2/form1099_r_request.rb +80 -53
  90. data/lib/avalara_sdk/models/A1099/V2/form_request_base.rb +68 -44
  91. data/lib/avalara_sdk/models/A1099/V2/form_request_csv_base.rb +475 -0
  92. data/lib/avalara_sdk/models/A1099/V2/form_response_base.rb +252 -31
  93. data/lib/avalara_sdk/models/A1099/V2/form_single_request_base.rb +80 -44
  94. data/lib/avalara_sdk/models/A1099/V2/get1099_form200_response.rb +104 -0
  95. data/lib/avalara_sdk/models/A1099/V2/included_base.rb +219 -0
  96. data/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_request.rb +1 -0
  97. data/lib/avalara_sdk/models/A1099/V2/state_and_local_withholding_response.rb +274 -0
  98. data/lib/avalara_sdk/models/A1099/V2/state_efile_status_detail_app.rb +231 -0
  99. data/lib/avalara_sdk/models/A1099/V2/status_detail.rb +221 -0
  100. data/lib/avalara_sdk/models/A1099/V2/update1099_form200_response.rb +103 -0
  101. data/lib/avalara_sdk/models/A1099/V2/validation_error_app.rb +229 -0
  102. data/lib/avalara_sdk/version.rb +1 -1
  103. data/lib/avalara_sdk.rb +17 -0
  104. data/spec/integration/a1099_spec.rb +12 -12
  105. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-11.1.3/gem_make.out +5 -5
  106. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/gem_make.out +5 -5
  107. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/gem_make.out +5 -5
  108. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debug-1.10.0/gem_make.out +5 -5
  109. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/erb-5.0.1/gem_make.out +5 -5
  110. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/gem_make.out +5 -5
  111. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/gem_make.out +5 -5
  112. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/prism-1.4.0/gem_make.out +5 -5
  113. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/gem_make.out +5 -5
  114. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +5 -5
  115. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/gem_make.out +5 -5
  116. metadata +36 -2
@@ -11,8 +11,6 @@ require 'time'
11
11
 
12
12
  module AvalaraSdk::A1099::V2
13
13
  class Form1099RRequest
14
- attr_accessor :state_and_local_withholding
15
-
16
14
  attr_accessor :gross_distribution
17
15
 
18
16
  attr_accessor :taxable_amount
@@ -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 :street_address
68
+ attr_accessor :address
77
69
 
78
- attr_accessor :street_address_line2
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
  :'gross_distribution' => :'grossDistribution',
111
126
  :'taxable_amount' => :'taxableAmount',
112
127
  :'taxable_amount_not_determined' => :'taxableAmountNotDetermined',
@@ -129,16 +144,13 @@ module AvalaraSdk::A1099::V2
129
144
  :'date_of_payment' => :'dateOfPayment',
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
- :'street_address' => :'streetAddress',
141
- :'street_address_line2' => :'streetAddressLine2',
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' => :'StateAndLocalWithholdingRequest',
167
179
  :'gross_distribution' => :'Float',
168
180
  :'taxable_amount' => :'Float',
169
181
  :'taxable_amount_not_determined' => :'Boolean',
@@ -186,16 +198,13 @@ module AvalaraSdk::A1099::V2
186
198
  :'date_of_payment' => :'Time',
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' => :'Integer',
204
+ :'tin_type' => :'String',
196
205
  :'recipient_second_name' => :'String',
197
- :'street_address' => :'String',
198
- :'street_address_line2' => :'String',
206
+ :'address' => :'String',
207
+ :'address2' => :'String',
199
208
  :'city' => :'String',
200
209
  :'state' => :'String',
201
210
  :'zip' => :'String',
@@ -208,13 +217,22 @@ 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([
228
+ :'issuer_id',
229
+ :'reference_id',
230
+ :'recipient_name',
231
+ :'address2',
232
+ :'recipient_email',
233
+ :'account_number',
234
+ :'office_code',
235
+ :'recipient_non_us_province',
218
236
  ])
219
237
  end
220
238
 
@@ -240,10 +258,6 @@ module AvalaraSdk::A1099::V2
240
258
  h[k.to_sym] = v
241
259
  }
242
260
 
243
- if attributes.key?(:'state_and_local_withholding')
244
- self.state_and_local_withholding = attributes[:'state_and_local_withholding']
245
- end
246
-
247
261
  if attributes.key?(:'gross_distribution')
248
262
  self.gross_distribution = attributes[:'gross_distribution']
249
263
  end
@@ -332,18 +346,6 @@ module AvalaraSdk::A1099::V2
332
346
  self.issuer_id = attributes[:'issuer_id']
333
347
  end
334
348
 
335
- if attributes.key?(:'issuer_reference_id')
336
- self.issuer_reference_id = attributes[:'issuer_reference_id']
337
- end
338
-
339
- if attributes.key?(:'issuer_tin')
340
- self.issuer_tin = attributes[:'issuer_tin']
341
- end
342
-
343
- if attributes.key?(:'tax_year')
344
- self.tax_year = attributes[:'tax_year']
345
- end
346
-
347
349
  if attributes.key?(:'reference_id')
348
350
  self.reference_id = attributes[:'reference_id']
349
351
  end
@@ -364,12 +366,12 @@ module AvalaraSdk::A1099::V2
364
366
  self.recipient_second_name = attributes[:'recipient_second_name']
365
367
  end
366
368
 
367
- if attributes.key?(:'street_address')
368
- self.street_address = attributes[:'street_address']
369
+ if attributes.key?(:'address')
370
+ self.address = attributes[:'address']
369
371
  end
370
372
 
371
- if attributes.key?(:'street_address_line2')
372
- self.street_address_line2 = attributes[:'street_address_line2']
373
+ if attributes.key?(:'address2')
374
+ self.address2 = attributes[:'address2']
373
375
  end
374
376
 
375
377
  if attributes.key?(:'city')
@@ -423,6 +425,10 @@ module AvalaraSdk::A1099::V2
423
425
  if attributes.key?(:'address_verification')
424
426
  self.address_verification = attributes[:'address_verification']
425
427
  end
428
+
429
+ if attributes.key?(:'state_and_local_withholding')
430
+ self.state_and_local_withholding = attributes[:'state_and_local_withholding']
431
+ end
426
432
  end
427
433
 
428
434
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -437,15 +443,38 @@ module AvalaraSdk::A1099::V2
437
443
  # @return true if the model is valid
438
444
  def valid?
439
445
  warn '[DEPRECATED] the `valid?` method is obsolete'
446
+ type_validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"])
447
+ return false unless type_validator.valid?(@type)
448
+ tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
449
+ return false unless tin_type_validator.valid?(@tin_type)
440
450
  true
441
451
  end
442
452
 
453
+ # Custom attribute writer method checking allowed values (enum).
454
+ # @param [Object] type Object to be assigned
455
+ def type=(type)
456
+ validator = EnumAttributeValidator.new('String', ["Form1099Nec", "Form1099Misc", "Form1099Div", "Form1099R", "Form1099K", "Form1095B"])
457
+ unless validator.valid?(type)
458
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
459
+ end
460
+ @type = type
461
+ end
462
+
463
+ # Custom attribute writer method checking allowed values (enum).
464
+ # @param [Object] tin_type Object to be assigned
465
+ def tin_type=(tin_type)
466
+ validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
467
+ unless validator.valid?(tin_type)
468
+ fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}."
469
+ end
470
+ @tin_type = tin_type
471
+ end
472
+
443
473
  # Checks equality by comparing each attribute.
444
474
  # @param [Object] Object to be compared
445
475
  def ==(o)
446
476
  return true if self.equal?(o)
447
477
  self.class == o.class &&
448
- state_and_local_withholding == o.state_and_local_withholding &&
449
478
  gross_distribution == o.gross_distribution &&
450
479
  taxable_amount == o.taxable_amount &&
451
480
  taxable_amount_not_determined == o.taxable_amount_not_determined &&
@@ -468,16 +497,13 @@ module AvalaraSdk::A1099::V2
468
497
  date_of_payment == o.date_of_payment &&
469
498
  type == o.type &&
470
499
  issuer_id == o.issuer_id &&
471
- issuer_reference_id == o.issuer_reference_id &&
472
- issuer_tin == o.issuer_tin &&
473
- tax_year == o.tax_year &&
474
500
  reference_id == o.reference_id &&
475
501
  recipient_name == o.recipient_name &&
476
502
  recipient_tin == o.recipient_tin &&
477
503
  tin_type == o.tin_type &&
478
504
  recipient_second_name == o.recipient_second_name &&
479
- street_address == o.street_address &&
480
- street_address_line2 == o.street_address_line2 &&
505
+ address == o.address &&
506
+ address2 == o.address2 &&
481
507
  city == o.city &&
482
508
  state == o.state &&
483
509
  zip == o.zip &&
@@ -490,7 +516,8 @@ module AvalaraSdk::A1099::V2
490
516
  postal_mail == o.postal_mail &&
491
517
  state_e_file == o.state_e_file &&
492
518
  tin_match == o.tin_match &&
493
- address_verification == o.address_verification
519
+ address_verification == o.address_verification &&
520
+ state_and_local_withholding == o.state_and_local_withholding
494
521
  end
495
522
 
496
523
  # @see the `==` method
@@ -502,7 +529,7 @@ module AvalaraSdk::A1099::V2
502
529
  # Calculates hash code according to all attributes.
503
530
  # @return [Integer] Hash code
504
531
  def hash
505
- [state_and_local_withholding, 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, issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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].hash
532
+ [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, 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
506
533
  end
507
534
 
508
535
  # Builds the object from hash
@@ -13,12 +13,6 @@ module AvalaraSdk::A1099::V2
13
13
  class FormRequestBase
14
14
  attr_accessor :issuer_id
15
15
 
16
- attr_accessor :issuer_reference_id
17
-
18
- attr_accessor :issuer_tin
19
-
20
- attr_accessor :tax_year
21
-
22
16
  attr_accessor :reference_id
23
17
 
24
18
  attr_accessor :recipient_name
@@ -29,9 +23,9 @@ module AvalaraSdk::A1099::V2
29
23
 
30
24
  attr_accessor :recipient_second_name
31
25
 
32
- attr_accessor :street_address
26
+ attr_accessor :address
33
27
 
34
- attr_accessor :street_address_line2
28
+ attr_accessor :address2
35
29
 
36
30
  attr_accessor :city
37
31
 
@@ -59,20 +53,41 @@ module AvalaraSdk::A1099::V2
59
53
 
60
54
  attr_accessor :address_verification
61
55
 
56
+ attr_accessor :state_and_local_withholding
57
+
58
+ class EnumAttributeValidator
59
+ attr_reader :datatype
60
+ attr_reader :allowable_values
61
+
62
+ def initialize(datatype, allowable_values)
63
+ @allowable_values = allowable_values.map do |value|
64
+ case datatype.to_s
65
+ when /Integer/i
66
+ value.to_i
67
+ when /Float/i
68
+ value.to_f
69
+ else
70
+ value
71
+ end
72
+ end
73
+ end
74
+
75
+ def valid?(value)
76
+ !value || allowable_values.include?(value)
77
+ end
78
+ end
79
+
62
80
  # Attribute mapping from ruby-style variable name to JSON key.
63
81
  def self.attribute_map
64
82
  {
65
83
  :'issuer_id' => :'issuerId',
66
- :'issuer_reference_id' => :'issuerReferenceId',
67
- :'issuer_tin' => :'issuerTin',
68
- :'tax_year' => :'taxYear',
69
84
  :'reference_id' => :'referenceId',
70
85
  :'recipient_name' => :'recipientName',
71
86
  :'recipient_tin' => :'recipientTin',
72
87
  :'tin_type' => :'tinType',
73
88
  :'recipient_second_name' => :'recipientSecondName',
74
- :'street_address' => :'streetAddress',
75
- :'street_address_line2' => :'streetAddressLine2',
89
+ :'address' => :'address',
90
+ :'address2' => :'address2',
76
91
  :'city' => :'city',
77
92
  :'state' => :'state',
78
93
  :'zip' => :'zip',
@@ -85,7 +100,8 @@ module AvalaraSdk::A1099::V2
85
100
  :'postal_mail' => :'postalMail',
86
101
  :'state_e_file' => :'stateEFile',
87
102
  :'tin_match' => :'tinMatch',
88
- :'address_verification' => :'addressVerification'
103
+ :'address_verification' => :'addressVerification',
104
+ :'state_and_local_withholding' => :'stateAndLocalWithholding'
89
105
  }
90
106
  end
91
107
 
@@ -98,16 +114,13 @@ module AvalaraSdk::A1099::V2
98
114
  def self.openapi_types
99
115
  {
100
116
  :'issuer_id' => :'String',
101
- :'issuer_reference_id' => :'String',
102
- :'issuer_tin' => :'String',
103
- :'tax_year' => :'Integer',
104
117
  :'reference_id' => :'String',
105
118
  :'recipient_name' => :'String',
106
119
  :'recipient_tin' => :'String',
107
- :'tin_type' => :'Integer',
120
+ :'tin_type' => :'String',
108
121
  :'recipient_second_name' => :'String',
109
- :'street_address' => :'String',
110
- :'street_address_line2' => :'String',
122
+ :'address' => :'String',
123
+ :'address2' => :'String',
111
124
  :'city' => :'String',
112
125
  :'state' => :'String',
113
126
  :'zip' => :'String',
@@ -120,13 +133,22 @@ module AvalaraSdk::A1099::V2
120
133
  :'postal_mail' => :'Boolean',
121
134
  :'state_e_file' => :'Boolean',
122
135
  :'tin_match' => :'Boolean',
123
- :'address_verification' => :'Boolean'
136
+ :'address_verification' => :'Boolean',
137
+ :'state_and_local_withholding' => :'StateAndLocalWithholdingRequest'
124
138
  }
125
139
  end
126
140
 
127
141
  # List of attributes with nullable: true
128
142
  def self.openapi_nullable
129
143
  Set.new([
144
+ :'issuer_id',
145
+ :'reference_id',
146
+ :'recipient_name',
147
+ :'address2',
148
+ :'recipient_email',
149
+ :'account_number',
150
+ :'office_code',
151
+ :'recipient_non_us_province',
130
152
  ])
131
153
  end
132
154
 
@@ -149,18 +171,6 @@ module AvalaraSdk::A1099::V2
149
171
  self.issuer_id = attributes[:'issuer_id']
150
172
  end
151
173
 
152
- if attributes.key?(:'issuer_reference_id')
153
- self.issuer_reference_id = attributes[:'issuer_reference_id']
154
- end
155
-
156
- if attributes.key?(:'issuer_tin')
157
- self.issuer_tin = attributes[:'issuer_tin']
158
- end
159
-
160
- if attributes.key?(:'tax_year')
161
- self.tax_year = attributes[:'tax_year']
162
- end
163
-
164
174
  if attributes.key?(:'reference_id')
165
175
  self.reference_id = attributes[:'reference_id']
166
176
  end
@@ -181,12 +191,12 @@ module AvalaraSdk::A1099::V2
181
191
  self.recipient_second_name = attributes[:'recipient_second_name']
182
192
  end
183
193
 
184
- if attributes.key?(:'street_address')
185
- self.street_address = attributes[:'street_address']
194
+ if attributes.key?(:'address')
195
+ self.address = attributes[:'address']
186
196
  end
187
197
 
188
- if attributes.key?(:'street_address_line2')
189
- self.street_address_line2 = attributes[:'street_address_line2']
198
+ if attributes.key?(:'address2')
199
+ self.address2 = attributes[:'address2']
190
200
  end
191
201
 
192
202
  if attributes.key?(:'city')
@@ -240,6 +250,10 @@ module AvalaraSdk::A1099::V2
240
250
  if attributes.key?(:'address_verification')
241
251
  self.address_verification = attributes[:'address_verification']
242
252
  end
253
+
254
+ if attributes.key?(:'state_and_local_withholding')
255
+ self.state_and_local_withholding = attributes[:'state_and_local_withholding']
256
+ end
243
257
  end
244
258
 
245
259
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -254,25 +268,34 @@ module AvalaraSdk::A1099::V2
254
268
  # @return true if the model is valid
255
269
  def valid?
256
270
  warn '[DEPRECATED] the `valid?` method is obsolete'
271
+ tin_type_validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
272
+ return false unless tin_type_validator.valid?(@tin_type)
257
273
  true
258
274
  end
259
275
 
276
+ # Custom attribute writer method checking allowed values (enum).
277
+ # @param [Object] tin_type Object to be assigned
278
+ def tin_type=(tin_type)
279
+ validator = EnumAttributeValidator.new('String', ["EIN", "SSN", "ITIN", "ATIN"])
280
+ unless validator.valid?(tin_type)
281
+ fail ArgumentError, "invalid value for \"tin_type\", must be one of #{validator.allowable_values}."
282
+ end
283
+ @tin_type = tin_type
284
+ end
285
+
260
286
  # Checks equality by comparing each attribute.
261
287
  # @param [Object] Object to be compared
262
288
  def ==(o)
263
289
  return true if self.equal?(o)
264
290
  self.class == o.class &&
265
291
  issuer_id == o.issuer_id &&
266
- issuer_reference_id == o.issuer_reference_id &&
267
- issuer_tin == o.issuer_tin &&
268
- tax_year == o.tax_year &&
269
292
  reference_id == o.reference_id &&
270
293
  recipient_name == o.recipient_name &&
271
294
  recipient_tin == o.recipient_tin &&
272
295
  tin_type == o.tin_type &&
273
296
  recipient_second_name == o.recipient_second_name &&
274
- street_address == o.street_address &&
275
- street_address_line2 == o.street_address_line2 &&
297
+ address == o.address &&
298
+ address2 == o.address2 &&
276
299
  city == o.city &&
277
300
  state == o.state &&
278
301
  zip == o.zip &&
@@ -285,7 +308,8 @@ module AvalaraSdk::A1099::V2
285
308
  postal_mail == o.postal_mail &&
286
309
  state_e_file == o.state_e_file &&
287
310
  tin_match == o.tin_match &&
288
- address_verification == o.address_verification
311
+ address_verification == o.address_verification &&
312
+ state_and_local_withholding == o.state_and_local_withholding
289
313
  end
290
314
 
291
315
  # @see the `==` method
@@ -297,7 +321,7 @@ module AvalaraSdk::A1099::V2
297
321
  # Calculates hash code according to all attributes.
298
322
  # @return [Integer] Hash code
299
323
  def hash
300
- [issuer_id, issuer_reference_id, issuer_tin, tax_year, reference_id, recipient_name, recipient_tin, tin_type, recipient_second_name, street_address, street_address_line2, 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].hash
324
+ [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
301
325
  end
302
326
 
303
327
  # Builds the object from hash