ultracart_api 4.1.199 → 4.1.200

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -2
  3. data/docs/SfvbApi.md +465 -11
  4. data/docs/SfvbApprovalCreateRequest.md +6 -0
  5. data/docs/SfvbApprovalParams.md +23 -3
  6. data/docs/SfvbItemAttributeBatchRequest.md +20 -0
  7. data/docs/SfvbItemAttributeBatchResponse.md +40 -0
  8. data/docs/SfvbItemAttributeBatchRow.md +30 -0
  9. data/docs/SfvbItemAttributeBatchRowResult.md +36 -0
  10. data/docs/SfvbItemPricing.md +38 -0
  11. data/docs/SfvbItemPricingRequest.md +32 -0
  12. data/docs/SfvbItemRelated.md +28 -0
  13. data/docs/SfvbItemRelatedItem.md +22 -0
  14. data/docs/SfvbItemRelatedRequest.md +22 -0
  15. data/docs/SfvbItemVolumeDiscount.md +20 -0
  16. data/lib/ultracart_api/api/sfvb_api.rb +640 -16
  17. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +33 -3
  18. data/lib/ultracart_api/models/sfvb_approval_params.rb +142 -6
  19. data/lib/ultracart_api/models/sfvb_item_attribute_batch_request.rb +232 -0
  20. data/lib/ultracart_api/models/sfvb_item_attribute_batch_response.rb +332 -0
  21. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row.rb +280 -0
  22. data/lib/ultracart_api/models/sfvb_item_attribute_batch_row_result.rb +344 -0
  23. data/lib/ultracart_api/models/sfvb_item_pricing.rb +322 -0
  24. data/lib/ultracart_api/models/sfvb_item_pricing_request.rb +292 -0
  25. data/lib/ultracart_api/models/sfvb_item_related.rb +272 -0
  26. data/lib/ultracart_api/models/sfvb_item_related_item.rb +274 -0
  27. data/lib/ultracart_api/models/sfvb_item_related_request.rb +242 -0
  28. data/lib/ultracart_api/models/sfvb_item_volume_discount.rb +230 -0
  29. data/lib/ultracart_api/version.rb +1 -1
  30. data/lib/ultracart_api.rb +10 -0
  31. metadata +22 -2
@@ -21,6 +21,13 @@ module UltracartClient
21
21
  # For a file.put_script write, the exact script to be written, at most 256 KB. UltraCart reviews it and keeps only its hash, so send the same bytes again on the write. Leave it out for a revert, which names params.version.
22
22
  attr_accessor :content
23
23
 
24
+ attr_accessor :experiment_start
25
+
26
+ # For item.attribute_batch, exactly the rows the batch will send - the dry run's change rows, each with merchant_item_oid and current_sha256. UltraCart keeps only their hash.
27
+ attr_accessor :item_attribute_rows
28
+
29
+ attr_accessor :item_pricing
30
+
24
31
  attr_accessor :params
25
32
 
26
33
  # Why the agent wants to do this, in a sentence. Shown to the person as unverified text, capped at 500 characters.
@@ -56,6 +63,9 @@ module UltracartClient
56
63
  {
57
64
  :'action' => :'action',
58
65
  :'content' => :'content',
66
+ :'experiment_start' => :'experiment_start',
67
+ :'item_attribute_rows' => :'item_attribute_rows',
68
+ :'item_pricing' => :'item_pricing',
59
69
  :'params' => :'params',
60
70
  :'reason' => :'reason',
61
71
  :'redirect_rows' => :'redirect_rows'
@@ -72,6 +82,9 @@ module UltracartClient
72
82
  {
73
83
  :'action' => :'String',
74
84
  :'content' => :'String',
85
+ :'experiment_start' => :'SfvbExperimentStartRequest',
86
+ :'item_attribute_rows' => :'Array<SfvbItemAttributeBatchRow>',
87
+ :'item_pricing' => :'SfvbItemPricingRequest',
75
88
  :'params' => :'SfvbApprovalParams',
76
89
  :'reason' => :'String',
77
90
  :'redirect_rows' => :'Array<SfvbRedirectDeleteRow>'
@@ -107,6 +120,20 @@ module UltracartClient
107
120
  self.content = attributes[:'content']
108
121
  end
109
122
 
123
+ if attributes.key?(:'experiment_start')
124
+ self.experiment_start = attributes[:'experiment_start']
125
+ end
126
+
127
+ if attributes.key?(:'item_attribute_rows')
128
+ if (value = attributes[:'item_attribute_rows']).is_a?(Array)
129
+ self.item_attribute_rows = value
130
+ end
131
+ end
132
+
133
+ if attributes.key?(:'item_pricing')
134
+ self.item_pricing = attributes[:'item_pricing']
135
+ end
136
+
110
137
  if attributes.key?(:'params')
111
138
  self.params = attributes[:'params']
112
139
  end
@@ -132,7 +159,7 @@ module UltracartClient
132
159
  # Check to see if the all the properties in the model are valid
133
160
  # @return true if the model is valid
134
161
  def valid?
135
- action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch"])
162
+ action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing"])
136
163
  return false unless action_validator.valid?(@action)
137
164
  true
138
165
  end
@@ -140,7 +167,7 @@ module UltracartClient
140
167
  # Custom attribute writer method checking allowed values (enum).
141
168
  # @param [Object] action Object to be assigned
142
169
  def action=(action)
143
- validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch"])
170
+ validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing"])
144
171
  unless validator.valid?(action)
145
172
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
146
173
  end
@@ -154,6 +181,9 @@ module UltracartClient
154
181
  self.class == o.class &&
155
182
  action == o.action &&
156
183
  content == o.content &&
184
+ experiment_start == o.experiment_start &&
185
+ item_attribute_rows == o.item_attribute_rows &&
186
+ item_pricing == o.item_pricing &&
157
187
  params == o.params &&
158
188
  reason == o.reason &&
159
189
  redirect_rows == o.redirect_rows
@@ -168,7 +198,7 @@ module UltracartClient
168
198
  # Calculates hash code according to all attributes.
169
199
  # @return [Integer] Hash code
170
200
  def hash
171
- [action, content, params, reason, redirect_rows].hash
201
+ [action, content, experiment_start, item_attribute_rows, item_pricing, params, reason, redirect_rows].hash
172
202
  end
173
203
 
174
204
  # Builds the object from hash
@@ -15,33 +15,95 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class SfvbApprovalParams
18
+ # For item.attribute_batch, the attributes the batch would change. Set by the server.
19
+ attr_accessor :attribute_names
20
+
18
21
  # The blog post, for blog_post.delete.
19
22
  attr_accessor :blog_post_oid
20
23
 
21
24
  # For file.put_script, the SHA-256 of the exact bytes approved. Set by the server, never by the caller. The write must send bytes with this hash.
22
25
  attr_accessor :content_sha256
23
26
 
24
- # The file path, for file.delete and file.put_script. Exactly as the gated call will send it.
27
+ # For experiment.end, the experiment to end.
28
+ attr_accessor :experiment_oid
29
+
30
+ # For item.attribute_batch, how many items the batch would change when it was requested. Set by the server.
31
+ attr_accessor :item_count
32
+
33
+ # For item.pricing, the item whose pricing changes.
34
+ attr_accessor :merchant_item_oid
35
+
36
+ # The file path, for file.delete and file.put_script, or the page path for experiment.start of a page experiment. Exactly as the gated call will send it.
25
37
  attr_accessor :path
26
38
 
27
- # For redirect.delete_batch, the plan_hash of the exact rows approved. Set by the server. The batch delete must send rows with this hash.
39
+ # For experiment.start of a url experiment, the hash of the checked experiment approved, and for item.pricing the hash of the change. Set by the server. The gated call must send the same.
40
+ attr_accessor :request_sha256
41
+
42
+ # For redirect.delete_batch and item.attribute_batch, the plan_hash of the exact rows approved. Set by the server. The batch must send rows with this hash.
28
43
  attr_accessor :rows_sha256
29
44
 
30
45
  # For redirect.delete_batch, how many rules the batch would delete when it was requested. Set by the server.
31
46
  attr_accessor :rule_count
32
47
 
48
+ # For experiment.start of a page experiment, the page body name. Defaults to body.
49
+ attr_accessor :slot
50
+
51
+ # For upsell.enable, what to switch on.
52
+ attr_accessor :upsell_kind
53
+
54
+ # For upsell.enable, the oid of the offer or path to switch on.
55
+ attr_accessor :upsell_oid
56
+
33
57
  # For file.put_script, the history version a revert restores. Leave it out, and send content instead, for a write.
34
58
  attr_accessor :version
35
59
 
60
+ # For experiment.start of a page experiment, the id of the experiment element.
61
+ attr_accessor :widget_id
62
+
63
+ # For experiment.end, the winning variation. Leave it out to end without a winner, and leave it out of the end call too.
64
+ attr_accessor :winner_variation_number
65
+
66
+ class EnumAttributeValidator
67
+ attr_reader :datatype
68
+ attr_reader :allowable_values
69
+
70
+ def initialize(datatype, allowable_values)
71
+ @allowable_values = allowable_values.map do |value|
72
+ case datatype.to_s
73
+ when /Integer/i
74
+ value.to_i
75
+ when /Float/i
76
+ value.to_f
77
+ else
78
+ value
79
+ end
80
+ end
81
+ end
82
+
83
+ def valid?(value)
84
+ !value || allowable_values.include?(value)
85
+ end
86
+ end
87
+
36
88
  # Attribute mapping from ruby-style variable name to JSON key.
37
89
  def self.attribute_map
38
90
  {
91
+ :'attribute_names' => :'attribute_names',
39
92
  :'blog_post_oid' => :'blog_post_oid',
40
93
  :'content_sha256' => :'content_sha256',
94
+ :'experiment_oid' => :'experiment_oid',
95
+ :'item_count' => :'item_count',
96
+ :'merchant_item_oid' => :'merchant_item_oid',
41
97
  :'path' => :'path',
98
+ :'request_sha256' => :'request_sha256',
42
99
  :'rows_sha256' => :'rows_sha256',
43
100
  :'rule_count' => :'rule_count',
44
- :'version' => :'version'
101
+ :'slot' => :'slot',
102
+ :'upsell_kind' => :'upsell_kind',
103
+ :'upsell_oid' => :'upsell_oid',
104
+ :'version' => :'version',
105
+ :'widget_id' => :'widget_id',
106
+ :'winner_variation_number' => :'winner_variation_number'
45
107
  }
46
108
  end
47
109
 
@@ -53,12 +115,22 @@ module UltracartClient
53
115
  # Attribute type mapping.
54
116
  def self.openapi_types
55
117
  {
118
+ :'attribute_names' => :'Array<String>',
56
119
  :'blog_post_oid' => :'Integer',
57
120
  :'content_sha256' => :'String',
121
+ :'experiment_oid' => :'Integer',
122
+ :'item_count' => :'Integer',
123
+ :'merchant_item_oid' => :'Integer',
58
124
  :'path' => :'String',
125
+ :'request_sha256' => :'String',
59
126
  :'rows_sha256' => :'String',
60
127
  :'rule_count' => :'Integer',
61
- :'version' => :'Integer'
128
+ :'slot' => :'String',
129
+ :'upsell_kind' => :'String',
130
+ :'upsell_oid' => :'Integer',
131
+ :'version' => :'Integer',
132
+ :'widget_id' => :'String',
133
+ :'winner_variation_number' => :'Integer'
62
134
  }
63
135
  end
64
136
 
@@ -83,6 +155,12 @@ module UltracartClient
83
155
  h[k.to_sym] = v
84
156
  }
85
157
 
158
+ if attributes.key?(:'attribute_names')
159
+ if (value = attributes[:'attribute_names']).is_a?(Array)
160
+ self.attribute_names = value
161
+ end
162
+ end
163
+
86
164
  if attributes.key?(:'blog_post_oid')
87
165
  self.blog_post_oid = attributes[:'blog_post_oid']
88
166
  end
@@ -91,10 +169,26 @@ module UltracartClient
91
169
  self.content_sha256 = attributes[:'content_sha256']
92
170
  end
93
171
 
172
+ if attributes.key?(:'experiment_oid')
173
+ self.experiment_oid = attributes[:'experiment_oid']
174
+ end
175
+
176
+ if attributes.key?(:'item_count')
177
+ self.item_count = attributes[:'item_count']
178
+ end
179
+
180
+ if attributes.key?(:'merchant_item_oid')
181
+ self.merchant_item_oid = attributes[:'merchant_item_oid']
182
+ end
183
+
94
184
  if attributes.key?(:'path')
95
185
  self.path = attributes[:'path']
96
186
  end
97
187
 
188
+ if attributes.key?(:'request_sha256')
189
+ self.request_sha256 = attributes[:'request_sha256']
190
+ end
191
+
98
192
  if attributes.key?(:'rows_sha256')
99
193
  self.rows_sha256 = attributes[:'rows_sha256']
100
194
  end
@@ -103,9 +197,29 @@ module UltracartClient
103
197
  self.rule_count = attributes[:'rule_count']
104
198
  end
105
199
 
200
+ if attributes.key?(:'slot')
201
+ self.slot = attributes[:'slot']
202
+ end
203
+
204
+ if attributes.key?(:'upsell_kind')
205
+ self.upsell_kind = attributes[:'upsell_kind']
206
+ end
207
+
208
+ if attributes.key?(:'upsell_oid')
209
+ self.upsell_oid = attributes[:'upsell_oid']
210
+ end
211
+
106
212
  if attributes.key?(:'version')
107
213
  self.version = attributes[:'version']
108
214
  end
215
+
216
+ if attributes.key?(:'widget_id')
217
+ self.widget_id = attributes[:'widget_id']
218
+ end
219
+
220
+ if attributes.key?(:'winner_variation_number')
221
+ self.winner_variation_number = attributes[:'winner_variation_number']
222
+ end
109
223
  end
110
224
 
111
225
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -118,20 +232,42 @@ module UltracartClient
118
232
  # Check to see if the all the properties in the model are valid
119
233
  # @return true if the model is valid
120
234
  def valid?
235
+ upsell_kind_validator = EnumAttributeValidator.new('String', ["offer", "path"])
236
+ return false unless upsell_kind_validator.valid?(@upsell_kind)
121
237
  true
122
238
  end
123
239
 
240
+ # Custom attribute writer method checking allowed values (enum).
241
+ # @param [Object] upsell_kind Object to be assigned
242
+ def upsell_kind=(upsell_kind)
243
+ validator = EnumAttributeValidator.new('String', ["offer", "path"])
244
+ unless validator.valid?(upsell_kind)
245
+ fail ArgumentError, "invalid value for \"upsell_kind\", must be one of #{validator.allowable_values}."
246
+ end
247
+ @upsell_kind = upsell_kind
248
+ end
249
+
124
250
  # Checks equality by comparing each attribute.
125
251
  # @param [Object] Object to be compared
126
252
  def ==(o)
127
253
  return true if self.equal?(o)
128
254
  self.class == o.class &&
255
+ attribute_names == o.attribute_names &&
129
256
  blog_post_oid == o.blog_post_oid &&
130
257
  content_sha256 == o.content_sha256 &&
258
+ experiment_oid == o.experiment_oid &&
259
+ item_count == o.item_count &&
260
+ merchant_item_oid == o.merchant_item_oid &&
131
261
  path == o.path &&
262
+ request_sha256 == o.request_sha256 &&
132
263
  rows_sha256 == o.rows_sha256 &&
133
264
  rule_count == o.rule_count &&
134
- version == o.version
265
+ slot == o.slot &&
266
+ upsell_kind == o.upsell_kind &&
267
+ upsell_oid == o.upsell_oid &&
268
+ version == o.version &&
269
+ widget_id == o.widget_id &&
270
+ winner_variation_number == o.winner_variation_number
135
271
  end
136
272
 
137
273
  # @see the `==` method
@@ -143,7 +279,7 @@ module UltracartClient
143
279
  # Calculates hash code according to all attributes.
144
280
  # @return [Integer] Hash code
145
281
  def hash
146
- [blog_post_oid, content_sha256, path, rows_sha256, rule_count, version].hash
282
+ [attribute_names, blog_post_oid, content_sha256, experiment_oid, item_count, merchant_item_oid, path, request_sha256, rows_sha256, rule_count, slot, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
147
283
  end
148
284
 
149
285
  # Builds the object from hash
@@ -0,0 +1,232 @@
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 SfvbItemAttributeBatchRequest
18
+ # From the dry run. Required to apply, with exactly the rows the dry run answered as change.
19
+ attr_accessor :plan_hash
20
+
21
+ # The changes, up to 5,000 rows on up to 500 items. Each item and name at most once.
22
+ attr_accessor :rows
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'plan_hash' => :'plan_hash',
28
+ :'rows' => :'rows'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'plan_hash' => :'String',
41
+ :'rows' => :'Array<SfvbItemAttributeBatchRow>'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbItemAttributeBatchRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbItemAttributeBatchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'plan_hash')
67
+ self.plan_hash = attributes[:'plan_hash']
68
+ end
69
+
70
+ if attributes.key?(:'rows')
71
+ if (value = attributes[:'rows']).is_a?(Array)
72
+ self.rows = value
73
+ end
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ plan_hash == o.plan_hash &&
96
+ rows == o.rows
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [plan_hash, rows].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
126
+ self.send("#{key}=", nil)
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = UltracartClient.const_get(type)
180
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end