ultracart_api 4.1.238 → 4.1.240

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +28 -2
  3. data/docs/SfvbApi.md +337 -0
  4. data/docs/SfvbApprovalCreateRequest.md +4 -0
  5. data/docs/SfvbItemChildCreateRequest.md +26 -0
  6. data/docs/SfvbItemChildCreateResponse.md +36 -0
  7. data/docs/SfvbItemDefaultPageRequest.md +20 -0
  8. data/docs/SfvbItemDefaultPageResponse.md +36 -0
  9. data/docs/SfvbItemDefaultPageResult.md +40 -0
  10. data/docs/SfvbItemDefaultPageRow.md +28 -0
  11. data/docs/SfvbItemPageAssignment.md +28 -0
  12. data/docs/SfvbItemPages.md +28 -0
  13. data/docs/SfvbItemVariationAxis.md +22 -0
  14. data/docs/SfvbItemVariationChange.md +40 -0
  15. data/docs/SfvbItemVariationChangeResult.md +24 -0
  16. data/docs/SfvbItemVariationChild.md +22 -0
  17. data/docs/SfvbItemVariationCombination.md +24 -0
  18. data/docs/SfvbItemVariationOption.md +22 -0
  19. data/docs/SfvbItemVariationValue.md +20 -0
  20. data/docs/SfvbItemVariations.md +30 -0
  21. data/docs/SfvbItemVariationsRequest.md +20 -0
  22. data/docs/SfvbItemVariationsResponse.md +38 -0
  23. data/docs/SfvbTrackingProviderSecrets.md +2 -0
  24. data/lib/ultracart_api/api/sfvb_api.rb +459 -0
  25. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +24 -3
  26. data/lib/ultracart_api/models/sfvb_item_child_create_request.rb +260 -0
  27. data/lib/ultracart_api/models/sfvb_item_child_create_response.rb +309 -0
  28. data/lib/ultracart_api/models/sfvb_item_default_page_request.rb +232 -0
  29. data/lib/ultracart_api/models/sfvb_item_default_page_response.rb +312 -0
  30. data/lib/ultracart_api/models/sfvb_item_default_page_result.rb +330 -0
  31. data/lib/ultracart_api/models/sfvb_item_default_page_row.rb +270 -0
  32. data/lib/ultracart_api/models/sfvb_item_page_assignment.rb +270 -0
  33. data/lib/ultracart_api/models/sfvb_item_pages.rb +274 -0
  34. data/lib/ultracart_api/models/sfvb_item_variation_axis.rb +242 -0
  35. data/lib/ultracart_api/models/sfvb_item_variation_change.rb +334 -0
  36. data/lib/ultracart_api/models/sfvb_item_variation_change_result.rb +250 -0
  37. data/lib/ultracart_api/models/sfvb_item_variation_child.rb +240 -0
  38. data/lib/ultracart_api/models/sfvb_item_variation_combination.rb +251 -0
  39. data/lib/ultracart_api/models/sfvb_item_variation_option.rb +240 -0
  40. data/lib/ultracart_api/models/sfvb_item_variation_value.rb +230 -0
  41. data/lib/ultracart_api/models/sfvb_item_variations.rb +284 -0
  42. data/lib/ultracart_api/models/sfvb_item_variations_request.rb +232 -0
  43. data/lib/ultracart_api/models/sfvb_item_variations_response.rb +328 -0
  44. data/lib/ultracart_api/models/sfvb_tracking_provider_secrets.rb +11 -1
  45. data/lib/ultracart_api/version.rb +1 -1
  46. data/lib/ultracart_api.rb +18 -0
  47. metadata +37 -1
@@ -0,0 +1,330 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbItemDefaultPageResult
18
+ # The default page's oid now, or null.
19
+ attr_accessor :current_default_oid
20
+
21
+ # The default page now, or null.
22
+ attr_accessor :current_default_path
23
+
24
+ # Hash of the item's pages and default on this storefront. Send it back on the apply.
25
+ attr_accessor :current_sha256
26
+
27
+ # The row's position in the request, from 0.
28
+ attr_accessor :index
29
+
30
+ # The item's id, when found.
31
+ attr_accessor :merchant_item_id
32
+
33
+ # The item's oid, when found.
34
+ attr_accessor :merchant_item_oid
35
+
36
+ # Why the row is refused, stale or failed.
37
+ attr_accessor :message
38
+
39
+ # Apply only - the previous default page's oid.
40
+ attr_accessor :previous_default_oid
41
+
42
+ # Apply only - the default page before the change, to undo it.
43
+ attr_accessor :previous_default_path
44
+
45
+ # ready, already_default, target_not_found, target_not_on_host, target_not_assigned, target_hidden, item_not_found, invalid, stale, updated or failed.
46
+ attr_accessor :status
47
+
48
+ # The page's oid.
49
+ attr_accessor :target_oid
50
+
51
+ # The page the row makes the default.
52
+ attr_accessor :target_path
53
+
54
+ # Attribute mapping from ruby-style variable name to JSON key.
55
+ def self.attribute_map
56
+ {
57
+ :'current_default_oid' => :'current_default_oid',
58
+ :'current_default_path' => :'current_default_path',
59
+ :'current_sha256' => :'current_sha256',
60
+ :'index' => :'index',
61
+ :'merchant_item_id' => :'merchant_item_id',
62
+ :'merchant_item_oid' => :'merchant_item_oid',
63
+ :'message' => :'message',
64
+ :'previous_default_oid' => :'previous_default_oid',
65
+ :'previous_default_path' => :'previous_default_path',
66
+ :'status' => :'status',
67
+ :'target_oid' => :'target_oid',
68
+ :'target_path' => :'target_path'
69
+ }
70
+ end
71
+
72
+ # Returns all the JSON keys this model knows about
73
+ def self.acceptable_attributes
74
+ attribute_map.values
75
+ end
76
+
77
+ # Attribute type mapping.
78
+ def self.openapi_types
79
+ {
80
+ :'current_default_oid' => :'Integer',
81
+ :'current_default_path' => :'String',
82
+ :'current_sha256' => :'String',
83
+ :'index' => :'Integer',
84
+ :'merchant_item_id' => :'String',
85
+ :'merchant_item_oid' => :'Integer',
86
+ :'message' => :'String',
87
+ :'previous_default_oid' => :'Integer',
88
+ :'previous_default_path' => :'String',
89
+ :'status' => :'String',
90
+ :'target_oid' => :'Integer',
91
+ :'target_path' => :'String'
92
+ }
93
+ end
94
+
95
+ # List of attributes with nullable: true
96
+ def self.openapi_nullable
97
+ Set.new([
98
+ ])
99
+ end
100
+
101
+ # Initializes the object
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ def initialize(attributes = {})
104
+ if (!attributes.is_a?(Hash))
105
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemDefaultPageResult` initialize method"
106
+ end
107
+
108
+ # check to see if the attribute exists and convert string to symbol for hash key
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!self.class.attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemDefaultPageResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'current_default_oid')
117
+ self.current_default_oid = attributes[:'current_default_oid']
118
+ end
119
+
120
+ if attributes.key?(:'current_default_path')
121
+ self.current_default_path = attributes[:'current_default_path']
122
+ end
123
+
124
+ if attributes.key?(:'current_sha256')
125
+ self.current_sha256 = attributes[:'current_sha256']
126
+ end
127
+
128
+ if attributes.key?(:'index')
129
+ self.index = attributes[:'index']
130
+ end
131
+
132
+ if attributes.key?(:'merchant_item_id')
133
+ self.merchant_item_id = attributes[:'merchant_item_id']
134
+ end
135
+
136
+ if attributes.key?(:'merchant_item_oid')
137
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
138
+ end
139
+
140
+ if attributes.key?(:'message')
141
+ self.message = attributes[:'message']
142
+ end
143
+
144
+ if attributes.key?(:'previous_default_oid')
145
+ self.previous_default_oid = attributes[:'previous_default_oid']
146
+ end
147
+
148
+ if attributes.key?(:'previous_default_path')
149
+ self.previous_default_path = attributes[:'previous_default_path']
150
+ end
151
+
152
+ if attributes.key?(:'status')
153
+ self.status = attributes[:'status']
154
+ end
155
+
156
+ if attributes.key?(:'target_oid')
157
+ self.target_oid = attributes[:'target_oid']
158
+ end
159
+
160
+ if attributes.key?(:'target_path')
161
+ self.target_path = attributes[:'target_path']
162
+ end
163
+ end
164
+
165
+ # Show invalid properties with the reasons. Usually used together with valid?
166
+ # @return Array for valid properties with the reasons
167
+ def list_invalid_properties
168
+ invalid_properties = Array.new
169
+ invalid_properties
170
+ end
171
+
172
+ # Check to see if the all the properties in the model are valid
173
+ # @return true if the model is valid
174
+ def valid?
175
+ true
176
+ end
177
+
178
+ # Checks equality by comparing each attribute.
179
+ # @param [Object] Object to be compared
180
+ def ==(o)
181
+ return true if self.equal?(o)
182
+ self.class == o.class &&
183
+ current_default_oid == o.current_default_oid &&
184
+ current_default_path == o.current_default_path &&
185
+ current_sha256 == o.current_sha256 &&
186
+ index == o.index &&
187
+ merchant_item_id == o.merchant_item_id &&
188
+ merchant_item_oid == o.merchant_item_oid &&
189
+ message == o.message &&
190
+ previous_default_oid == o.previous_default_oid &&
191
+ previous_default_path == o.previous_default_path &&
192
+ status == o.status &&
193
+ target_oid == o.target_oid &&
194
+ target_path == o.target_path
195
+ end
196
+
197
+ # @see the `==` method
198
+ # @param [Object] Object to be compared
199
+ def eql?(o)
200
+ self == o
201
+ end
202
+
203
+ # Calculates hash code according to all attributes.
204
+ # @return [Integer] Hash code
205
+ def hash
206
+ [current_default_oid, current_default_path, current_sha256, index, merchant_item_id, merchant_item_oid, message, previous_default_oid, previous_default_path, status, target_oid, target_path].hash
207
+ end
208
+
209
+ # Builds the object from hash
210
+ # @param [Hash] attributes Model attributes in the form of hash
211
+ # @return [Object] Returns the model itself
212
+ def self.build_from_hash(attributes)
213
+ new.build_from_hash(attributes)
214
+ end
215
+
216
+ # Builds the object from hash
217
+ # @param [Hash] attributes Model attributes in the form of hash
218
+ # @return [Object] Returns the model itself
219
+ def build_from_hash(attributes)
220
+ return nil unless attributes.is_a?(Hash)
221
+ attributes = attributes.transform_keys(&:to_sym)
222
+ self.class.openapi_types.each_pair do |key, type|
223
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
224
+ self.send("#{key}=", nil)
225
+ elsif type =~ /\AArray<(.*)>/i
226
+ # check to ensure the input is an array given that the attribute
227
+ # is documented as an array but the input is not
228
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
229
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
230
+ end
231
+ elsif !attributes[self.class.attribute_map[key]].nil?
232
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
233
+ end
234
+ end
235
+
236
+ self
237
+ end
238
+
239
+ # Deserializes the data based on type
240
+ # @param string type Data type
241
+ # @param string value Value to be deserialized
242
+ # @return [Object] Deserialized data
243
+ def _deserialize(type, value)
244
+ case type.to_sym
245
+ when :Time
246
+ Time.parse(value)
247
+ when :Date
248
+ Date.parse(value)
249
+ when :String
250
+ value.to_s
251
+ when :Integer
252
+ value.to_i
253
+ when :Float
254
+ value.to_f
255
+ when :Boolean
256
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
257
+ true
258
+ else
259
+ false
260
+ end
261
+ when :Object
262
+ # generic object (usually a Hash), return directly
263
+ value
264
+ when /\AArray<(?<inner_type>.+)>\z/
265
+ inner_type = Regexp.last_match[:inner_type]
266
+ value.map { |v| _deserialize(inner_type, v) }
267
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
268
+ k_type = Regexp.last_match[:k_type]
269
+ v_type = Regexp.last_match[:v_type]
270
+ {}.tap do |hash|
271
+ value.each do |k, v|
272
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
273
+ end
274
+ end
275
+ else # model
276
+ # models (e.g. Pet) or oneOf
277
+ klass = UltracartClient.const_get(type)
278
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
279
+ end
280
+ end
281
+
282
+ # Returns the string representation of the object
283
+ # @return [String] String presentation of the object
284
+ def to_s
285
+ to_hash.to_s
286
+ end
287
+
288
+ # to_body is an alias to to_hash (backward compatibility)
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_body
291
+ to_hash
292
+ end
293
+
294
+ # Returns the object in the form of hash
295
+ # @return [Hash] Returns the object in the form of hash
296
+ def to_hash
297
+ hash = {}
298
+ self.class.attribute_map.each_pair do |attr, param|
299
+ value = self.send(attr)
300
+ if value.nil?
301
+ is_nullable = self.class.openapi_nullable.include?(attr)
302
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
303
+ end
304
+
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ # Outputs non-array value in the form of hash
311
+ # For object, use to_hash. Otherwise, just return the value
312
+ # @param [Object] value Any valid value
313
+ # @return [Hash] Returns the value in the form of hash
314
+ def _to_hash(value)
315
+ if value.is_a?(Array)
316
+ value.compact.map { |v| _to_hash(v) }
317
+ elsif value.is_a?(Hash)
318
+ {}.tap do |hash|
319
+ value.each { |k, v| hash[k] = _to_hash(v) }
320
+ end
321
+ elsif value.respond_to? :to_hash
322
+ value.to_hash
323
+ else
324
+ value
325
+ end
326
+ end
327
+
328
+ end
329
+
330
+ end
@@ -0,0 +1,270 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbItemDefaultPageRow
18
+ # The dry run's current_sha256 for the item. Required on an apply.
19
+ attr_accessor :current_sha256
20
+
21
+ # Dry run only - the default page the row expects now. A different default makes the row stale.
22
+ attr_accessor :expected_current_path
23
+
24
+ # The item's id. Send this or merchant_item_oid.
25
+ attr_accessor :merchant_item_id
26
+
27
+ # The item's oid. Required on an apply.
28
+ attr_accessor :merchant_item_oid
29
+
30
+ # The page to make the default, by oid. Required on an apply.
31
+ attr_accessor :page_oid
32
+
33
+ # The page to make the default, by path. Send this or page_oid.
34
+ attr_accessor :page_path
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'current_sha256' => :'current_sha256',
40
+ :'expected_current_path' => :'expected_current_path',
41
+ :'merchant_item_id' => :'merchant_item_id',
42
+ :'merchant_item_oid' => :'merchant_item_oid',
43
+ :'page_oid' => :'page_oid',
44
+ :'page_path' => :'page_path'
45
+ }
46
+ end
47
+
48
+ # Returns all the JSON keys this model knows about
49
+ def self.acceptable_attributes
50
+ attribute_map.values
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'current_sha256' => :'String',
57
+ :'expected_current_path' => :'String',
58
+ :'merchant_item_id' => :'String',
59
+ :'merchant_item_oid' => :'Integer',
60
+ :'page_oid' => :'Integer',
61
+ :'page_path' => :'String'
62
+ }
63
+ end
64
+
65
+ # List of attributes with nullable: true
66
+ def self.openapi_nullable
67
+ Set.new([
68
+ ])
69
+ end
70
+
71
+ # Initializes the object
72
+ # @param [Hash] attributes Model attributes in the form of hash
73
+ def initialize(attributes = {})
74
+ if (!attributes.is_a?(Hash))
75
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemDefaultPageRow` initialize method"
76
+ end
77
+
78
+ # check to see if the attribute exists and convert string to symbol for hash key
79
+ attributes = attributes.each_with_object({}) { |(k, v), h|
80
+ if (!self.class.attribute_map.key?(k.to_sym))
81
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemDefaultPageRow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
82
+ end
83
+ h[k.to_sym] = v
84
+ }
85
+
86
+ if attributes.key?(:'current_sha256')
87
+ self.current_sha256 = attributes[:'current_sha256']
88
+ end
89
+
90
+ if attributes.key?(:'expected_current_path')
91
+ self.expected_current_path = attributes[:'expected_current_path']
92
+ end
93
+
94
+ if attributes.key?(:'merchant_item_id')
95
+ self.merchant_item_id = attributes[:'merchant_item_id']
96
+ end
97
+
98
+ if attributes.key?(:'merchant_item_oid')
99
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
100
+ end
101
+
102
+ if attributes.key?(:'page_oid')
103
+ self.page_oid = attributes[:'page_oid']
104
+ end
105
+
106
+ if attributes.key?(:'page_path')
107
+ self.page_path = attributes[:'page_path']
108
+ end
109
+ end
110
+
111
+ # Show invalid properties with the reasons. Usually used together with valid?
112
+ # @return Array for valid properties with the reasons
113
+ def list_invalid_properties
114
+ invalid_properties = Array.new
115
+ invalid_properties
116
+ end
117
+
118
+ # Check to see if the all the properties in the model are valid
119
+ # @return true if the model is valid
120
+ def valid?
121
+ true
122
+ end
123
+
124
+ # Checks equality by comparing each attribute.
125
+ # @param [Object] Object to be compared
126
+ def ==(o)
127
+ return true if self.equal?(o)
128
+ self.class == o.class &&
129
+ current_sha256 == o.current_sha256 &&
130
+ expected_current_path == o.expected_current_path &&
131
+ merchant_item_id == o.merchant_item_id &&
132
+ merchant_item_oid == o.merchant_item_oid &&
133
+ page_oid == o.page_oid &&
134
+ page_path == o.page_path
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [current_sha256, expected_current_path, merchant_item_id, merchant_item_oid, page_oid, page_path].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ new.build_from_hash(attributes)
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def build_from_hash(attributes)
160
+ return nil unless attributes.is_a?(Hash)
161
+ attributes = attributes.transform_keys(&:to_sym)
162
+ self.class.openapi_types.each_pair do |key, type|
163
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
164
+ self.send("#{key}=", nil)
165
+ elsif type =~ /\AArray<(.*)>/i
166
+ # check to ensure the input is an array given that the attribute
167
+ # is documented as an array but the input is not
168
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
169
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
170
+ end
171
+ elsif !attributes[self.class.attribute_map[key]].nil?
172
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
+ end
174
+ end
175
+
176
+ self
177
+ end
178
+
179
+ # Deserializes the data based on type
180
+ # @param string type Data type
181
+ # @param string value Value to be deserialized
182
+ # @return [Object] Deserialized data
183
+ def _deserialize(type, value)
184
+ case type.to_sym
185
+ when :Time
186
+ Time.parse(value)
187
+ when :Date
188
+ Date.parse(value)
189
+ when :String
190
+ value.to_s
191
+ when :Integer
192
+ value.to_i
193
+ when :Float
194
+ value.to_f
195
+ when :Boolean
196
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
197
+ true
198
+ else
199
+ false
200
+ end
201
+ when :Object
202
+ # generic object (usually a Hash), return directly
203
+ value
204
+ when /\AArray<(?<inner_type>.+)>\z/
205
+ inner_type = Regexp.last_match[:inner_type]
206
+ value.map { |v| _deserialize(inner_type, v) }
207
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
208
+ k_type = Regexp.last_match[:k_type]
209
+ v_type = Regexp.last_match[:v_type]
210
+ {}.tap do |hash|
211
+ value.each do |k, v|
212
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
213
+ end
214
+ end
215
+ else # model
216
+ # models (e.g. Pet) or oneOf
217
+ klass = UltracartClient.const_get(type)
218
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
+ end
220
+ end
221
+
222
+ # Returns the string representation of the object
223
+ # @return [String] String presentation of the object
224
+ def to_s
225
+ to_hash.to_s
226
+ end
227
+
228
+ # to_body is an alias to to_hash (backward compatibility)
229
+ # @return [Hash] Returns the object in the form of hash
230
+ def to_body
231
+ to_hash
232
+ end
233
+
234
+ # Returns the object in the form of hash
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_hash
237
+ hash = {}
238
+ self.class.attribute_map.each_pair do |attr, param|
239
+ value = self.send(attr)
240
+ if value.nil?
241
+ is_nullable = self.class.openapi_nullable.include?(attr)
242
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
243
+ end
244
+
245
+ hash[param] = _to_hash(value)
246
+ end
247
+ hash
248
+ end
249
+
250
+ # Outputs non-array value in the form of hash
251
+ # For object, use to_hash. Otherwise, just return the value
252
+ # @param [Object] value Any valid value
253
+ # @return [Hash] Returns the value in the form of hash
254
+ def _to_hash(value)
255
+ if value.is_a?(Array)
256
+ value.compact.map { |v| _to_hash(v) }
257
+ elsif value.is_a?(Hash)
258
+ {}.tap do |hash|
259
+ value.each { |k, v| hash[k] = _to_hash(v) }
260
+ end
261
+ elsif value.respond_to? :to_hash
262
+ value.to_hash
263
+ else
264
+ value
265
+ end
266
+ end
267
+
268
+ end
269
+
270
+ end