ultracart_api 4.1.232 → 4.1.233

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -2
  3. data/docs/SfvbApi.md +799 -25
  4. data/docs/SfvbApprovalCreateRequest.md +2 -0
  5. data/docs/SfvbCampaign.md +4 -0
  6. data/docs/SfvbCampaignWriteRequest.md +2 -0
  7. data/docs/SfvbCommsLookupOwner.md +26 -0
  8. data/docs/SfvbCommsLookupResponse.md +34 -0
  9. data/docs/SfvbCommsRulerValidateRequest.md +18 -0
  10. data/docs/SfvbCommsRulerValidateResponse.md +22 -0
  11. data/docs/SfvbCommsSequenceFolder.md +28 -0
  12. data/docs/SfvbCommsSequenceFolderResponse.md +22 -0
  13. data/docs/SfvbCommsSequenceFoldersResponse.md +18 -0
  14. data/docs/SfvbCommsStat.md +1 -1
  15. data/docs/SfvbCommsTemplateResponse.md +8 -2
  16. data/docs/SfvbCommsUnreferencedEmail.md +30 -0
  17. data/docs/SfvbCommsUnreferencedPostcard.md +24 -0
  18. data/docs/SfvbCommsUnreferencedResponse.md +32 -0
  19. data/docs/SfvbEmail.md +8 -0
  20. data/docs/SfvbFlow.md +4 -0
  21. data/docs/SfvbFlowBackfillRequest.md +24 -0
  22. data/docs/SfvbFlowBackfillResponse.md +38 -0
  23. data/docs/SfvbFlowWriteRequest.md +2 -0
  24. data/docs/SfvbStepCounts.md +1 -1
  25. data/lib/ultracart_api/api/sfvb_api.rb +1098 -62
  26. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +12 -3
  27. data/lib/ultracart_api/models/sfvb_campaign.rb +21 -1
  28. data/lib/ultracart_api/models/sfvb_campaign_write_request.rb +11 -1
  29. data/lib/ultracart_api/models/sfvb_comms_lookup_owner.rb +260 -0
  30. data/lib/ultracart_api/models/sfvb_comms_lookup_response.rb +301 -0
  31. data/lib/ultracart_api/models/sfvb_comms_ruler_validate_request.rb +220 -0
  32. data/lib/ultracart_api/models/sfvb_comms_ruler_validate_response.rb +242 -0
  33. data/lib/ultracart_api/models/sfvb_comms_sequence_folder.rb +270 -0
  34. data/lib/ultracart_api/models/sfvb_comms_sequence_folder_response.rb +243 -0
  35. data/lib/ultracart_api/models/sfvb_comms_sequence_folders_response.rb +222 -0
  36. data/lib/ultracart_api/models/sfvb_comms_stat.rb +1 -1
  37. data/lib/ultracart_api/models/sfvb_comms_template_response.rb +35 -5
  38. data/lib/ultracart_api/models/sfvb_comms_unreferenced_email.rb +280 -0
  39. data/lib/ultracart_api/models/sfvb_comms_unreferenced_postcard.rb +250 -0
  40. data/lib/ultracart_api/models/sfvb_comms_unreferenced_response.rb +296 -0
  41. data/lib/ultracart_api/models/sfvb_email.rb +41 -1
  42. data/lib/ultracart_api/models/sfvb_flow.rb +21 -1
  43. data/lib/ultracart_api/models/sfvb_flow_backfill_request.rb +250 -0
  44. data/lib/ultracart_api/models/sfvb_flow_backfill_response.rb +322 -0
  45. data/lib/ultracart_api/models/sfvb_flow_write_request.rb +11 -1
  46. data/lib/ultracart_api/models/sfvb_step_counts.rb +1 -1
  47. data/lib/ultracart_api/version.rb +1 -1
  48. data/lib/ultracart_api.rb +12 -0
  49. metadata +26 -2
@@ -29,6 +29,8 @@ module UltracartClient
29
29
 
30
30
  attr_accessor :experiment_start
31
31
 
32
+ attr_accessor :flow_backfill
33
+
32
34
  # 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.
33
35
  attr_accessor :item_attribute_rows
34
36
 
@@ -85,6 +87,7 @@ module UltracartClient
85
87
  :'comms_settings' => :'comms_settings',
86
88
  :'content' => :'content',
87
89
  :'experiment_start' => :'experiment_start',
90
+ :'flow_backfill' => :'flow_backfill',
88
91
  :'item_attribute_rows' => :'item_attribute_rows',
89
92
  :'item_pricing' => :'item_pricing',
90
93
  :'params' => :'params',
@@ -113,6 +116,7 @@ module UltracartClient
113
116
  :'comms_settings' => :'SfvbCommsSettingsUpdateRequest',
114
117
  :'content' => :'String',
115
118
  :'experiment_start' => :'SfvbExperimentStartRequest',
119
+ :'flow_backfill' => :'SfvbFlowBackfillRequest',
116
120
  :'item_attribute_rows' => :'Array<SfvbItemAttributeBatchRow>',
117
121
  :'item_pricing' => :'SfvbItemPricingRequest',
118
122
  :'params' => :'SfvbApprovalParams',
@@ -172,6 +176,10 @@ module UltracartClient
172
176
  self.experiment_start = attributes[:'experiment_start']
173
177
  end
174
178
 
179
+ if attributes.key?(:'flow_backfill')
180
+ self.flow_backfill = attributes[:'flow_backfill']
181
+ end
182
+
175
183
  if attributes.key?(:'item_attribute_rows')
176
184
  if (value = attributes[:'item_attribute_rows']).is_a?(Array)
177
185
  self.item_attribute_rows = value
@@ -231,7 +239,7 @@ module UltracartClient
231
239
  # Check to see if the all the properties in the model are valid
232
240
  # @return true if the model is valid
233
241
  def valid?
234
- 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", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail"])
242
+ 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", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail", "flow.backfill"])
235
243
  return false unless action_validator.valid?(@action)
236
244
  true
237
245
  end
@@ -239,7 +247,7 @@ module UltracartClient
239
247
  # Custom attribute writer method checking allowed values (enum).
240
248
  # @param [Object] action Object to be assigned
241
249
  def action=(action)
242
- 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", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail"])
250
+ 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", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete", "site_seo.change", "transactional_email.update", "comms_settings.update", "comms_list.import", "postcard.test_mail", "flow.backfill"])
243
251
  unless validator.valid?(action)
244
252
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
245
253
  end
@@ -257,6 +265,7 @@ module UltracartClient
257
265
  comms_settings == o.comms_settings &&
258
266
  content == o.content &&
259
267
  experiment_start == o.experiment_start &&
268
+ flow_backfill == o.flow_backfill &&
260
269
  item_attribute_rows == o.item_attribute_rows &&
261
270
  item_pricing == o.item_pricing &&
262
271
  params == o.params &&
@@ -279,7 +288,7 @@ module UltracartClient
279
288
  # Calculates hash code according to all attributes.
280
289
  # @return [Integer] Hash code
281
290
  def hash
282
- [action, affiliate_network, comms_list_import, comms_settings, content, experiment_start, item_attribute_rows, item_pricing, params, postcard_test_mail, reason, redirect_rows, segment_update, site_seo, smart_attribution, tracking_provider, transactional_email].hash
291
+ [action, affiliate_network, comms_list_import, comms_settings, content, experiment_start, flow_backfill, item_attribute_rows, item_pricing, params, postcard_test_mail, reason, redirect_rows, segment_update, site_seo, smart_attribution, tracking_provider, transactional_email].hash
283
292
  end
284
293
 
285
294
  # Builds the object from hash
@@ -36,6 +36,12 @@ module UltracartClient
36
36
  # True when a customer leaves the campaign once they buy from any source.
37
37
  attr_accessor :end_once_customer_purchases_anywhere
38
38
 
39
+ # That folder's name.
40
+ attr_accessor :folder_name
41
+
42
+ # The campaign folder it is filed in, or none.
43
+ attr_accessor :folder_uuid
44
+
39
45
  # Send this as If-Match when changing or archiving the campaign.
40
46
  attr_accessor :hash_sha256
41
47
 
@@ -85,6 +91,8 @@ module UltracartClient
85
91
  :'emails' => :'emails',
86
92
  :'end_once_customer_purchases' => :'end_once_customer_purchases',
87
93
  :'end_once_customer_purchases_anywhere' => :'end_once_customer_purchases_anywhere',
94
+ :'folder_name' => :'folder_name',
95
+ :'folder_uuid' => :'folder_uuid',
88
96
  :'hash_sha256' => :'hash_sha256',
89
97
  :'live' => :'live',
90
98
  :'memberships' => :'memberships',
@@ -116,6 +124,8 @@ module UltracartClient
116
124
  :'emails' => :'Array<SfvbCommsEmail>',
117
125
  :'end_once_customer_purchases' => :'Boolean',
118
126
  :'end_once_customer_purchases_anywhere' => :'Boolean',
127
+ :'folder_name' => :'String',
128
+ :'folder_uuid' => :'String',
119
129
  :'hash_sha256' => :'String',
120
130
  :'live' => :'Boolean',
121
131
  :'memberships' => :'Array<SfvbCampaignMembership>',
@@ -183,6 +193,14 @@ module UltracartClient
183
193
  self.end_once_customer_purchases_anywhere = attributes[:'end_once_customer_purchases_anywhere']
184
194
  end
185
195
 
196
+ if attributes.key?(:'folder_name')
197
+ self.folder_name = attributes[:'folder_name']
198
+ end
199
+
200
+ if attributes.key?(:'folder_uuid')
201
+ self.folder_uuid = attributes[:'folder_uuid']
202
+ end
203
+
186
204
  if attributes.key?(:'hash_sha256')
187
205
  self.hash_sha256 = attributes[:'hash_sha256']
188
206
  end
@@ -267,6 +285,8 @@ module UltracartClient
267
285
  emails == o.emails &&
268
286
  end_once_customer_purchases == o.end_once_customer_purchases &&
269
287
  end_once_customer_purchases_anywhere == o.end_once_customer_purchases_anywhere &&
288
+ folder_name == o.folder_name &&
289
+ folder_uuid == o.folder_uuid &&
270
290
  hash_sha256 == o.hash_sha256 &&
271
291
  live == o.live &&
272
292
  memberships == o.memberships &&
@@ -291,7 +311,7 @@ module UltracartClient
291
311
  # Calculates hash code according to all attributes.
292
312
  # @return [Integer] Hash code
293
313
  def hash
294
- [campaign_uuid, communication_sequence_uuid, created_dts, deleted, emails, end_once_customer_purchases, end_once_customer_purchases_anywhere, hash_sha256, live, memberships, name, notes, postcards, scheduled_dts, sending_domain_uuid, sending_name, sending_user, sms_phone_number, status, status_dts].hash
314
+ [campaign_uuid, communication_sequence_uuid, created_dts, deleted, emails, end_once_customer_purchases, end_once_customer_purchases_anywhere, folder_name, folder_uuid, hash_sha256, live, memberships, name, notes, postcards, scheduled_dts, sending_domain_uuid, sending_name, sending_user, sms_phone_number, status, status_dts].hash
295
315
  end
296
316
 
297
317
  # Builds the object from hash
@@ -21,6 +21,9 @@ module UltracartClient
21
21
  # True to end the campaign for a customer once they buy from any source.
22
22
  attr_accessor :end_once_customer_purchases_anywhere
23
23
 
24
+ # File it in this campaign folder. An empty value takes it out of its folder.
25
+ attr_accessor :folder_uuid
26
+
24
27
  # The lists and segments it sends to or leaves out. Replaces the whole set. An empty array clears it.
25
28
  attr_accessor :memberships
26
29
 
@@ -44,6 +47,7 @@ module UltracartClient
44
47
  {
45
48
  :'end_once_customer_purchases' => :'end_once_customer_purchases',
46
49
  :'end_once_customer_purchases_anywhere' => :'end_once_customer_purchases_anywhere',
50
+ :'folder_uuid' => :'folder_uuid',
47
51
  :'memberships' => :'memberships',
48
52
  :'name' => :'name',
49
53
  :'scheduled_dts' => :'scheduled_dts',
@@ -63,6 +67,7 @@ module UltracartClient
63
67
  {
64
68
  :'end_once_customer_purchases' => :'Boolean',
65
69
  :'end_once_customer_purchases_anywhere' => :'Boolean',
70
+ :'folder_uuid' => :'String',
66
71
  :'memberships' => :'Array<SfvbCampaignMembership>',
67
72
  :'name' => :'String',
68
73
  :'scheduled_dts' => :'String',
@@ -101,6 +106,10 @@ module UltracartClient
101
106
  self.end_once_customer_purchases_anywhere = attributes[:'end_once_customer_purchases_anywhere']
102
107
  end
103
108
 
109
+ if attributes.key?(:'folder_uuid')
110
+ self.folder_uuid = attributes[:'folder_uuid']
111
+ end
112
+
104
113
  if attributes.key?(:'memberships')
105
114
  if (value = attributes[:'memberships']).is_a?(Array)
106
115
  self.memberships = value
@@ -148,6 +157,7 @@ module UltracartClient
148
157
  self.class == o.class &&
149
158
  end_once_customer_purchases == o.end_once_customer_purchases &&
150
159
  end_once_customer_purchases_anywhere == o.end_once_customer_purchases_anywhere &&
160
+ folder_uuid == o.folder_uuid &&
151
161
  memberships == o.memberships &&
152
162
  name == o.name &&
153
163
  scheduled_dts == o.scheduled_dts &&
@@ -165,7 +175,7 @@ module UltracartClient
165
175
  # Calculates hash code according to all attributes.
166
176
  # @return [Integer] Hash code
167
177
  def hash
168
- [end_once_customer_purchases, end_once_customer_purchases_anywhere, memberships, name, scheduled_dts, sending_domain_uuid, sending_name, sending_user].hash
178
+ [end_once_customer_purchases, end_once_customer_purchases_anywhere, folder_uuid, memberships, name, scheduled_dts, sending_domain_uuid, sending_name, sending_user].hash
169
179
  end
170
180
 
171
181
  # Builds the object from hash
@@ -0,0 +1,260 @@
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 SfvbCommsLookupOwner
18
+ # True when it is sending now, by the same rule the sequence read uses.
19
+ attr_accessor :live
20
+
21
+ # Its name.
22
+ attr_accessor :name
23
+
24
+ # Its status as stored.
25
+ attr_accessor :status
26
+
27
+ # campaign or flow.
28
+ attr_accessor :type
29
+
30
+ # The campaign or flow uuid.
31
+ attr_accessor :uuid
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'live' => :'live',
37
+ :'name' => :'name',
38
+ :'status' => :'status',
39
+ :'type' => :'type',
40
+ :'uuid' => :'uuid'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'live' => :'Boolean',
53
+ :'name' => :'String',
54
+ :'status' => :'String',
55
+ :'type' => :'String',
56
+ :'uuid' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsLookupOwner` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsLookupOwner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'live')
82
+ self.live = attributes[:'live']
83
+ end
84
+
85
+ if attributes.key?(:'name')
86
+ self.name = attributes[:'name']
87
+ end
88
+
89
+ if attributes.key?(:'status')
90
+ self.status = attributes[:'status']
91
+ end
92
+
93
+ if attributes.key?(:'type')
94
+ self.type = attributes[:'type']
95
+ end
96
+
97
+ if attributes.key?(:'uuid')
98
+ self.uuid = attributes[:'uuid']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ live == o.live &&
121
+ name == o.name &&
122
+ status == o.status &&
123
+ type == o.type &&
124
+ uuid == o.uuid
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [live, name, status, type, uuid].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ self.class.openapi_types.each_pair do |key, type|
153
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
154
+ self.send("#{key}=", nil)
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = UltracartClient.const_get(type)
208
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+
260
+ end