ultracart_api 4.1.222 → 4.1.224

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 +55 -2
  3. data/docs/OauthTokenResponse.md +2 -0
  4. data/docs/SfvbAffiliateNetwork.md +60 -0
  5. data/docs/SfvbAffiliateNetworkRequest.md +50 -0
  6. data/docs/SfvbAffiliateNetworksResponse.md +20 -0
  7. data/docs/SfvbApi.md +1456 -120
  8. data/docs/SfvbApprovalCreateRequest.md +8 -2
  9. data/docs/SfvbApprovalParams.md +7 -3
  10. data/docs/SfvbContainerResponse.md +3 -1
  11. data/docs/SfvbSmartAttribution.md +38 -0
  12. data/docs/SfvbSmartAttributionPlatform.md +34 -0
  13. data/docs/SfvbSmartAttributionRequest.md +30 -0
  14. data/docs/SfvbTrackingAdvanced.md +34 -0
  15. data/docs/SfvbTrackingAdvancedRequest.md +34 -0
  16. data/docs/SfvbTrackingChange.md +24 -0
  17. data/docs/SfvbTrackingHtml.md +36 -0
  18. data/docs/SfvbTrackingHtmlRequest.md +20 -0
  19. data/docs/SfvbTrackingHtmlResponse.md +22 -0
  20. data/docs/SfvbTrackingPrivacy.md +28 -0
  21. data/docs/SfvbTrackingPrivacyRequest.md +28 -0
  22. data/docs/SfvbTrackingProvider.md +48 -0
  23. data/docs/SfvbTrackingProviderConsent.md +22 -0
  24. data/docs/SfvbTrackingProviderEvent.md +20 -0
  25. data/docs/SfvbTrackingProviderField.md +42 -0
  26. data/docs/SfvbTrackingProviderOauth.md +28 -0
  27. data/docs/SfvbTrackingProviderRequest.md +32 -0
  28. data/docs/SfvbTrackingProviderSecrets.md +46 -0
  29. data/docs/SfvbTrackingProvidersResponse.md +22 -0
  30. data/docs/SfvbTrackingSettingsResponse.md +28 -0
  31. data/docs/SfvbTrackingWholesaleTier.md +22 -0
  32. data/docs/SfvbUtmShortcode.md +56 -0
  33. data/docs/SfvbUtmShortcodeRequest.md +44 -0
  34. data/docs/SfvbUtmShortcodesResponse.md +24 -0
  35. data/lib/ultracart_api/api/sfvb_api.rb +4602 -2793
  36. data/lib/ultracart_api/models/oauth_token_response.rb +11 -1
  37. data/lib/ultracart_api/models/sfvb_affiliate_network.rb +478 -0
  38. data/lib/ultracart_api/models/sfvb_affiliate_network_request.rb +428 -0
  39. data/lib/ultracart_api/models/sfvb_affiliate_networks_response.rb +232 -0
  40. data/lib/ultracart_api/models/sfvb_approval_create_request.rb +34 -7
  41. data/lib/ultracart_api/models/sfvb_approval_params.rb +24 -4
  42. data/lib/ultracart_api/models/sfvb_container_response.rb +16 -4
  43. data/lib/ultracart_api/models/sfvb_smart_attribution.rb +324 -0
  44. data/lib/ultracart_api/models/sfvb_smart_attribution_platform.rb +300 -0
  45. data/lib/ultracart_api/models/sfvb_smart_attribution_request.rb +282 -0
  46. data/lib/ultracart_api/models/sfvb_tracking_advanced.rb +300 -0
  47. data/lib/ultracart_api/models/sfvb_tracking_advanced_request.rb +302 -0
  48. data/lib/ultracart_api/models/sfvb_tracking_change.rb +250 -0
  49. data/lib/ultracart_api/models/sfvb_tracking_html.rb +344 -0
  50. data/lib/ultracart_api/models/sfvb_tracking_html_request.rb +230 -0
  51. data/lib/ultracart_api/models/sfvb_tracking_html_response.rb +242 -0
  52. data/lib/ultracart_api/models/sfvb_tracking_privacy.rb +352 -0
  53. data/lib/ultracart_api/models/sfvb_tracking_privacy_request.rb +352 -0
  54. data/lib/ultracart_api/models/sfvb_tracking_provider.rb +378 -0
  55. data/lib/ultracart_api/models/sfvb_tracking_provider_consent.rb +240 -0
  56. data/lib/ultracart_api/models/sfvb_tracking_provider_event.rb +230 -0
  57. data/lib/ultracart_api/models/sfvb_tracking_provider_field.rb +342 -0
  58. data/lib/ultracart_api/models/sfvb_tracking_provider_oauth.rb +270 -0
  59. data/lib/ultracart_api/models/sfvb_tracking_provider_request.rb +292 -0
  60. data/lib/ultracart_api/models/sfvb_tracking_provider_secrets.rb +360 -0
  61. data/lib/ultracart_api/models/sfvb_tracking_providers_response.rb +242 -0
  62. data/lib/ultracart_api/models/sfvb_tracking_settings_response.rb +272 -0
  63. data/lib/ultracart_api/models/sfvb_tracking_wholesale_tier.rb +240 -0
  64. data/lib/ultracart_api/models/sfvb_utm_shortcode.rb +410 -0
  65. data/lib/ultracart_api/models/sfvb_utm_shortcode_request.rb +350 -0
  66. data/lib/ultracart_api/models/sfvb_utm_shortcodes_response.rb +252 -0
  67. data/lib/ultracart_api/version.rb +1 -1
  68. data/lib/ultracart_api.rb +27 -0
  69. metadata +55 -1
@@ -0,0 +1,360 @@
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 SfvbTrackingProviderSecrets
18
+ # Attentive SMS Private API Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.attentive.private_api_key, or an empty string to clear it.
19
+ attr_accessor :attentive_private_api_key
20
+
21
+ # Awin Conversion API Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.awin.conversion_api_key, or an empty string to clear it.
22
+ attr_accessor :awin_conversion_api_key
23
+
24
+ # AppLovin / Axon Conversion API Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.axon.conversion_api_key, or an empty string to clear it.
25
+ attr_accessor :axon_conversion_api_key
26
+
27
+ # Converge Webhook Token. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.converge.webhook_token, or an empty string to clear it.
28
+ attr_accessor :converge_webhook_token
29
+
30
+ # customer.io Write Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.customerio.write_key, or an empty string to clear it.
31
+ attr_accessor :customerio_write_key
32
+
33
+ # Facebook Server Side Access Token. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.facebook.capi_access_token, or an empty string to clear it.
34
+ attr_accessor :facebook_server_side_access_token
35
+
36
+ # Google Analytics GA4 Api Secret. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.ga4.api_secret, or an empty string to clear it.
37
+ attr_accessor :ga4_api_secret
38
+
39
+ # Hyros API Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.hyros.api_key, or an empty string to clear it.
40
+ attr_accessor :hyros_api_key
41
+
42
+ # KISSmetrics API Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.kissmetrics.api_key, or an empty string to clear it.
43
+ attr_accessor :kissmetrics_api_key
44
+
45
+ # Klaviyo API Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.klaviyo.private_api_key, or an empty string to clear it.
46
+ attr_accessor :klaviyo_private_api_key
47
+
48
+ # Nextdoor Access Token. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.nextdoor.access_token, or an empty string to clear it.
49
+ attr_accessor :nextdoor_access_token
50
+
51
+ # Northbeam API Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.northbeam.api_key, or an empty string to clear it.
52
+ attr_accessor :northbeam_api_key
53
+
54
+ # Pinterest Conversion Token. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.pinterest.capi_token, or an empty string to clear it.
55
+ attr_accessor :pinterest_token
56
+
57
+ # ReferralCandy Secret Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.referralcandy.secret_key, or an empty string to clear it.
58
+ attr_accessor :referralcandy_secret_key
59
+
60
+ # Retention.com Key. A secret handle (sec_...) made for this storefront by POST secrets with sink tracking.retention.api_key, or an empty string to clear it.
61
+ attr_accessor :retention_key
62
+
63
+ # Attribute mapping from ruby-style variable name to JSON key.
64
+ def self.attribute_map
65
+ {
66
+ :'attentive_private_api_key' => :'attentive_private_api_key',
67
+ :'awin_conversion_api_key' => :'awin_conversion_api_key',
68
+ :'axon_conversion_api_key' => :'axon_conversion_api_key',
69
+ :'converge_webhook_token' => :'converge_webhook_token',
70
+ :'customerio_write_key' => :'customerio_write_key',
71
+ :'facebook_server_side_access_token' => :'facebook_server_side_access_token',
72
+ :'ga4_api_secret' => :'ga4_api_secret',
73
+ :'hyros_api_key' => :'hyros_api_key',
74
+ :'kissmetrics_api_key' => :'kissmetrics_api_key',
75
+ :'klaviyo_private_api_key' => :'klaviyo_private_api_key',
76
+ :'nextdoor_access_token' => :'nextdoor_access_token',
77
+ :'northbeam_api_key' => :'northbeam_api_key',
78
+ :'pinterest_token' => :'pinterest_token',
79
+ :'referralcandy_secret_key' => :'referralcandy_secret_key',
80
+ :'retention_key' => :'retention_key'
81
+ }
82
+ end
83
+
84
+ # Returns all the JSON keys this model knows about
85
+ def self.acceptable_attributes
86
+ attribute_map.values
87
+ end
88
+
89
+ # Attribute type mapping.
90
+ def self.openapi_types
91
+ {
92
+ :'attentive_private_api_key' => :'String',
93
+ :'awin_conversion_api_key' => :'String',
94
+ :'axon_conversion_api_key' => :'String',
95
+ :'converge_webhook_token' => :'String',
96
+ :'customerio_write_key' => :'String',
97
+ :'facebook_server_side_access_token' => :'String',
98
+ :'ga4_api_secret' => :'String',
99
+ :'hyros_api_key' => :'String',
100
+ :'kissmetrics_api_key' => :'String',
101
+ :'klaviyo_private_api_key' => :'String',
102
+ :'nextdoor_access_token' => :'String',
103
+ :'northbeam_api_key' => :'String',
104
+ :'pinterest_token' => :'String',
105
+ :'referralcandy_secret_key' => :'String',
106
+ :'retention_key' => :'String'
107
+ }
108
+ end
109
+
110
+ # List of attributes with nullable: true
111
+ def self.openapi_nullable
112
+ Set.new([
113
+ ])
114
+ end
115
+
116
+ # Initializes the object
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ def initialize(attributes = {})
119
+ if (!attributes.is_a?(Hash))
120
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbTrackingProviderSecrets` initialize method"
121
+ end
122
+
123
+ # check to see if the attribute exists and convert string to symbol for hash key
124
+ attributes = attributes.each_with_object({}) { |(k, v), h|
125
+ if (!self.class.attribute_map.key?(k.to_sym))
126
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbTrackingProviderSecrets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
127
+ end
128
+ h[k.to_sym] = v
129
+ }
130
+
131
+ if attributes.key?(:'attentive_private_api_key')
132
+ self.attentive_private_api_key = attributes[:'attentive_private_api_key']
133
+ end
134
+
135
+ if attributes.key?(:'awin_conversion_api_key')
136
+ self.awin_conversion_api_key = attributes[:'awin_conversion_api_key']
137
+ end
138
+
139
+ if attributes.key?(:'axon_conversion_api_key')
140
+ self.axon_conversion_api_key = attributes[:'axon_conversion_api_key']
141
+ end
142
+
143
+ if attributes.key?(:'converge_webhook_token')
144
+ self.converge_webhook_token = attributes[:'converge_webhook_token']
145
+ end
146
+
147
+ if attributes.key?(:'customerio_write_key')
148
+ self.customerio_write_key = attributes[:'customerio_write_key']
149
+ end
150
+
151
+ if attributes.key?(:'facebook_server_side_access_token')
152
+ self.facebook_server_side_access_token = attributes[:'facebook_server_side_access_token']
153
+ end
154
+
155
+ if attributes.key?(:'ga4_api_secret')
156
+ self.ga4_api_secret = attributes[:'ga4_api_secret']
157
+ end
158
+
159
+ if attributes.key?(:'hyros_api_key')
160
+ self.hyros_api_key = attributes[:'hyros_api_key']
161
+ end
162
+
163
+ if attributes.key?(:'kissmetrics_api_key')
164
+ self.kissmetrics_api_key = attributes[:'kissmetrics_api_key']
165
+ end
166
+
167
+ if attributes.key?(:'klaviyo_private_api_key')
168
+ self.klaviyo_private_api_key = attributes[:'klaviyo_private_api_key']
169
+ end
170
+
171
+ if attributes.key?(:'nextdoor_access_token')
172
+ self.nextdoor_access_token = attributes[:'nextdoor_access_token']
173
+ end
174
+
175
+ if attributes.key?(:'northbeam_api_key')
176
+ self.northbeam_api_key = attributes[:'northbeam_api_key']
177
+ end
178
+
179
+ if attributes.key?(:'pinterest_token')
180
+ self.pinterest_token = attributes[:'pinterest_token']
181
+ end
182
+
183
+ if attributes.key?(:'referralcandy_secret_key')
184
+ self.referralcandy_secret_key = attributes[:'referralcandy_secret_key']
185
+ end
186
+
187
+ if attributes.key?(:'retention_key')
188
+ self.retention_key = attributes[:'retention_key']
189
+ end
190
+ end
191
+
192
+ # Show invalid properties with the reasons. Usually used together with valid?
193
+ # @return Array for valid properties with the reasons
194
+ def list_invalid_properties
195
+ invalid_properties = Array.new
196
+ invalid_properties
197
+ end
198
+
199
+ # Check to see if the all the properties in the model are valid
200
+ # @return true if the model is valid
201
+ def valid?
202
+ true
203
+ end
204
+
205
+ # Checks equality by comparing each attribute.
206
+ # @param [Object] Object to be compared
207
+ def ==(o)
208
+ return true if self.equal?(o)
209
+ self.class == o.class &&
210
+ attentive_private_api_key == o.attentive_private_api_key &&
211
+ awin_conversion_api_key == o.awin_conversion_api_key &&
212
+ axon_conversion_api_key == o.axon_conversion_api_key &&
213
+ converge_webhook_token == o.converge_webhook_token &&
214
+ customerio_write_key == o.customerio_write_key &&
215
+ facebook_server_side_access_token == o.facebook_server_side_access_token &&
216
+ ga4_api_secret == o.ga4_api_secret &&
217
+ hyros_api_key == o.hyros_api_key &&
218
+ kissmetrics_api_key == o.kissmetrics_api_key &&
219
+ klaviyo_private_api_key == o.klaviyo_private_api_key &&
220
+ nextdoor_access_token == o.nextdoor_access_token &&
221
+ northbeam_api_key == o.northbeam_api_key &&
222
+ pinterest_token == o.pinterest_token &&
223
+ referralcandy_secret_key == o.referralcandy_secret_key &&
224
+ retention_key == o.retention_key
225
+ end
226
+
227
+ # @see the `==` method
228
+ # @param [Object] Object to be compared
229
+ def eql?(o)
230
+ self == o
231
+ end
232
+
233
+ # Calculates hash code according to all attributes.
234
+ # @return [Integer] Hash code
235
+ def hash
236
+ [attentive_private_api_key, awin_conversion_api_key, axon_conversion_api_key, converge_webhook_token, customerio_write_key, facebook_server_side_access_token, ga4_api_secret, hyros_api_key, kissmetrics_api_key, klaviyo_private_api_key, nextdoor_access_token, northbeam_api_key, pinterest_token, referralcandy_secret_key, retention_key].hash
237
+ end
238
+
239
+ # Builds the object from hash
240
+ # @param [Hash] attributes Model attributes in the form of hash
241
+ # @return [Object] Returns the model itself
242
+ def self.build_from_hash(attributes)
243
+ new.build_from_hash(attributes)
244
+ end
245
+
246
+ # Builds the object from hash
247
+ # @param [Hash] attributes Model attributes in the form of hash
248
+ # @return [Object] Returns the model itself
249
+ def build_from_hash(attributes)
250
+ return nil unless attributes.is_a?(Hash)
251
+ attributes = attributes.transform_keys(&:to_sym)
252
+ self.class.openapi_types.each_pair do |key, type|
253
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
254
+ self.send("#{key}=", nil)
255
+ elsif type =~ /\AArray<(.*)>/i
256
+ # check to ensure the input is an array given that the attribute
257
+ # is documented as an array but the input is not
258
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
259
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
260
+ end
261
+ elsif !attributes[self.class.attribute_map[key]].nil?
262
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
263
+ end
264
+ end
265
+
266
+ self
267
+ end
268
+
269
+ # Deserializes the data based on type
270
+ # @param string type Data type
271
+ # @param string value Value to be deserialized
272
+ # @return [Object] Deserialized data
273
+ def _deserialize(type, value)
274
+ case type.to_sym
275
+ when :Time
276
+ Time.parse(value)
277
+ when :Date
278
+ Date.parse(value)
279
+ when :String
280
+ value.to_s
281
+ when :Integer
282
+ value.to_i
283
+ when :Float
284
+ value.to_f
285
+ when :Boolean
286
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
287
+ true
288
+ else
289
+ false
290
+ end
291
+ when :Object
292
+ # generic object (usually a Hash), return directly
293
+ value
294
+ when /\AArray<(?<inner_type>.+)>\z/
295
+ inner_type = Regexp.last_match[:inner_type]
296
+ value.map { |v| _deserialize(inner_type, v) }
297
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
298
+ k_type = Regexp.last_match[:k_type]
299
+ v_type = Regexp.last_match[:v_type]
300
+ {}.tap do |hash|
301
+ value.each do |k, v|
302
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
303
+ end
304
+ end
305
+ else # model
306
+ # models (e.g. Pet) or oneOf
307
+ klass = UltracartClient.const_get(type)
308
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
309
+ end
310
+ end
311
+
312
+ # Returns the string representation of the object
313
+ # @return [String] String presentation of the object
314
+ def to_s
315
+ to_hash.to_s
316
+ end
317
+
318
+ # to_body is an alias to to_hash (backward compatibility)
319
+ # @return [Hash] Returns the object in the form of hash
320
+ def to_body
321
+ to_hash
322
+ end
323
+
324
+ # Returns the object in the form of hash
325
+ # @return [Hash] Returns the object in the form of hash
326
+ def to_hash
327
+ hash = {}
328
+ self.class.attribute_map.each_pair do |attr, param|
329
+ value = self.send(attr)
330
+ if value.nil?
331
+ is_nullable = self.class.openapi_nullable.include?(attr)
332
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
333
+ end
334
+
335
+ hash[param] = _to_hash(value)
336
+ end
337
+ hash
338
+ end
339
+
340
+ # Outputs non-array value in the form of hash
341
+ # For object, use to_hash. Otherwise, just return the value
342
+ # @param [Object] value Any valid value
343
+ # @return [Hash] Returns the value in the form of hash
344
+ def _to_hash(value)
345
+ if value.is_a?(Array)
346
+ value.compact.map { |v| _to_hash(v) }
347
+ elsif value.is_a?(Hash)
348
+ {}.tap do |hash|
349
+ value.each { |k, v| hash[k] = _to_hash(v) }
350
+ end
351
+ elsif value.respond_to? :to_hash
352
+ value.to_hash
353
+ else
354
+ value
355
+ end
356
+ end
357
+
358
+ end
359
+
360
+ end
@@ -0,0 +1,242 @@
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 SfvbTrackingProvidersResponse
18
+ # Bumped whenever a provider or field is added, removed or renamed.
19
+ attr_accessor :catalog_version
20
+
21
+ # Every provider, Google first, in the order the admin shows them.
22
+ attr_accessor :providers
23
+
24
+ # The storefront. Also the target_id of a secret request for a provider secret.
25
+ attr_accessor :storefront_oid
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'catalog_version' => :'catalog_version',
31
+ :'providers' => :'providers',
32
+ :'storefront_oid' => :'storefront_oid'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'catalog_version' => :'Integer',
45
+ :'providers' => :'Array<SfvbTrackingProvider>',
46
+ :'storefront_oid' => :'Integer'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbTrackingProvidersResponse` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbTrackingProvidersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'catalog_version')
72
+ self.catalog_version = attributes[:'catalog_version']
73
+ end
74
+
75
+ if attributes.key?(:'providers')
76
+ if (value = attributes[:'providers']).is_a?(Array)
77
+ self.providers = value
78
+ end
79
+ end
80
+
81
+ if attributes.key?(:'storefront_oid')
82
+ self.storefront_oid = attributes[:'storefront_oid']
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ true
97
+ end
98
+
99
+ # Checks equality by comparing each attribute.
100
+ # @param [Object] Object to be compared
101
+ def ==(o)
102
+ return true if self.equal?(o)
103
+ self.class == o.class &&
104
+ catalog_version == o.catalog_version &&
105
+ providers == o.providers &&
106
+ storefront_oid == o.storefront_oid
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(o)
112
+ self == o
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ def hash
118
+ [catalog_version, providers, storefront_oid].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def self.build_from_hash(attributes)
125
+ new.build_from_hash(attributes)
126
+ end
127
+
128
+ # Builds the object from hash
129
+ # @param [Hash] attributes Model attributes in the form of hash
130
+ # @return [Object] Returns the model itself
131
+ def build_from_hash(attributes)
132
+ return nil unless attributes.is_a?(Hash)
133
+ attributes = attributes.transform_keys(&:to_sym)
134
+ self.class.openapi_types.each_pair do |key, type|
135
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
136
+ self.send("#{key}=", nil)
137
+ elsif type =~ /\AArray<(.*)>/i
138
+ # check to ensure the input is an array given that the attribute
139
+ # is documented as an array but the input is not
140
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
141
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
142
+ end
143
+ elsif !attributes[self.class.attribute_map[key]].nil?
144
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
145
+ end
146
+ end
147
+
148
+ self
149
+ end
150
+
151
+ # Deserializes the data based on type
152
+ # @param string type Data type
153
+ # @param string value Value to be deserialized
154
+ # @return [Object] Deserialized data
155
+ def _deserialize(type, value)
156
+ case type.to_sym
157
+ when :Time
158
+ Time.parse(value)
159
+ when :Date
160
+ Date.parse(value)
161
+ when :String
162
+ value.to_s
163
+ when :Integer
164
+ value.to_i
165
+ when :Float
166
+ value.to_f
167
+ when :Boolean
168
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
169
+ true
170
+ else
171
+ false
172
+ end
173
+ when :Object
174
+ # generic object (usually a Hash), return directly
175
+ value
176
+ when /\AArray<(?<inner_type>.+)>\z/
177
+ inner_type = Regexp.last_match[:inner_type]
178
+ value.map { |v| _deserialize(inner_type, v) }
179
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
180
+ k_type = Regexp.last_match[:k_type]
181
+ v_type = Regexp.last_match[:v_type]
182
+ {}.tap do |hash|
183
+ value.each do |k, v|
184
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
185
+ end
186
+ end
187
+ else # model
188
+ # models (e.g. Pet) or oneOf
189
+ klass = UltracartClient.const_get(type)
190
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.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
+ if value.nil?
213
+ is_nullable = self.class.openapi_nullable.include?(attr)
214
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
215
+ end
216
+
217
+ hash[param] = _to_hash(value)
218
+ end
219
+ hash
220
+ end
221
+
222
+ # Outputs non-array value in the form of hash
223
+ # For object, use to_hash. Otherwise, just return the value
224
+ # @param [Object] value Any valid value
225
+ # @return [Hash] Returns the value in the form of hash
226
+ def _to_hash(value)
227
+ if value.is_a?(Array)
228
+ value.compact.map { |v| _to_hash(v) }
229
+ elsif value.is_a?(Hash)
230
+ {}.tap do |hash|
231
+ value.each { |k, v| hash[k] = _to_hash(v) }
232
+ end
233
+ elsif value.respond_to? :to_hash
234
+ value.to_hash
235
+ else
236
+ value
237
+ end
238
+ end
239
+
240
+ end
241
+
242
+ end