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