avalara_sdk 25.8.3 → 25.10.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 (113) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +4 -14
  4. data/docs/A1099/V2/CompaniesW9Api.md +9 -9
  5. data/docs/A1099/V2/CompanyBase.md +50 -0
  6. data/docs/A1099/V2/CompanyRequest.md +50 -0
  7. data/docs/A1099/V2/ErrorResponse.md +2 -2
  8. data/docs/A1099/V2/ErrorResponseItem.md +2 -2
  9. data/docs/A1099/V2/Form1042S.md +16 -16
  10. data/docs/A1099/V2/Form1095B.md +15 -15
  11. data/docs/A1099/V2/Form1095C.md +14 -14
  12. data/docs/A1099/V2/Form1099Base.md +14 -14
  13. data/docs/A1099/V2/Form1099Div.md +15 -15
  14. data/docs/A1099/V2/Form1099Int.md +16 -16
  15. data/docs/A1099/V2/Form1099K.md +20 -20
  16. data/docs/A1099/V2/Form1099ListRequest.md +1 -1
  17. data/docs/A1099/V2/Form1099Misc.md +15 -15
  18. data/docs/A1099/V2/Form1099Nec.md +17 -17
  19. data/docs/A1099/V2/Form1099R.md +17 -17
  20. data/docs/A1099/V2/Forms1099Api.md +12 -12
  21. data/docs/A1099/V2/FormsW9Api.md +17 -17
  22. data/docs/A1099/V2/IntermediaryOrFlowThrough.md +2 -2
  23. data/docs/A1099/V2/IssuerBase.md +46 -0
  24. data/docs/A1099/V2/IssuerRequest.md +46 -0
  25. data/docs/A1099/V2/Issuers1099Api.md +9 -9
  26. data/docs/A1099/V2/JobResponse.md +1 -1
  27. data/docs/A1099/V2/JobsApi.md +1 -1
  28. data/docs/A1099/V2/TinMatchStatusResponse.md +1 -1
  29. data/docs/A1099/V2/W4FormMinimalRequest.md +2 -2
  30. data/docs/A1099/V2/W4FormRequest.md +11 -11
  31. data/docs/A1099/V2/W4FormResponse.md +48 -20
  32. data/docs/A1099/V2/W8BenEFormMinimalRequest.md +2 -2
  33. data/docs/A1099/V2/W8BenEFormRequest.md +10 -10
  34. data/docs/A1099/V2/W8BenEFormResponse.md +96 -68
  35. data/docs/A1099/V2/W8BenFormMinimalRequest.md +2 -2
  36. data/docs/A1099/V2/W8BenFormRequest.md +6 -6
  37. data/docs/A1099/V2/W8BenFormResponse.md +55 -27
  38. data/docs/A1099/V2/W8ImyFormMinimalRequest.md +2 -2
  39. data/docs/A1099/V2/W8ImyFormRequest.md +10 -10
  40. data/docs/A1099/V2/W8ImyFormResponse.md +118 -90
  41. data/docs/A1099/V2/W9FormBaseMinimalRequest.md +2 -2
  42. data/docs/A1099/V2/W9FormBaseRequest.md +2 -2
  43. data/docs/A1099/V2/W9FormBaseResponse.md +3 -3
  44. data/docs/A1099/V2/W9FormMinimalRequest.md +2 -2
  45. data/docs/A1099/V2/W9FormRequest.md +12 -12
  46. data/docs/A1099/V2/W9FormResponse.md +44 -16
  47. data/lib/avalara_sdk/api/A1099/V2/companies_w9_api.rb +21 -21
  48. data/lib/avalara_sdk/api/A1099/V2/forms1099_api.rb +7 -7
  49. data/lib/avalara_sdk/api/A1099/V2/forms_w9_api.rb +16 -16
  50. data/lib/avalara_sdk/api/A1099/V2/issuers1099_api.rb +21 -21
  51. data/lib/avalara_sdk/api/A1099/V2/jobs_api.rb +1 -1
  52. data/lib/avalara_sdk/api/EInvoicing/V1/data_input_fields_api.rb +1 -1
  53. data/lib/avalara_sdk/api/EInvoicing/V1/documents_api.rb +1 -1
  54. data/lib/avalara_sdk/api/EInvoicing/V1/interop_api.rb +1 -1
  55. data/lib/avalara_sdk/api/EInvoicing/V1/mandates_api.rb +1 -1
  56. data/lib/avalara_sdk/api/EInvoicing/V1/subscriptions_api.rb +1 -1
  57. data/lib/avalara_sdk/api/EInvoicing/V1/tax_identifiers_api.rb +1 -1
  58. data/lib/avalara_sdk/api/EInvoicing/V1/trading_partners_api.rb +1 -1
  59. data/lib/avalara_sdk/api_client.rb +10 -2
  60. data/lib/avalara_sdk/models/A1099/V2/company_base.rb +404 -0
  61. data/lib/avalara_sdk/models/A1099/V2/company_request.rb +411 -0
  62. data/lib/avalara_sdk/models/A1099/V2/company_response.rb +1 -1
  63. data/lib/avalara_sdk/models/A1099/V2/error_response.rb +2 -6
  64. data/lib/avalara_sdk/models/A1099/V2/error_response_item.rb +2 -0
  65. data/lib/avalara_sdk/models/A1099/V2/form1042_s.rb +20 -30
  66. data/lib/avalara_sdk/models/A1099/V2/form1095_b.rb +19 -40
  67. data/lib/avalara_sdk/models/A1099/V2/form1095_c.rb +18 -49
  68. data/lib/avalara_sdk/models/A1099/V2/form1099_base.rb +18 -29
  69. data/lib/avalara_sdk/models/A1099/V2/form1099_div.rb +20 -31
  70. data/lib/avalara_sdk/models/A1099/V2/form1099_int.rb +22 -32
  71. data/lib/avalara_sdk/models/A1099/V2/form1099_k.rb +35 -38
  72. data/lib/avalara_sdk/models/A1099/V2/form1099_list_request.rb +2 -12
  73. data/lib/avalara_sdk/models/A1099/V2/form1099_misc.rb +20 -31
  74. data/lib/avalara_sdk/models/A1099/V2/form1099_nec.rb +23 -33
  75. data/lib/avalara_sdk/models/A1099/V2/form1099_r.rb +48 -33
  76. data/lib/avalara_sdk/models/A1099/V2/intermediary_or_flow_through.rb +48 -2
  77. data/lib/avalara_sdk/models/A1099/V2/issuer_base.rb +384 -0
  78. data/lib/avalara_sdk/models/A1099/V2/issuer_request.rb +391 -0
  79. data/lib/avalara_sdk/models/A1099/V2/issuer_response.rb +1 -1
  80. data/lib/avalara_sdk/models/A1099/V2/job_response.rb +0 -6
  81. data/lib/avalara_sdk/models/A1099/V2/validation_error.rb +0 -6
  82. data/lib/avalara_sdk/models/A1099/V2/w4_form_minimal_request.rb +1 -27
  83. data/lib/avalara_sdk/models/A1099/V2/w4_form_request.rb +50 -24
  84. data/lib/avalara_sdk/models/A1099/V2/w4_form_response.rb +191 -15
  85. data/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_minimal_request.rb +1 -27
  86. data/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_request.rb +37 -28
  87. data/lib/avalara_sdk/models/A1099/V2/w8_ben_e_form_response.rb +190 -14
  88. data/lib/avalara_sdk/models/A1099/V2/w8_ben_form_minimal_request.rb +1 -27
  89. data/lib/avalara_sdk/models/A1099/V2/w8_ben_form_request.rb +20 -23
  90. data/lib/avalara_sdk/models/A1099/V2/w8_ben_form_response.rb +191 -15
  91. data/lib/avalara_sdk/models/A1099/V2/w8_imy_form_minimal_request.rb +1 -27
  92. data/lib/avalara_sdk/models/A1099/V2/w8_imy_form_request.rb +72 -22
  93. data/lib/avalara_sdk/models/A1099/V2/w8_imy_form_response.rb +191 -15
  94. data/lib/avalara_sdk/models/A1099/V2/w9_form_base_minimal_request.rb +1 -27
  95. data/lib/avalara_sdk/models/A1099/V2/w9_form_base_request.rb +1 -27
  96. data/lib/avalara_sdk/models/A1099/V2/w9_form_base_response.rb +47 -18
  97. data/lib/avalara_sdk/models/A1099/V2/w9_form_minimal_request.rb +1 -27
  98. data/lib/avalara_sdk/models/A1099/V2/w9_form_request.rb +61 -22
  99. data/lib/avalara_sdk/models/A1099/V2/w9_form_response.rb +190 -14
  100. data/lib/avalara_sdk/version.rb +1 -1
  101. data/lib/avalara_sdk.rb +8 -4
  102. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/byebug-11.1.3/gem_make.out +5 -5
  103. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/date-3.4.1/gem_make.out +5 -5
  104. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debase-0.2.9/gem_make.out +5 -5
  105. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/debug-1.10.0/gem_make.out +5 -5
  106. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/erb-5.0.1/gem_make.out +5 -5
  107. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/io-console-0.8.0/gem_make.out +5 -5
  108. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/json-2.12.2/gem_make.out +5 -5
  109. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/prism-1.4.0/gem_make.out +5 -5
  110. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/psych-5.2.6/gem_make.out +5 -5
  111. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out +5 -5
  112. data/vendor/bundle/ruby/3.3.0/extensions/x86_64-linux/3.3.0/stringio-3.1.7/gem_make.out +5 -5
  113. metadata +10 -2
@@ -0,0 +1,404 @@
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 CompanyBase
14
+ # Legal name. Not the DBA name.
15
+ attr_accessor :name
16
+
17
+ # Doing Business As (DBA) name or continuation of a long legal name.
18
+ attr_accessor :dba_name
19
+
20
+ # Contact email address. For inquiries by vendors/employees.
21
+ attr_accessor :email
22
+
23
+ # Address.
24
+ attr_accessor :address
25
+
26
+ # City.
27
+ attr_accessor :city
28
+
29
+ # Two-letter US state or Canadian province code (required for US/CA addresses).
30
+ attr_accessor :state
31
+
32
+ # ZIP/postal code.
33
+ attr_accessor :zip
34
+
35
+ # Contact phone number (must contain at least 10 digits, max 15 characters).
36
+ attr_accessor :telephone
37
+
38
+ # Federal Tax Identification Number (TIN). EIN/Tax ID (required for US companies).
39
+ attr_accessor :tin
40
+
41
+ # Internal reference ID. Never shown to any agency or recipient.
42
+ attr_accessor :reference_id
43
+
44
+ # Indicates whether the company authorizes IRS TIN matching.
45
+ attr_accessor :do_tin_match
46
+
47
+ # Group name for organizing companies (creates or finds group by name).
48
+ attr_accessor :group_name
49
+
50
+ # Province or region for non-US/CA addresses.
51
+ attr_accessor :foreign_province
52
+
53
+ # Two-letter IRS country code (e.g., 'US', 'CA'), as defined at https://www.irs.gov/e-file-providers/country-codes.
54
+ attr_accessor :country_code
55
+
56
+ # Boolean to enable automatic reminder emails (default: false).
57
+ attr_accessor :resend_requests
58
+
59
+ # Days between reminder emails (7-365, required if resendRequests is true).
60
+ attr_accessor :resend_interval_days
61
+
62
+ # Maximum number of reminder attempts (1-52, required if resendRequests is true).
63
+ attr_accessor :max_reminder_attempts
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'name' => :'name',
69
+ :'dba_name' => :'dbaName',
70
+ :'email' => :'email',
71
+ :'address' => :'address',
72
+ :'city' => :'city',
73
+ :'state' => :'state',
74
+ :'zip' => :'zip',
75
+ :'telephone' => :'telephone',
76
+ :'tin' => :'tin',
77
+ :'reference_id' => :'referenceId',
78
+ :'do_tin_match' => :'doTinMatch',
79
+ :'group_name' => :'groupName',
80
+ :'foreign_province' => :'foreignProvince',
81
+ :'country_code' => :'countryCode',
82
+ :'resend_requests' => :'resendRequests',
83
+ :'resend_interval_days' => :'resendIntervalDays',
84
+ :'max_reminder_attempts' => :'maxReminderAttempts'
85
+ }
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'name' => :'String',
97
+ :'dba_name' => :'String',
98
+ :'email' => :'String',
99
+ :'address' => :'String',
100
+ :'city' => :'String',
101
+ :'state' => :'String',
102
+ :'zip' => :'String',
103
+ :'telephone' => :'String',
104
+ :'tin' => :'String',
105
+ :'reference_id' => :'String',
106
+ :'do_tin_match' => :'Boolean',
107
+ :'group_name' => :'String',
108
+ :'foreign_province' => :'String',
109
+ :'country_code' => :'String',
110
+ :'resend_requests' => :'Boolean',
111
+ :'resend_interval_days' => :'Integer',
112
+ :'max_reminder_attempts' => :'Integer'
113
+ }
114
+ end
115
+
116
+ # List of attributes with nullable: true
117
+ def self.openapi_nullable
118
+ Set.new([
119
+ :'name',
120
+ :'dba_name',
121
+ :'email',
122
+ :'address',
123
+ :'city',
124
+ :'state',
125
+ :'zip',
126
+ :'telephone',
127
+ :'tin',
128
+ :'reference_id',
129
+ :'do_tin_match',
130
+ :'group_name',
131
+ :'foreign_province',
132
+ :'country_code',
133
+ :'resend_requests',
134
+ :'resend_interval_days',
135
+ :'max_reminder_attempts'
136
+ ])
137
+ end
138
+
139
+ # Initializes the object
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ def initialize(attributes = {})
142
+ if (!attributes.is_a?(Hash))
143
+ fail ArgumentError, "The input argument (attributes) must be a hash in `AvalaraSdk::A1099::V2::CompanyBase` initialize method"
144
+ end
145
+
146
+ # check to see if the attribute exists and convert string to symbol for hash key
147
+ attributes = attributes.each_with_object({}) { |(k, v), h|
148
+ if (!self.class.attribute_map.key?(k.to_sym))
149
+ fail ArgumentError, "`#{k}` is not a valid attribute in `AvalaraSdk::A1099::V2::CompanyBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
150
+ end
151
+ h[k.to_sym] = v
152
+ }
153
+
154
+ if attributes.key?(:'name')
155
+ self.name = attributes[:'name']
156
+ else
157
+ self.name = nil
158
+ end
159
+
160
+ if attributes.key?(:'dba_name')
161
+ self.dba_name = attributes[:'dba_name']
162
+ end
163
+
164
+ if attributes.key?(:'email')
165
+ self.email = attributes[:'email']
166
+ else
167
+ self.email = nil
168
+ end
169
+
170
+ if attributes.key?(:'address')
171
+ self.address = attributes[:'address']
172
+ else
173
+ self.address = nil
174
+ end
175
+
176
+ if attributes.key?(:'city')
177
+ self.city = attributes[:'city']
178
+ else
179
+ self.city = nil
180
+ end
181
+
182
+ if attributes.key?(:'state')
183
+ self.state = attributes[:'state']
184
+ end
185
+
186
+ if attributes.key?(:'zip')
187
+ self.zip = attributes[:'zip']
188
+ else
189
+ self.zip = nil
190
+ end
191
+
192
+ if attributes.key?(:'telephone')
193
+ self.telephone = attributes[:'telephone']
194
+ else
195
+ self.telephone = nil
196
+ end
197
+
198
+ if attributes.key?(:'tin')
199
+ self.tin = attributes[:'tin']
200
+ else
201
+ self.tin = nil
202
+ end
203
+
204
+ if attributes.key?(:'reference_id')
205
+ self.reference_id = attributes[:'reference_id']
206
+ end
207
+
208
+ if attributes.key?(:'do_tin_match')
209
+ self.do_tin_match = attributes[:'do_tin_match']
210
+ end
211
+
212
+ if attributes.key?(:'group_name')
213
+ self.group_name = attributes[:'group_name']
214
+ end
215
+
216
+ if attributes.key?(:'foreign_province')
217
+ self.foreign_province = attributes[:'foreign_province']
218
+ end
219
+
220
+ if attributes.key?(:'country_code')
221
+ self.country_code = attributes[:'country_code']
222
+ else
223
+ self.country_code = nil
224
+ end
225
+
226
+ if attributes.key?(:'resend_requests')
227
+ self.resend_requests = attributes[:'resend_requests']
228
+ end
229
+
230
+ if attributes.key?(:'resend_interval_days')
231
+ self.resend_interval_days = attributes[:'resend_interval_days']
232
+ end
233
+
234
+ if attributes.key?(:'max_reminder_attempts')
235
+ self.max_reminder_attempts = attributes[:'max_reminder_attempts']
236
+ end
237
+ end
238
+
239
+ # Show invalid properties with the reasons. Usually used together with valid?
240
+ # @return Array for valid properties with the reasons
241
+ def list_invalid_properties
242
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
243
+ invalid_properties = Array.new
244
+ invalid_properties
245
+ end
246
+
247
+ # Check to see if the all the properties in the model are valid
248
+ # @return true if the model is valid
249
+ def valid?
250
+ warn '[DEPRECATED] the `valid?` method is obsolete'
251
+ true
252
+ end
253
+
254
+ # Checks equality by comparing each attribute.
255
+ # @param [Object] Object to be compared
256
+ def ==(o)
257
+ return true if self.equal?(o)
258
+ self.class == o.class &&
259
+ name == o.name &&
260
+ dba_name == o.dba_name &&
261
+ email == o.email &&
262
+ address == o.address &&
263
+ city == o.city &&
264
+ state == o.state &&
265
+ zip == o.zip &&
266
+ telephone == o.telephone &&
267
+ tin == o.tin &&
268
+ reference_id == o.reference_id &&
269
+ do_tin_match == o.do_tin_match &&
270
+ group_name == o.group_name &&
271
+ foreign_province == o.foreign_province &&
272
+ country_code == o.country_code &&
273
+ resend_requests == o.resend_requests &&
274
+ resend_interval_days == o.resend_interval_days &&
275
+ max_reminder_attempts == o.max_reminder_attempts
276
+ end
277
+
278
+ # @see the `==` method
279
+ # @param [Object] Object to be compared
280
+ def eql?(o)
281
+ self == o
282
+ end
283
+
284
+ # Calculates hash code according to all attributes.
285
+ # @return [Integer] Hash code
286
+ def hash
287
+ [name, dba_name, email, address, city, state, zip, telephone, tin, reference_id, do_tin_match, group_name, foreign_province, country_code, resend_requests, resend_interval_days, max_reminder_attempts].hash
288
+ end
289
+
290
+ # Builds the object from hash
291
+ # @param [Hash] attributes Model attributes in the form of hash
292
+ # @return [Object] Returns the model itself
293
+ def self.build_from_hash(attributes)
294
+ return nil unless attributes.is_a?(Hash)
295
+ attributes = attributes.transform_keys(&:to_sym)
296
+ transformed_hash = {}
297
+ openapi_types.each_pair do |key, type|
298
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
299
+ transformed_hash["#{key}"] = nil
300
+ elsif type =~ /\AArray<(.*)>/i
301
+ # check to ensure the input is an array given that the attribute
302
+ # is documented as an array but the input is not
303
+ if attributes[attribute_map[key]].is_a?(Array)
304
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
305
+ end
306
+ elsif !attributes[attribute_map[key]].nil?
307
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
308
+ end
309
+ end
310
+ new(transformed_hash)
311
+ end
312
+
313
+ # Deserializes the data based on type
314
+ # @param string type Data type
315
+ # @param string value Value to be deserialized
316
+ # @return [Object] Deserialized data
317
+ def self._deserialize(type, value)
318
+ case type.to_sym
319
+ when :Time
320
+ Time.parse(value)
321
+ when :Date
322
+ Date.parse(value)
323
+ when :String
324
+ value.to_s
325
+ when :Integer
326
+ value.to_i
327
+ when :Float
328
+ value.to_f
329
+ when :Boolean
330
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
331
+ true
332
+ else
333
+ false
334
+ end
335
+ when :Object
336
+ # generic object (usually a Hash), return directly
337
+ value
338
+ when /\AArray<(?<inner_type>.+)>\z/
339
+ inner_type = Regexp.last_match[:inner_type]
340
+ value.map { |v| _deserialize(inner_type, v) }
341
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
342
+ k_type = Regexp.last_match[:k_type]
343
+ v_type = Regexp.last_match[:v_type]
344
+ {}.tap do |hash|
345
+ value.each do |k, v|
346
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
347
+ end
348
+ end
349
+ else # model
350
+ # models (e.g. Pet) or oneOf
351
+ klass = AvalaraSdk::A1099::V2.const_get(type)
352
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
353
+ end
354
+ end
355
+
356
+ # Returns the string representation of the object
357
+ # @return [String] String presentation of the object
358
+ def to_s
359
+ to_hash.to_s
360
+ end
361
+
362
+ # to_body is an alias to to_hash (backward compatibility)
363
+ # @return [Hash] Returns the object in the form of hash
364
+ def to_body
365
+ to_hash
366
+ end
367
+
368
+ # Returns the object in the form of hash
369
+ # @return [Hash] Returns the object in the form of hash
370
+ def to_hash
371
+ hash = {}
372
+ self.class.attribute_map.each_pair do |attr, param|
373
+ value = self.send(attr)
374
+ if value.nil?
375
+ is_nullable = self.class.openapi_nullable.include?(attr)
376
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
377
+ end
378
+
379
+ hash[param] = _to_hash(value)
380
+ end
381
+ hash
382
+ end
383
+
384
+ # Outputs non-array value in the form of hash
385
+ # For object, use to_hash. Otherwise, just return the value
386
+ # @param [Object] value Any valid value
387
+ # @return [Hash] Returns the value in the form of hash
388
+ def _to_hash(value)
389
+ if value.is_a?(Array)
390
+ value.compact.map { |v| _to_hash(v) }
391
+ elsif value.is_a?(Hash)
392
+ {}.tap do |hash|
393
+ value.each { |k, v| hash[k] = _to_hash(v) }
394
+ end
395
+ elsif value.respond_to? :to_hash
396
+ value.to_hash
397
+ else
398
+ value
399
+ end
400
+ end
401
+
402
+ end
403
+
404
+ end