ultracart_api 4.1.231 → 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 (105) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -2
  3. data/docs/ItemContentMultimedia.md +2 -0
  4. data/docs/SfvbApi.md +1660 -162
  5. data/docs/SfvbApprovalCreateRequest.md +8 -0
  6. data/docs/SfvbCampaign.md +4 -0
  7. data/docs/SfvbCampaignWriteRequest.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/SfvbCommsLookupOwner.md +26 -0
  16. data/docs/SfvbCommsLookupResponse.md +34 -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/SfvbCommsRulerValidateRequest.md +18 -0
  25. data/docs/SfvbCommsRulerValidateResponse.md +22 -0
  26. data/docs/SfvbCommsSender.md +24 -0
  27. data/docs/SfvbCommsSenderUpdate.md +22 -0
  28. data/docs/SfvbCommsSequenceFolder.md +28 -0
  29. data/docs/SfvbCommsSequenceFolderResponse.md +22 -0
  30. data/docs/SfvbCommsSequenceFoldersResponse.md +18 -0
  31. data/docs/SfvbCommsSequenceStatsResponse.md +26 -0
  32. data/docs/SfvbCommsSettings.md +34 -0
  33. data/docs/SfvbCommsSettingsResponse.md +24 -0
  34. data/docs/SfvbCommsSettingsUpdateRequest.md +26 -0
  35. data/docs/SfvbCommsStat.md +54 -0
  36. data/docs/SfvbCommsStepStat.md +34 -0
  37. data/docs/SfvbCommsTemplate.md +30 -0
  38. data/docs/SfvbCommsTemplateResponse.md +30 -0
  39. data/docs/SfvbCommsTemplatesResponse.md +20 -0
  40. data/docs/SfvbCommsTestEmailRequest.md +24 -0
  41. data/docs/SfvbCommsTestPostcardRequest.md +36 -0
  42. data/docs/SfvbCommsTestSendResponse.md +32 -0
  43. data/docs/SfvbCommsTestSmsRequest.md +18 -0
  44. data/docs/SfvbCommsUnreferencedEmail.md +30 -0
  45. data/docs/SfvbCommsUnreferencedPostcard.md +24 -0
  46. data/docs/SfvbCommsUnreferencedResponse.md +32 -0
  47. data/docs/SfvbEmail.md +8 -0
  48. data/docs/SfvbFlow.md +4 -0
  49. data/docs/SfvbFlowBackfillRequest.md +24 -0
  50. data/docs/SfvbFlowBackfillResponse.md +38 -0
  51. data/docs/SfvbFlowWriteRequest.md +2 -0
  52. data/docs/SfvbStepCounts.md +1 -1
  53. data/lib/ultracart_api/api/sfvb_api.rb +2356 -348
  54. data/lib/ultracart_api/models/item_content_multimedia.rb +11 -1
  55. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +39 -3
  56. data/lib/ultracart_api/models/sfvb_campaign.rb +21 -1
  57. data/lib/ultracart_api/models/sfvb_campaign_write_request.rb +11 -1
  58. data/lib/ultracart_api/models/sfvb_comms_branch_stat.rb +229 -0
  59. data/lib/ultracart_api/models/sfvb_comms_change.rb +240 -0
  60. data/lib/ultracart_api/models/sfvb_comms_click.rb +230 -0
  61. data/lib/ultracart_api/models/sfvb_comms_clicks_response.rb +264 -0
  62. data/lib/ultracart_api/models/sfvb_comms_daily_stat.rb +280 -0
  63. data/lib/ultracart_api/models/sfvb_comms_dashboard_response.rb +256 -0
  64. data/lib/ultracart_api/models/sfvb_comms_dashboard_row.rb +269 -0
  65. data/lib/ultracart_api/models/sfvb_comms_lookup_owner.rb +260 -0
  66. data/lib/ultracart_api/models/sfvb_comms_lookup_response.rb +301 -0
  67. data/lib/ultracart_api/models/sfvb_comms_plan.rb +460 -0
  68. data/lib/ultracart_api/models/sfvb_comms_plan_response.rb +231 -0
  69. data/lib/ultracart_api/models/sfvb_comms_provider.rb +272 -0
  70. data/lib/ultracart_api/models/sfvb_comms_provider_import_request.rb +242 -0
  71. data/lib/ultracart_api/models/sfvb_comms_provider_import_response.rb +264 -0
  72. data/lib/ultracart_api/models/sfvb_comms_provider_list.rb +230 -0
  73. data/lib/ultracart_api/models/sfvb_comms_providers_response.rb +244 -0
  74. data/lib/ultracart_api/models/sfvb_comms_ruler_validate_request.rb +220 -0
  75. data/lib/ultracart_api/models/sfvb_comms_ruler_validate_response.rb +242 -0
  76. data/lib/ultracart_api/models/sfvb_comms_sender.rb +250 -0
  77. data/lib/ultracart_api/models/sfvb_comms_sender_update.rb +240 -0
  78. data/lib/ultracart_api/models/sfvb_comms_sequence_folder.rb +270 -0
  79. data/lib/ultracart_api/models/sfvb_comms_sequence_folder_response.rb +243 -0
  80. data/lib/ultracart_api/models/sfvb_comms_sequence_folders_response.rb +222 -0
  81. data/lib/ultracart_api/models/sfvb_comms_sequence_stats_response.rb +263 -0
  82. data/lib/ultracart_api/models/sfvb_comms_settings.rb +297 -0
  83. data/lib/ultracart_api/models/sfvb_comms_settings_response.rb +253 -0
  84. data/lib/ultracart_api/models/sfvb_comms_settings_update_request.rb +257 -0
  85. data/lib/ultracart_api/models/sfvb_comms_stat.rb +402 -0
  86. data/lib/ultracart_api/models/sfvb_comms_step_stat.rb +301 -0
  87. data/lib/ultracart_api/models/sfvb_comms_template.rb +280 -0
  88. data/lib/ultracart_api/models/sfvb_comms_template_response.rb +281 -0
  89. data/lib/ultracart_api/models/sfvb_comms_templates_response.rb +234 -0
  90. data/lib/ultracart_api/models/sfvb_comms_test_email_request.rb +252 -0
  91. data/lib/ultracart_api/models/sfvb_comms_test_postcard_request.rb +312 -0
  92. data/lib/ultracart_api/models/sfvb_comms_test_send_response.rb +292 -0
  93. data/lib/ultracart_api/models/sfvb_comms_test_sms_request.rb +220 -0
  94. data/lib/ultracart_api/models/sfvb_comms_unreferenced_email.rb +280 -0
  95. data/lib/ultracart_api/models/sfvb_comms_unreferenced_postcard.rb +250 -0
  96. data/lib/ultracart_api/models/sfvb_comms_unreferenced_response.rb +296 -0
  97. data/lib/ultracart_api/models/sfvb_email.rb +41 -1
  98. data/lib/ultracart_api/models/sfvb_flow.rb +21 -1
  99. data/lib/ultracart_api/models/sfvb_flow_backfill_request.rb +250 -0
  100. data/lib/ultracart_api/models/sfvb_flow_backfill_response.rb +322 -0
  101. data/lib/ultracart_api/models/sfvb_flow_write_request.rb +11 -1
  102. data/lib/ultracart_api/models/sfvb_step_counts.rb +1 -1
  103. data/lib/ultracart_api/version.rb +1 -1
  104. data/lib/ultracart_api.rb +41 -0
  105. metadata +84 -2
@@ -0,0 +1,281 @@
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 SfvbCommsTemplateResponse
18
+ # The template's body, as CJSON.
19
+ attr_accessor :container_cjson
20
+
21
+ # The Velocity template it renders inside, as stored. It is looked up in the storefront's active theme.
22
+ attr_accessor :email_template_vm_path
23
+
24
+ # What isn't shown.
25
+ attr_accessor :notes
26
+
27
+ attr_accessor :template
28
+
29
+ # True when the file at template_path exists.
30
+ attr_accessor :template_exists
31
+
32
+ # Why there is no template file, or null when there is one.
33
+ attr_accessor :template_note
34
+
35
+ # The theme file that template is, as a render finds it. Read it with the files endpoints, whose read also reports valid and velocity_errors. Null when it couldn't be worked out, with template_note saying why.
36
+ attr_accessor :template_path
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'container_cjson' => :'container_cjson',
42
+ :'email_template_vm_path' => :'email_template_vm_path',
43
+ :'notes' => :'notes',
44
+ :'template' => :'template',
45
+ :'template_exists' => :'template_exists',
46
+ :'template_note' => :'template_note',
47
+ :'template_path' => :'template_path'
48
+ }
49
+ end
50
+
51
+ # Returns all the JSON keys this model knows about
52
+ def self.acceptable_attributes
53
+ attribute_map.values
54
+ end
55
+
56
+ # Attribute type mapping.
57
+ def self.openapi_types
58
+ {
59
+ :'container_cjson' => :'String',
60
+ :'email_template_vm_path' => :'String',
61
+ :'notes' => :'Array<String>',
62
+ :'template' => :'SfvbCommsTemplate',
63
+ :'template_exists' => :'Boolean',
64
+ :'template_note' => :'String',
65
+ :'template_path' => :'String'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbCommsTemplateResponse` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ attributes = attributes.each_with_object({}) { |(k, v), h|
84
+ if (!self.class.attribute_map.key?(k.to_sym))
85
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbCommsTemplateResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ end
87
+ h[k.to_sym] = v
88
+ }
89
+
90
+ if attributes.key?(:'container_cjson')
91
+ self.container_cjson = attributes[:'container_cjson']
92
+ end
93
+
94
+ if attributes.key?(:'email_template_vm_path')
95
+ self.email_template_vm_path = attributes[:'email_template_vm_path']
96
+ end
97
+
98
+ if attributes.key?(:'notes')
99
+ if (value = attributes[:'notes']).is_a?(Array)
100
+ self.notes = value
101
+ end
102
+ end
103
+
104
+ if attributes.key?(:'template')
105
+ self.template = attributes[:'template']
106
+ end
107
+
108
+ if attributes.key?(:'template_exists')
109
+ self.template_exists = attributes[:'template_exists']
110
+ end
111
+
112
+ if attributes.key?(:'template_note')
113
+ self.template_note = attributes[:'template_note']
114
+ end
115
+
116
+ if attributes.key?(:'template_path')
117
+ self.template_path = attributes[:'template_path']
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ invalid_properties = Array.new
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ true
132
+ end
133
+
134
+ # Checks equality by comparing each attribute.
135
+ # @param [Object] Object to be compared
136
+ def ==(o)
137
+ return true if self.equal?(o)
138
+ self.class == o.class &&
139
+ container_cjson == o.container_cjson &&
140
+ email_template_vm_path == o.email_template_vm_path &&
141
+ notes == o.notes &&
142
+ template == o.template &&
143
+ template_exists == o.template_exists &&
144
+ template_note == o.template_note &&
145
+ template_path == o.template_path
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [container_cjson, email_template_vm_path, notes, template, template_exists, template_note, template_path].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ new.build_from_hash(attributes)
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ self.class.openapi_types.each_pair do |key, type|
174
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
175
+ self.send("#{key}=", nil)
176
+ elsif type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
180
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
181
+ end
182
+ elsif !attributes[self.class.attribute_map[key]].nil?
183
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
184
+ end
185
+ end
186
+
187
+ self
188
+ end
189
+
190
+ # Deserializes the data based on type
191
+ # @param string type Data type
192
+ # @param string value Value to be deserialized
193
+ # @return [Object] Deserialized data
194
+ def _deserialize(type, value)
195
+ case type.to_sym
196
+ when :Time
197
+ Time.parse(value)
198
+ when :Date
199
+ Date.parse(value)
200
+ when :String
201
+ value.to_s
202
+ when :Integer
203
+ value.to_i
204
+ when :Float
205
+ value.to_f
206
+ when :Boolean
207
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
+ true
209
+ else
210
+ false
211
+ end
212
+ when :Object
213
+ # generic object (usually a Hash), return directly
214
+ value
215
+ when /\AArray<(?<inner_type>.+)>\z/
216
+ inner_type = Regexp.last_match[:inner_type]
217
+ value.map { |v| _deserialize(inner_type, v) }
218
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
+ k_type = Regexp.last_match[:k_type]
220
+ v_type = Regexp.last_match[:v_type]
221
+ {}.tap do |hash|
222
+ value.each do |k, v|
223
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
+ end
225
+ end
226
+ else # model
227
+ # models (e.g. Pet) or oneOf
228
+ klass = UltracartClient.const_get(type)
229
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -0,0 +1,234 @@
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 SfvbCommsTemplatesResponse
18
+ # What each source is.
19
+ attr_accessor :notes
20
+
21
+ # Saved templates first (system, then this storefront's), then base templates.
22
+ attr_accessor :templates
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'notes' => :'notes',
28
+ :'templates' => :'templates'
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
+ :'notes' => :'Array<String>',
41
+ :'templates' => :'Array<SfvbCommsTemplate>'
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::SfvbCommsTemplatesResponse` 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::SfvbCommsTemplatesResponse`. 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?(:'notes')
67
+ if (value = attributes[:'notes']).is_a?(Array)
68
+ self.notes = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'templates')
73
+ if (value = attributes[:'templates']).is_a?(Array)
74
+ self.templates = value
75
+ end
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ notes == o.notes &&
98
+ templates == o.templates
99
+ end
100
+
101
+ # @see the `==` method
102
+ # @param [Object] Object to be compared
103
+ def eql?(o)
104
+ self == o
105
+ end
106
+
107
+ # Calculates hash code according to all attributes.
108
+ # @return [Integer] Hash code
109
+ def hash
110
+ [notes, templates].hash
111
+ end
112
+
113
+ # Builds the object from hash
114
+ # @param [Hash] attributes Model attributes in the form of hash
115
+ # @return [Object] Returns the model itself
116
+ def self.build_from_hash(attributes)
117
+ new.build_from_hash(attributes)
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+ attributes = attributes.transform_keys(&:to_sym)
126
+ self.class.openapi_types.each_pair do |key, type|
127
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
+ self.send("#{key}=", nil)
129
+ elsif type =~ /\AArray<(.*)>/i
130
+ # check to ensure the input is an array given that the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def _deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = UltracartClient.const_get(type)
182
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+
232
+ end
233
+
234
+ end