ultracart_api 3.1.17 → 3.1.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -4
- data/docs/CouponPercentOffMsrpItems.md +1 -1
- data/docs/CustomerLoyalty.md +1 -0
- data/docs/EmailCampaign.md +2 -1
- data/docs/EmailFlow.md +2 -1
- data/docs/LibraryItemAttribute.md +0 -1
- data/docs/OrderApi.md +5 -1
- data/docs/OrderProcessPaymentRequest.md +1 -0
- data/docs/OrderQuery.md +3 -1
- data/docs/OrderSummary.md +1 -0
- data/docs/ScreenRecording.md +13 -0
- data/docs/ScreenRecordingAdPlatform.md +13 -0
- data/docs/ScreenRecordingFilter.md +12 -0
- data/docs/ScreenRecordingFilterPageView.md +1 -0
- data/docs/ScreenRecordingFilterValues.md +12 -2
- data/docs/ScreenRecordingFilterValuesPageView.md +13 -0
- data/docs/ScreenRecordingHeatmap.md +19 -0
- data/docs/ScreenRecordingHeatmapIndexResponse.md +12 -0
- data/docs/ScreenRecordingHeatmapRequest.md +9 -0
- data/docs/ScreenRecordingHeatmapReset.md +8 -0
- data/docs/ScreenRecordingHeatmapResponse.md +12 -0
- data/docs/ScreenRecordingHeatmapUrl.md +12 -0
- data/docs/ScreenRecordingPageView.md +3 -0
- data/docs/ScreenRecordingPageViewEvent.md +1 -0
- data/docs/ScreenRecordingQueryResponse.md +3 -0
- data/docs/ScreenRecordingSegment.md +3 -0
- data/docs/ScreenRecordingSettings.md +5 -0
- data/docs/StorefrontApi.md +158 -0
- data/docs/TaxJarConfig.md +1 -0
- data/lib/ultracart_api.rb +8 -0
- data/lib/ultracart_api/api/order_api.rb +8 -2
- data/lib/ultracart_api/api/storefront_api.rb +176 -0
- data/lib/ultracart_api/models/coupon_percent_off_msrp_items.rb +1 -1
- data/lib/ultracart_api/models/customer_loyalty.rb +11 -1
- data/lib/ultracart_api/models/email_campaign.rb +12 -2
- data/lib/ultracart_api/models/email_flow.rb +12 -2
- data/lib/ultracart_api/models/library_item_attribute.rb +1 -10
- data/lib/ultracart_api/models/order_process_payment_request.rb +11 -1
- data/lib/ultracart_api/models/order_query.rb +22 -2
- data/lib/ultracart_api/models/order_summary.rb +10 -1
- data/lib/ultracart_api/models/screen_recording.rb +128 -1
- data/lib/ultracart_api/models/screen_recording_ad_platform.rb +235 -0
- data/lib/ultracart_api/models/screen_recording_filter.rb +109 -1
- data/lib/ultracart_api/models/screen_recording_filter_page_view.rb +10 -1
- data/lib/ultracart_api/models/screen_recording_filter_values.rb +124 -18
- data/lib/ultracart_api/models/screen_recording_filter_values_page_view.rb +237 -0
- data/lib/ultracart_api/models/screen_recording_heatmap.rb +283 -0
- data/lib/ultracart_api/models/screen_recording_heatmap_index_response.rb +223 -0
- data/lib/ultracart_api/models/screen_recording_heatmap_request.rb +193 -0
- data/lib/ultracart_api/models/screen_recording_heatmap_reset.rb +184 -0
- data/lib/ultracart_api/models/screen_recording_heatmap_response.rb +221 -0
- data/lib/ultracart_api/models/screen_recording_heatmap_url.rb +222 -0
- data/lib/ultracart_api/models/screen_recording_page_view.rb +30 -1
- data/lib/ultracart_api/models/screen_recording_page_view_event.rb +10 -1
- data/lib/ultracart_api/models/screen_recording_query_response.rb +30 -1
- data/lib/ultracart_api/models/screen_recording_segment.rb +30 -1
- data/lib/ultracart_api/models/screen_recording_settings.rb +49 -4
- data/lib/ultracart_api/models/tax_jar_config.rb +11 -1
- data/lib/ultracart_api/version.rb +1 -1
- metadata +18 -2
@@ -14,6 +14,8 @@ require 'date'
|
|
14
14
|
|
15
15
|
module UltracartClient
|
16
16
|
class ScreenRecordingFilterPageView
|
17
|
+
attr_accessor :domain
|
18
|
+
|
17
19
|
attr_accessor :events
|
18
20
|
|
19
21
|
attr_accessor :params
|
@@ -31,6 +33,7 @@ module UltracartClient
|
|
31
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
34
|
def self.attribute_map
|
33
35
|
{
|
36
|
+
:'domain' => :'domain',
|
34
37
|
:'events' => :'events',
|
35
38
|
:'params' => :'params',
|
36
39
|
:'referrer' => :'referrer',
|
@@ -44,6 +47,7 @@ module UltracartClient
|
|
44
47
|
# Attribute type mapping.
|
45
48
|
def self.swagger_types
|
46
49
|
{
|
50
|
+
:'domain' => :'ScreenRecordingFilterStringSearch',
|
47
51
|
:'events' => :'Array<ScreenRecordingFilterPageViewEvent>',
|
48
52
|
:'params' => :'Array<ScreenRecordingFilterPageViewParam>',
|
49
53
|
:'referrer' => :'ScreenRecordingFilterStringSearch',
|
@@ -62,6 +66,10 @@ module UltracartClient
|
|
62
66
|
# convert string to symbol for hash key
|
63
67
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
64
68
|
|
69
|
+
if attributes.has_key?(:'domain')
|
70
|
+
self.domain = attributes[:'domain']
|
71
|
+
end
|
72
|
+
|
65
73
|
if attributes.has_key?(:'events')
|
66
74
|
if (value = attributes[:'events']).is_a?(Array)
|
67
75
|
self.events = value
|
@@ -115,6 +123,7 @@ module UltracartClient
|
|
115
123
|
def ==(o)
|
116
124
|
return true if self.equal?(o)
|
117
125
|
self.class == o.class &&
|
126
|
+
domain == o.domain &&
|
118
127
|
events == o.events &&
|
119
128
|
params == o.params &&
|
120
129
|
referrer == o.referrer &&
|
@@ -133,7 +142,7 @@ module UltracartClient
|
|
133
142
|
# Calculates hash code according to all attributes.
|
134
143
|
# @return [Fixnum] Hash code
|
135
144
|
def hash
|
136
|
-
[events, params, referrer, referrer_params, referrer_raw, time_on_page, url].hash
|
145
|
+
[domain, events, params, referrer, referrer_params, referrer_raw, time_on_page, url].hash
|
137
146
|
end
|
138
147
|
|
139
148
|
# Builds the object from hash
|
@@ -14,15 +14,31 @@ require 'date'
|
|
14
14
|
|
15
15
|
module UltracartClient
|
16
16
|
class ScreenRecordingFilterValues
|
17
|
-
attr_accessor :
|
17
|
+
attr_accessor :communications_campaign_names
|
18
|
+
|
19
|
+
attr_accessor :communications_email_subjects
|
20
|
+
|
21
|
+
attr_accessor :communications_flow_names
|
22
|
+
|
23
|
+
attr_accessor :email_domains
|
18
24
|
|
19
25
|
attr_accessor :geolocation_countries
|
20
26
|
|
21
27
|
attr_accessor :geolocation_states
|
22
28
|
|
29
|
+
attr_accessor :language_iso_codes
|
30
|
+
|
23
31
|
attr_accessor :max_values
|
24
32
|
|
25
|
-
attr_accessor :
|
33
|
+
attr_accessor :page_views
|
34
|
+
|
35
|
+
attr_accessor :preferred_languages
|
36
|
+
|
37
|
+
attr_accessor :referrer_domains
|
38
|
+
|
39
|
+
attr_accessor :time_on_site_max
|
40
|
+
|
41
|
+
attr_accessor :time_on_site_min
|
26
42
|
|
27
43
|
attr_accessor :urls
|
28
44
|
|
@@ -36,37 +52,61 @@ module UltracartClient
|
|
36
52
|
|
37
53
|
attr_accessor :user_agent_originals
|
38
54
|
|
55
|
+
attr_accessor :utm_campaigns
|
56
|
+
|
57
|
+
attr_accessor :utm_sources
|
58
|
+
|
39
59
|
# Attribute mapping from ruby-style variable name to JSON key.
|
40
60
|
def self.attribute_map
|
41
61
|
{
|
42
|
-
:'
|
62
|
+
:'communications_campaign_names' => :'communications_campaign_names',
|
63
|
+
:'communications_email_subjects' => :'communications_email_subjects',
|
64
|
+
:'communications_flow_names' => :'communications_flow_names',
|
65
|
+
:'email_domains' => :'email_domains',
|
43
66
|
:'geolocation_countries' => :'geolocation_countries',
|
44
67
|
:'geolocation_states' => :'geolocation_states',
|
68
|
+
:'language_iso_codes' => :'language_iso_codes',
|
45
69
|
:'max_values' => :'max_values',
|
46
|
-
:'
|
70
|
+
:'page_views' => :'page_views',
|
71
|
+
:'preferred_languages' => :'preferred_languages',
|
72
|
+
:'referrer_domains' => :'referrer_domains',
|
73
|
+
:'time_on_site_max' => :'time_on_site_max',
|
74
|
+
:'time_on_site_min' => :'time_on_site_min',
|
47
75
|
:'urls' => :'urls',
|
48
76
|
:'user_agent_device_names' => :'user_agent_device_names',
|
49
77
|
:'user_agent_device_os_names' => :'user_agent_device_os_names',
|
50
78
|
:'user_agent_device_os_versions' => :'user_agent_device_os_versions',
|
51
79
|
:'user_agent_names' => :'user_agent_names',
|
52
|
-
:'user_agent_originals' => :'user_agent_originals'
|
80
|
+
:'user_agent_originals' => :'user_agent_originals',
|
81
|
+
:'utm_campaigns' => :'utm_campaigns',
|
82
|
+
:'utm_sources' => :'utm_sources'
|
53
83
|
}
|
54
84
|
end
|
55
85
|
|
56
86
|
# Attribute type mapping.
|
57
87
|
def self.swagger_types
|
58
88
|
{
|
59
|
-
:'
|
89
|
+
:'communications_campaign_names' => :'Array<String>',
|
90
|
+
:'communications_email_subjects' => :'Array<String>',
|
91
|
+
:'communications_flow_names' => :'Array<String>',
|
92
|
+
:'email_domains' => :'Array<String>',
|
60
93
|
:'geolocation_countries' => :'Array<String>',
|
61
94
|
:'geolocation_states' => :'Array<String>',
|
95
|
+
:'language_iso_codes' => :'Array<String>',
|
62
96
|
:'max_values' => :'Integer',
|
63
|
-
:'
|
97
|
+
:'page_views' => :'Array<ScreenRecordingFilterValuesPageView>',
|
98
|
+
:'preferred_languages' => :'Array<String>',
|
99
|
+
:'referrer_domains' => :'Array<String>',
|
100
|
+
:'time_on_site_max' => :'Integer',
|
101
|
+
:'time_on_site_min' => :'Integer',
|
64
102
|
:'urls' => :'Array<String>',
|
65
103
|
:'user_agent_device_names' => :'Array<String>',
|
66
104
|
:'user_agent_device_os_names' => :'Array<String>',
|
67
105
|
:'user_agent_device_os_versions' => :'Array<String>',
|
68
106
|
:'user_agent_names' => :'Array<String>',
|
69
|
-
:'user_agent_originals' => :'Array<String>'
|
107
|
+
:'user_agent_originals' => :'Array<String>',
|
108
|
+
:'utm_campaigns' => :'Array<String>',
|
109
|
+
:'utm_sources' => :'Array<String>'
|
70
110
|
}
|
71
111
|
end
|
72
112
|
|
@@ -78,9 +118,27 @@ module UltracartClient
|
|
78
118
|
# convert string to symbol for hash key
|
79
119
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
80
120
|
|
81
|
-
if attributes.has_key?(:'
|
82
|
-
if (value = attributes[:'
|
83
|
-
self.
|
121
|
+
if attributes.has_key?(:'communications_campaign_names')
|
122
|
+
if (value = attributes[:'communications_campaign_names']).is_a?(Array)
|
123
|
+
self.communications_campaign_names = value
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'communications_email_subjects')
|
128
|
+
if (value = attributes[:'communications_email_subjects']).is_a?(Array)
|
129
|
+
self.communications_email_subjects = value
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.has_key?(:'communications_flow_names')
|
134
|
+
if (value = attributes[:'communications_flow_names']).is_a?(Array)
|
135
|
+
self.communications_flow_names = value
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'email_domains')
|
140
|
+
if (value = attributes[:'email_domains']).is_a?(Array)
|
141
|
+
self.email_domains = value
|
84
142
|
end
|
85
143
|
end
|
86
144
|
|
@@ -96,16 +154,42 @@ module UltracartClient
|
|
96
154
|
end
|
97
155
|
end
|
98
156
|
|
157
|
+
if attributes.has_key?(:'language_iso_codes')
|
158
|
+
if (value = attributes[:'language_iso_codes']).is_a?(Array)
|
159
|
+
self.language_iso_codes = value
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
99
163
|
if attributes.has_key?(:'max_values')
|
100
164
|
self.max_values = attributes[:'max_values']
|
101
165
|
end
|
102
166
|
|
103
|
-
if attributes.has_key?(:'
|
104
|
-
if (value = attributes[:'
|
105
|
-
self.
|
167
|
+
if attributes.has_key?(:'page_views')
|
168
|
+
if (value = attributes[:'page_views']).is_a?(Array)
|
169
|
+
self.page_views = value
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.has_key?(:'preferred_languages')
|
174
|
+
if (value = attributes[:'preferred_languages']).is_a?(Array)
|
175
|
+
self.preferred_languages = value
|
106
176
|
end
|
107
177
|
end
|
108
178
|
|
179
|
+
if attributes.has_key?(:'referrer_domains')
|
180
|
+
if (value = attributes[:'referrer_domains']).is_a?(Array)
|
181
|
+
self.referrer_domains = value
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.has_key?(:'time_on_site_max')
|
186
|
+
self.time_on_site_max = attributes[:'time_on_site_max']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'time_on_site_min')
|
190
|
+
self.time_on_site_min = attributes[:'time_on_site_min']
|
191
|
+
end
|
192
|
+
|
109
193
|
if attributes.has_key?(:'urls')
|
110
194
|
if (value = attributes[:'urls']).is_a?(Array)
|
111
195
|
self.urls = value
|
@@ -141,6 +225,18 @@ module UltracartClient
|
|
141
225
|
self.user_agent_originals = value
|
142
226
|
end
|
143
227
|
end
|
228
|
+
|
229
|
+
if attributes.has_key?(:'utm_campaigns')
|
230
|
+
if (value = attributes[:'utm_campaigns']).is_a?(Array)
|
231
|
+
self.utm_campaigns = value
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
if attributes.has_key?(:'utm_sources')
|
236
|
+
if (value = attributes[:'utm_sources']).is_a?(Array)
|
237
|
+
self.utm_sources = value
|
238
|
+
end
|
239
|
+
end
|
144
240
|
end
|
145
241
|
|
146
242
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -161,17 +257,27 @@ module UltracartClient
|
|
161
257
|
def ==(o)
|
162
258
|
return true if self.equal?(o)
|
163
259
|
self.class == o.class &&
|
164
|
-
|
260
|
+
communications_campaign_names == o.communications_campaign_names &&
|
261
|
+
communications_email_subjects == o.communications_email_subjects &&
|
262
|
+
communications_flow_names == o.communications_flow_names &&
|
263
|
+
email_domains == o.email_domains &&
|
165
264
|
geolocation_countries == o.geolocation_countries &&
|
166
265
|
geolocation_states == o.geolocation_states &&
|
266
|
+
language_iso_codes == o.language_iso_codes &&
|
167
267
|
max_values == o.max_values &&
|
168
|
-
|
268
|
+
page_views == o.page_views &&
|
269
|
+
preferred_languages == o.preferred_languages &&
|
270
|
+
referrer_domains == o.referrer_domains &&
|
271
|
+
time_on_site_max == o.time_on_site_max &&
|
272
|
+
time_on_site_min == o.time_on_site_min &&
|
169
273
|
urls == o.urls &&
|
170
274
|
user_agent_device_names == o.user_agent_device_names &&
|
171
275
|
user_agent_device_os_names == o.user_agent_device_os_names &&
|
172
276
|
user_agent_device_os_versions == o.user_agent_device_os_versions &&
|
173
277
|
user_agent_names == o.user_agent_names &&
|
174
|
-
user_agent_originals == o.user_agent_originals
|
278
|
+
user_agent_originals == o.user_agent_originals &&
|
279
|
+
utm_campaigns == o.utm_campaigns &&
|
280
|
+
utm_sources == o.utm_sources
|
175
281
|
end
|
176
282
|
|
177
283
|
# @see the `==` method
|
@@ -183,7 +289,7 @@ module UltracartClient
|
|
183
289
|
# Calculates hash code according to all attributes.
|
184
290
|
# @return [Fixnum] Hash code
|
185
291
|
def hash
|
186
|
-
[
|
292
|
+
[communications_campaign_names, communications_email_subjects, communications_flow_names, email_domains, geolocation_countries, geolocation_states, language_iso_codes, max_values, page_views, preferred_languages, referrer_domains, time_on_site_max, time_on_site_min, urls, user_agent_device_names, user_agent_device_os_names, user_agent_device_os_versions, user_agent_names, user_agent_originals, utm_campaigns, utm_sources].hash
|
187
293
|
end
|
188
294
|
|
189
295
|
# Builds the object from hash
|
@@ -0,0 +1,237 @@
|
|
1
|
+
=begin
|
2
|
+
#UltraCart Rest API V2
|
3
|
+
|
4
|
+
#UltraCart REST API Version 2
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
Contact: support@ultracart.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.15-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module UltracartClient
|
16
|
+
class ScreenRecordingFilterValuesPageView
|
17
|
+
attr_accessor :domains
|
18
|
+
|
19
|
+
attr_accessor :events
|
20
|
+
|
21
|
+
attr_accessor :page_params
|
22
|
+
|
23
|
+
attr_accessor :time_on_page_max
|
24
|
+
|
25
|
+
attr_accessor :time_on_page_min
|
26
|
+
|
27
|
+
attr_accessor :urls
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'domains' => :'domains',
|
33
|
+
:'events' => :'events',
|
34
|
+
:'page_params' => :'page_params',
|
35
|
+
:'time_on_page_max' => :'time_on_page_max',
|
36
|
+
:'time_on_page_min' => :'time_on_page_min',
|
37
|
+
:'urls' => :'urls'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Attribute type mapping.
|
42
|
+
def self.swagger_types
|
43
|
+
{
|
44
|
+
:'domains' => :'Array<String>',
|
45
|
+
:'events' => :'Array<ScreenRecordingFilterValuesEvent>',
|
46
|
+
:'page_params' => :'Array<ScreenRecordingFilterValuesPageParam>',
|
47
|
+
:'time_on_page_max' => :'Integer',
|
48
|
+
:'time_on_page_min' => :'Integer',
|
49
|
+
:'urls' => :'Array<String>'
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
# Initializes the object
|
54
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
55
|
+
def initialize(attributes = {})
|
56
|
+
return unless attributes.is_a?(Hash)
|
57
|
+
|
58
|
+
# convert string to symbol for hash key
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
60
|
+
|
61
|
+
if attributes.has_key?(:'domains')
|
62
|
+
if (value = attributes[:'domains']).is_a?(Array)
|
63
|
+
self.domains = value
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
if attributes.has_key?(:'events')
|
68
|
+
if (value = attributes[:'events']).is_a?(Array)
|
69
|
+
self.events = value
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
if attributes.has_key?(:'page_params')
|
74
|
+
if (value = attributes[:'page_params']).is_a?(Array)
|
75
|
+
self.page_params = value
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
if attributes.has_key?(:'time_on_page_max')
|
80
|
+
self.time_on_page_max = attributes[:'time_on_page_max']
|
81
|
+
end
|
82
|
+
|
83
|
+
if attributes.has_key?(:'time_on_page_min')
|
84
|
+
self.time_on_page_min = attributes[:'time_on_page_min']
|
85
|
+
end
|
86
|
+
|
87
|
+
if attributes.has_key?(:'urls')
|
88
|
+
if (value = attributes[:'urls']).is_a?(Array)
|
89
|
+
self.urls = value
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
95
|
+
# @return Array for valid properties with the reasons
|
96
|
+
def list_invalid_properties
|
97
|
+
invalid_properties = Array.new
|
98
|
+
invalid_properties
|
99
|
+
end
|
100
|
+
|
101
|
+
# Check to see if the all the properties in the model are valid
|
102
|
+
# @return true if the model is valid
|
103
|
+
def valid?
|
104
|
+
true
|
105
|
+
end
|
106
|
+
|
107
|
+
# Checks equality by comparing each attribute.
|
108
|
+
# @param [Object] Object to be compared
|
109
|
+
def ==(o)
|
110
|
+
return true if self.equal?(o)
|
111
|
+
self.class == o.class &&
|
112
|
+
domains == o.domains &&
|
113
|
+
events == o.events &&
|
114
|
+
page_params == o.page_params &&
|
115
|
+
time_on_page_max == o.time_on_page_max &&
|
116
|
+
time_on_page_min == o.time_on_page_min &&
|
117
|
+
urls == o.urls
|
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 [Fixnum] Hash code
|
128
|
+
def hash
|
129
|
+
[domains, events, page_params, time_on_page_max, time_on_page_min, urls].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 build_from_hash(attributes)
|
136
|
+
return nil unless attributes.is_a?(Hash)
|
137
|
+
self.class.swagger_types.each_pair do |key, type|
|
138
|
+
if type =~ /\AArray<(.*)>/i
|
139
|
+
# check to ensure the input is an array given that the attribute
|
140
|
+
# is documented as an array but the input is not
|
141
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
142
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
143
|
+
end
|
144
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
145
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
146
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
147
|
+
end
|
148
|
+
|
149
|
+
self
|
150
|
+
end
|
151
|
+
|
152
|
+
# Deserializes the data based on type
|
153
|
+
# @param string type Data type
|
154
|
+
# @param string value Value to be deserialized
|
155
|
+
# @return [Object] Deserialized data
|
156
|
+
def _deserialize(type, value)
|
157
|
+
case type.to_sym
|
158
|
+
when :DateTime
|
159
|
+
DateTime.parse(value)
|
160
|
+
when :Date
|
161
|
+
Date.parse(value)
|
162
|
+
when :String
|
163
|
+
value.to_s
|
164
|
+
when :Integer
|
165
|
+
value.to_i
|
166
|
+
when :Float
|
167
|
+
value.to_f
|
168
|
+
when :BOOLEAN
|
169
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
170
|
+
true
|
171
|
+
else
|
172
|
+
false
|
173
|
+
end
|
174
|
+
when :Object
|
175
|
+
# generic object (usually a Hash), return directly
|
176
|
+
value
|
177
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
178
|
+
inner_type = Regexp.last_match[:inner_type]
|
179
|
+
value.map { |v| _deserialize(inner_type, v) }
|
180
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
181
|
+
k_type = Regexp.last_match[:k_type]
|
182
|
+
v_type = Regexp.last_match[:v_type]
|
183
|
+
{}.tap do |hash|
|
184
|
+
value.each do |k, v|
|
185
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
186
|
+
end
|
187
|
+
end
|
188
|
+
else # model
|
189
|
+
temp_model = UltracartClient.const_get(type).new
|
190
|
+
temp_model.build_from_hash(value)
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# Returns the string representation of the object
|
195
|
+
# @return [String] String presentation of the object
|
196
|
+
def to_s
|
197
|
+
to_hash.to_s
|
198
|
+
end
|
199
|
+
|
200
|
+
# to_body is an alias to to_hash (backward compatibility)
|
201
|
+
# @return [Hash] Returns the object in the form of hash
|
202
|
+
def to_body
|
203
|
+
to_hash
|
204
|
+
end
|
205
|
+
|
206
|
+
# Returns the object in the form of hash
|
207
|
+
# @return [Hash] Returns the object in the form of hash
|
208
|
+
def to_hash
|
209
|
+
hash = {}
|
210
|
+
self.class.attribute_map.each_pair do |attr, param|
|
211
|
+
value = self.send(attr)
|
212
|
+
next if value.nil?
|
213
|
+
hash[param] = _to_hash(value)
|
214
|
+
end
|
215
|
+
hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Outputs non-array value in the form of hash
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
220
|
+
# @param [Object] value Any valid value
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
222
|
+
def _to_hash(value)
|
223
|
+
if value.is_a?(Array)
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
225
|
+
elsif value.is_a?(Hash)
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
+
end
|
229
|
+
elsif value.respond_to? :to_hash
|
230
|
+
value.to_hash
|
231
|
+
else
|
232
|
+
value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
end
|