ultracart_api 4.1.231 → 4.1.232

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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -2
  3. data/docs/ItemContentMultimedia.md +2 -0
  4. data/docs/SfvbApi.md +763 -39
  5. data/docs/SfvbApprovalCreateRequest.md +6 -0
  6. data/docs/SfvbCommsBranchStat.md +20 -0
  7. data/docs/SfvbCommsChange.md +22 -0
  8. data/docs/SfvbCommsClick.md +20 -0
  9. data/docs/SfvbCommsClicksResponse.md +26 -0
  10. data/docs/SfvbCommsDailyStat.md +30 -0
  11. data/docs/SfvbCommsDashboardResponse.md +24 -0
  12. data/docs/SfvbCommsDashboardRow.md +28 -0
  13. data/docs/SfvbCommsPlan.md +66 -0
  14. data/docs/SfvbCommsPlanResponse.md +20 -0
  15. data/docs/SfvbCommsProvider.md +28 -0
  16. data/docs/SfvbCommsProviderImportRequest.md +22 -0
  17. data/docs/SfvbCommsProviderImportResponse.md +26 -0
  18. data/docs/SfvbCommsProviderList.md +20 -0
  19. data/docs/SfvbCommsProvidersResponse.md +22 -0
  20. data/docs/SfvbCommsSender.md +24 -0
  21. data/docs/SfvbCommsSenderUpdate.md +22 -0
  22. data/docs/SfvbCommsSequenceStatsResponse.md +26 -0
  23. data/docs/SfvbCommsSettings.md +34 -0
  24. data/docs/SfvbCommsSettingsResponse.md +24 -0
  25. data/docs/SfvbCommsSettingsUpdateRequest.md +26 -0
  26. data/docs/SfvbCommsStat.md +54 -0
  27. data/docs/SfvbCommsStepStat.md +34 -0
  28. data/docs/SfvbCommsTemplate.md +30 -0
  29. data/docs/SfvbCommsTemplateResponse.md +24 -0
  30. data/docs/SfvbCommsTemplatesResponse.md +20 -0
  31. data/docs/SfvbCommsTestEmailRequest.md +24 -0
  32. data/docs/SfvbCommsTestPostcardRequest.md +36 -0
  33. data/docs/SfvbCommsTestSendResponse.md +32 -0
  34. data/docs/SfvbCommsTestSmsRequest.md +18 -0
  35. data/lib/ultracart_api/api/sfvb_api.rb +982 -10
  36. data/lib/ultracart_api/models/item_content_multimedia.rb +11 -1
  37. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +30 -3
  38. data/lib/ultracart_api/models/sfvb_comms_branch_stat.rb +229 -0
  39. data/lib/ultracart_api/models/sfvb_comms_change.rb +240 -0
  40. data/lib/ultracart_api/models/sfvb_comms_click.rb +230 -0
  41. data/lib/ultracart_api/models/sfvb_comms_clicks_response.rb +264 -0
  42. data/lib/ultracart_api/models/sfvb_comms_daily_stat.rb +280 -0
  43. data/lib/ultracart_api/models/sfvb_comms_dashboard_response.rb +256 -0
  44. data/lib/ultracart_api/models/sfvb_comms_dashboard_row.rb +269 -0
  45. data/lib/ultracart_api/models/sfvb_comms_plan.rb +460 -0
  46. data/lib/ultracart_api/models/sfvb_comms_plan_response.rb +231 -0
  47. data/lib/ultracart_api/models/sfvb_comms_provider.rb +272 -0
  48. data/lib/ultracart_api/models/sfvb_comms_provider_import_request.rb +242 -0
  49. data/lib/ultracart_api/models/sfvb_comms_provider_import_response.rb +264 -0
  50. data/lib/ultracart_api/models/sfvb_comms_provider_list.rb +230 -0
  51. data/lib/ultracart_api/models/sfvb_comms_providers_response.rb +244 -0
  52. data/lib/ultracart_api/models/sfvb_comms_sender.rb +250 -0
  53. data/lib/ultracart_api/models/sfvb_comms_sender_update.rb +240 -0
  54. data/lib/ultracart_api/models/sfvb_comms_sequence_stats_response.rb +263 -0
  55. data/lib/ultracart_api/models/sfvb_comms_settings.rb +297 -0
  56. data/lib/ultracart_api/models/sfvb_comms_settings_response.rb +253 -0
  57. data/lib/ultracart_api/models/sfvb_comms_settings_update_request.rb +257 -0
  58. data/lib/ultracart_api/models/sfvb_comms_stat.rb +402 -0
  59. data/lib/ultracart_api/models/sfvb_comms_step_stat.rb +301 -0
  60. data/lib/ultracart_api/models/sfvb_comms_template.rb +280 -0
  61. data/lib/ultracart_api/models/sfvb_comms_template_response.rb +251 -0
  62. data/lib/ultracart_api/models/sfvb_comms_templates_response.rb +234 -0
  63. data/lib/ultracart_api/models/sfvb_comms_test_email_request.rb +252 -0
  64. data/lib/ultracart_api/models/sfvb_comms_test_postcard_request.rb +312 -0
  65. data/lib/ultracart_api/models/sfvb_comms_test_send_response.rb +292 -0
  66. data/lib/ultracart_api/models/sfvb_comms_test_sms_request.rb +220 -0
  67. data/lib/ultracart_api/version.rb +1 -1
  68. data/lib/ultracart_api.rb +29 -0
  69. metadata +59 -1
@@ -0,0 +1,297 @@
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 SfvbCommsSettings
18
+ # The hash of the settings. Send it as If-Match to change them.
19
+ attr_accessor :hash_sha256
20
+
21
+ # True when opens by mail privacy proxies are ignored. Account-wide; changed in the admin.
22
+ attr_accessor :machine_open_ignore
23
+
24
+ attr_accessor :marketing_sender
25
+
26
+ attr_accessor :postcard_return_address
27
+
28
+ # True when the name, street, city, state and postal code are all set. Until then postcards fall back as the send code does.
29
+ attr_accessor :postcard_return_address_complete
30
+
31
+ # True when a Reviews.io key is set for the account.
32
+ attr_accessor :reviews_io_configured
33
+
34
+ # The default SMS number the admin offers for a new flow or campaign. No send reads it. An SMS step sends from its flow's or campaign's own number.
35
+ attr_accessor :sms_phone_number
36
+
37
+ # The Twilio account that holds sms_phone_number.
38
+ attr_accessor :sms_twilio_uuid
39
+
40
+ attr_accessor :transactional_sender
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'hash_sha256' => :'hash_sha256',
46
+ :'machine_open_ignore' => :'machine_open_ignore',
47
+ :'marketing_sender' => :'marketing_sender',
48
+ :'postcard_return_address' => :'postcard_return_address',
49
+ :'postcard_return_address_complete' => :'postcard_return_address_complete',
50
+ :'reviews_io_configured' => :'reviews_io_configured',
51
+ :'sms_phone_number' => :'sms_phone_number',
52
+ :'sms_twilio_uuid' => :'sms_twilio_uuid',
53
+ :'transactional_sender' => :'transactional_sender'
54
+ }
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'hash_sha256' => :'String',
66
+ :'machine_open_ignore' => :'Boolean',
67
+ :'marketing_sender' => :'SfvbCommsSender',
68
+ :'postcard_return_address' => :'SfvbPostcardAddress',
69
+ :'postcard_return_address_complete' => :'Boolean',
70
+ :'reviews_io_configured' => :'Boolean',
71
+ :'sms_phone_number' => :'String',
72
+ :'sms_twilio_uuid' => :'String',
73
+ :'transactional_sender' => :'SfvbCommsSender'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsSettings` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'hash_sha256')
99
+ self.hash_sha256 = attributes[:'hash_sha256']
100
+ end
101
+
102
+ if attributes.key?(:'machine_open_ignore')
103
+ self.machine_open_ignore = attributes[:'machine_open_ignore']
104
+ end
105
+
106
+ if attributes.key?(:'marketing_sender')
107
+ self.marketing_sender = attributes[:'marketing_sender']
108
+ end
109
+
110
+ if attributes.key?(:'postcard_return_address')
111
+ self.postcard_return_address = attributes[:'postcard_return_address']
112
+ end
113
+
114
+ if attributes.key?(:'postcard_return_address_complete')
115
+ self.postcard_return_address_complete = attributes[:'postcard_return_address_complete']
116
+ end
117
+
118
+ if attributes.key?(:'reviews_io_configured')
119
+ self.reviews_io_configured = attributes[:'reviews_io_configured']
120
+ end
121
+
122
+ if attributes.key?(:'sms_phone_number')
123
+ self.sms_phone_number = attributes[:'sms_phone_number']
124
+ end
125
+
126
+ if attributes.key?(:'sms_twilio_uuid')
127
+ self.sms_twilio_uuid = attributes[:'sms_twilio_uuid']
128
+ end
129
+
130
+ if attributes.key?(:'transactional_sender')
131
+ self.transactional_sender = attributes[:'transactional_sender']
132
+ end
133
+ end
134
+
135
+ # Show invalid properties with the reasons. Usually used together with valid?
136
+ # @return Array for valid properties with the reasons
137
+ def list_invalid_properties
138
+ invalid_properties = Array.new
139
+ invalid_properties
140
+ end
141
+
142
+ # Check to see if the all the properties in the model are valid
143
+ # @return true if the model is valid
144
+ def valid?
145
+ true
146
+ end
147
+
148
+ # Checks equality by comparing each attribute.
149
+ # @param [Object] Object to be compared
150
+ def ==(o)
151
+ return true if self.equal?(o)
152
+ self.class == o.class &&
153
+ hash_sha256 == o.hash_sha256 &&
154
+ machine_open_ignore == o.machine_open_ignore &&
155
+ marketing_sender == o.marketing_sender &&
156
+ postcard_return_address == o.postcard_return_address &&
157
+ postcard_return_address_complete == o.postcard_return_address_complete &&
158
+ reviews_io_configured == o.reviews_io_configured &&
159
+ sms_phone_number == o.sms_phone_number &&
160
+ sms_twilio_uuid == o.sms_twilio_uuid &&
161
+ transactional_sender == o.transactional_sender
162
+ end
163
+
164
+ # @see the `==` method
165
+ # @param [Object] Object to be compared
166
+ def eql?(o)
167
+ self == o
168
+ end
169
+
170
+ # Calculates hash code according to all attributes.
171
+ # @return [Integer] Hash code
172
+ def hash
173
+ [hash_sha256, machine_open_ignore, marketing_sender, postcard_return_address, postcard_return_address_complete, reviews_io_configured, sms_phone_number, sms_twilio_uuid, transactional_sender].hash
174
+ end
175
+
176
+ # Builds the object from hash
177
+ # @param [Hash] attributes Model attributes in the form of hash
178
+ # @return [Object] Returns the model itself
179
+ def self.build_from_hash(attributes)
180
+ new.build_from_hash(attributes)
181
+ end
182
+
183
+ # Builds the object from hash
184
+ # @param [Hash] attributes Model attributes in the form of hash
185
+ # @return [Object] Returns the model itself
186
+ def build_from_hash(attributes)
187
+ return nil unless attributes.is_a?(Hash)
188
+ attributes = attributes.transform_keys(&:to_sym)
189
+ self.class.openapi_types.each_pair do |key, type|
190
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
191
+ self.send("#{key}=", nil)
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
196
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
197
+ end
198
+ elsif !attributes[self.class.attribute_map[key]].nil?
199
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
200
+ end
201
+ end
202
+
203
+ self
204
+ end
205
+
206
+ # Deserializes the data based on type
207
+ # @param string type Data type
208
+ # @param string value Value to be deserialized
209
+ # @return [Object] Deserialized data
210
+ def _deserialize(type, value)
211
+ case type.to_sym
212
+ when :Time
213
+ Time.parse(value)
214
+ when :Date
215
+ Date.parse(value)
216
+ when :String
217
+ value.to_s
218
+ when :Integer
219
+ value.to_i
220
+ when :Float
221
+ value.to_f
222
+ when :Boolean
223
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
224
+ true
225
+ else
226
+ false
227
+ end
228
+ when :Object
229
+ # generic object (usually a Hash), return directly
230
+ value
231
+ when /\AArray<(?<inner_type>.+)>\z/
232
+ inner_type = Regexp.last_match[:inner_type]
233
+ value.map { |v| _deserialize(inner_type, v) }
234
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
235
+ k_type = Regexp.last_match[:k_type]
236
+ v_type = Regexp.last_match[:v_type]
237
+ {}.tap do |hash|
238
+ value.each do |k, v|
239
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
240
+ end
241
+ end
242
+ else # model
243
+ # models (e.g. Pet) or oneOf
244
+ klass = UltracartClient.const_get(type)
245
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
246
+ end
247
+ end
248
+
249
+ # Returns the string representation of the object
250
+ # @return [String] String presentation of the object
251
+ def to_s
252
+ to_hash.to_s
253
+ end
254
+
255
+ # to_body is an alias to to_hash (backward compatibility)
256
+ # @return [Hash] Returns the object in the form of hash
257
+ def to_body
258
+ to_hash
259
+ end
260
+
261
+ # Returns the object in the form of hash
262
+ # @return [Hash] Returns the object in the form of hash
263
+ def to_hash
264
+ hash = {}
265
+ self.class.attribute_map.each_pair do |attr, param|
266
+ value = self.send(attr)
267
+ if value.nil?
268
+ is_nullable = self.class.openapi_nullable.include?(attr)
269
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
270
+ end
271
+
272
+ hash[param] = _to_hash(value)
273
+ end
274
+ hash
275
+ end
276
+
277
+ # Outputs non-array value in the form of hash
278
+ # For object, use to_hash. Otherwise, just return the value
279
+ # @param [Object] value Any valid value
280
+ # @return [Hash] Returns the value in the form of hash
281
+ def _to_hash(value)
282
+ if value.is_a?(Array)
283
+ value.compact.map { |v| _to_hash(v) }
284
+ elsif value.is_a?(Hash)
285
+ {}.tap do |hash|
286
+ value.each { |k, v| hash[k] = _to_hash(v) }
287
+ end
288
+ elsif value.respond_to? :to_hash
289
+ value.to_hash
290
+ else
291
+ value
292
+ end
293
+ end
294
+
295
+ end
296
+
297
+ end
@@ -0,0 +1,253 @@
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 SfvbCommsSettingsResponse
18
+ # Each setting the call changed, or would change on a dry run.
19
+ attr_accessor :changes
20
+
21
+ # True when nothing was written.
22
+ attr_accessor :dry_run
23
+
24
+ # Where each change takes effect.
25
+ attr_accessor :notes
26
+
27
+ attr_accessor :settings
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'changes' => :'changes',
33
+ :'dry_run' => :'dry_run',
34
+ :'notes' => :'notes',
35
+ :'settings' => :'settings'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'changes' => :'Array<SfvbCommsChange>',
48
+ :'dry_run' => :'Boolean',
49
+ :'notes' => :'Array<String>',
50
+ :'settings' => :'SfvbCommsSettings'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsSettingsResponse` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsSettingsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'changes')
76
+ if (value = attributes[:'changes']).is_a?(Array)
77
+ self.changes = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'dry_run')
82
+ self.dry_run = attributes[:'dry_run']
83
+ end
84
+
85
+ if attributes.key?(:'notes')
86
+ if (value = attributes[:'notes']).is_a?(Array)
87
+ self.notes = value
88
+ end
89
+ end
90
+
91
+ if attributes.key?(:'settings')
92
+ self.settings = attributes[:'settings']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ invalid_properties = Array.new
100
+ invalid_properties
101
+ end
102
+
103
+ # Check to see if the all the properties in the model are valid
104
+ # @return true if the model is valid
105
+ def valid?
106
+ true
107
+ end
108
+
109
+ # Checks equality by comparing each attribute.
110
+ # @param [Object] Object to be compared
111
+ def ==(o)
112
+ return true if self.equal?(o)
113
+ self.class == o.class &&
114
+ changes == o.changes &&
115
+ dry_run == o.dry_run &&
116
+ notes == o.notes &&
117
+ settings == o.settings
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [changes, dry_run, notes, settings].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ new.build_from_hash(attributes)
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 build_from_hash(attributes)
143
+ return nil unless attributes.is_a?(Hash)
144
+ attributes = attributes.transform_keys(&:to_sym)
145
+ self.class.openapi_types.each_pair do |key, type|
146
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
147
+ self.send("#{key}=", nil)
148
+ elsif type =~ /\AArray<(.*)>/i
149
+ # check to ensure the input is an array given that the attribute
150
+ # is documented as an array but the input is not
151
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
152
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
153
+ end
154
+ elsif !attributes[self.class.attribute_map[key]].nil?
155
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
156
+ end
157
+ end
158
+
159
+ self
160
+ end
161
+
162
+ # Deserializes the data based on type
163
+ # @param string type Data type
164
+ # @param string value Value to be deserialized
165
+ # @return [Object] Deserialized data
166
+ def _deserialize(type, value)
167
+ case type.to_sym
168
+ when :Time
169
+ Time.parse(value)
170
+ when :Date
171
+ Date.parse(value)
172
+ when :String
173
+ value.to_s
174
+ when :Integer
175
+ value.to_i
176
+ when :Float
177
+ value.to_f
178
+ when :Boolean
179
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
180
+ true
181
+ else
182
+ false
183
+ end
184
+ when :Object
185
+ # generic object (usually a Hash), return directly
186
+ value
187
+ when /\AArray<(?<inner_type>.+)>\z/
188
+ inner_type = Regexp.last_match[:inner_type]
189
+ value.map { |v| _deserialize(inner_type, v) }
190
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
191
+ k_type = Regexp.last_match[:k_type]
192
+ v_type = Regexp.last_match[:v_type]
193
+ {}.tap do |hash|
194
+ value.each do |k, v|
195
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
196
+ end
197
+ end
198
+ else # model
199
+ # models (e.g. Pet) or oneOf
200
+ klass = UltracartClient.const_get(type)
201
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
202
+ end
203
+ end
204
+
205
+ # Returns the string representation of the object
206
+ # @return [String] String presentation of the object
207
+ def to_s
208
+ to_hash.to_s
209
+ end
210
+
211
+ # to_body is an alias to to_hash (backward compatibility)
212
+ # @return [Hash] Returns the object in the form of hash
213
+ def to_body
214
+ to_hash
215
+ end
216
+
217
+ # Returns the object in the form of hash
218
+ # @return [Hash] Returns the object in the form of hash
219
+ def to_hash
220
+ hash = {}
221
+ self.class.attribute_map.each_pair do |attr, param|
222
+ value = self.send(attr)
223
+ if value.nil?
224
+ is_nullable = self.class.openapi_nullable.include?(attr)
225
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
226
+ end
227
+
228
+ hash[param] = _to_hash(value)
229
+ end
230
+ hash
231
+ end
232
+
233
+ # Outputs non-array value in the form of hash
234
+ # For object, use to_hash. Otherwise, just return the value
235
+ # @param [Object] value Any valid value
236
+ # @return [Hash] Returns the value in the form of hash
237
+ def _to_hash(value)
238
+ if value.is_a?(Array)
239
+ value.compact.map { |v| _to_hash(v) }
240
+ elsif value.is_a?(Hash)
241
+ {}.tap do |hash|
242
+ value.each { |k, v| hash[k] = _to_hash(v) }
243
+ end
244
+ elsif value.respond_to? :to_hash
245
+ value.to_hash
246
+ else
247
+ value
248
+ end
249
+ end
250
+
251
+ end
252
+
253
+ end