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
@@ -18,7 +18,9 @@ module UltracartClient
18
18
  # The gated action to approve.
19
19
  attr_accessor :action
20
20
 
21
- # For a file.put_script write, the exact script to be written, at most 256 KB. UltraCart reviews it and keeps only its hash, so send the same bytes again on the write. Leave it out for a revert, which names params.version.
21
+ attr_accessor :affiliate_network
22
+
23
+ # For a file.put_script write, the exact script to be written, at most 256 KB. For tracking_html.put, the exact HTML the write will send, at most 256 KB. UltraCart reviews it and keeps only its hash, so send the same bytes again on the write. Leave it out for a revert, which names params.version.
22
24
  attr_accessor :content
23
25
 
24
26
  attr_accessor :experiment_start
@@ -38,6 +40,10 @@ module UltracartClient
38
40
 
39
41
  attr_accessor :segment_update
40
42
 
43
+ attr_accessor :smart_attribution
44
+
45
+ attr_accessor :tracking_provider
46
+
41
47
  class EnumAttributeValidator
42
48
  attr_reader :datatype
43
49
  attr_reader :allowable_values
@@ -64,6 +70,7 @@ module UltracartClient
64
70
  def self.attribute_map
65
71
  {
66
72
  :'action' => :'action',
73
+ :'affiliate_network' => :'affiliate_network',
67
74
  :'content' => :'content',
68
75
  :'experiment_start' => :'experiment_start',
69
76
  :'item_attribute_rows' => :'item_attribute_rows',
@@ -71,7 +78,9 @@ module UltracartClient
71
78
  :'params' => :'params',
72
79
  :'reason' => :'reason',
73
80
  :'redirect_rows' => :'redirect_rows',
74
- :'segment_update' => :'segment_update'
81
+ :'segment_update' => :'segment_update',
82
+ :'smart_attribution' => :'smart_attribution',
83
+ :'tracking_provider' => :'tracking_provider'
75
84
  }
76
85
  end
77
86
 
@@ -84,6 +93,7 @@ module UltracartClient
84
93
  def self.openapi_types
85
94
  {
86
95
  :'action' => :'String',
96
+ :'affiliate_network' => :'SfvbAffiliateNetworkRequest',
87
97
  :'content' => :'String',
88
98
  :'experiment_start' => :'SfvbExperimentStartRequest',
89
99
  :'item_attribute_rows' => :'Array<SfvbItemAttributeBatchRow>',
@@ -91,7 +101,9 @@ module UltracartClient
91
101
  :'params' => :'SfvbApprovalParams',
92
102
  :'reason' => :'String',
93
103
  :'redirect_rows' => :'Array<SfvbRedirectDeleteRow>',
94
- :'segment_update' => :'SfvbCommsSegmentWriteRequest'
104
+ :'segment_update' => :'SfvbCommsSegmentWriteRequest',
105
+ :'smart_attribution' => :'SfvbSmartAttributionRequest',
106
+ :'tracking_provider' => :'SfvbTrackingProviderRequest'
95
107
  }
96
108
  end
97
109
 
@@ -120,6 +132,10 @@ module UltracartClient
120
132
  self.action = attributes[:'action']
121
133
  end
122
134
 
135
+ if attributes.key?(:'affiliate_network')
136
+ self.affiliate_network = attributes[:'affiliate_network']
137
+ end
138
+
123
139
  if attributes.key?(:'content')
124
140
  self.content = attributes[:'content']
125
141
  end
@@ -155,6 +171,14 @@ module UltracartClient
155
171
  if attributes.key?(:'segment_update')
156
172
  self.segment_update = attributes[:'segment_update']
157
173
  end
174
+
175
+ if attributes.key?(:'smart_attribution')
176
+ self.smart_attribution = attributes[:'smart_attribution']
177
+ end
178
+
179
+ if attributes.key?(:'tracking_provider')
180
+ self.tracking_provider = attributes[:'tracking_provider']
181
+ end
158
182
  end
159
183
 
160
184
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -167,7 +191,7 @@ module UltracartClient
167
191
  # Check to see if the all the properties in the model are valid
168
192
  # @return true if the model is valid
169
193
  def valid?
170
- action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update"])
194
+ action_validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete"])
171
195
  return false unless action_validator.valid?(@action)
172
196
  true
173
197
  end
@@ -175,7 +199,7 @@ module UltracartClient
175
199
  # Custom attribute writer method checking allowed values (enum).
176
200
  # @param [Object] action Object to be assigned
177
201
  def action=(action)
178
- validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update"])
202
+ validator = EnumAttributeValidator.new('String', ["file.delete", "blog_post.delete", "file.put_script", "redirect.delete_batch", "experiment.start", "experiment.end", "upsell.enable", "item.attribute_batch", "item.pricing", "twilio_account.delete", "sending_domain.delete", "sequence_step.delete", "sequence_step.move", "sequence_step.enable_postcard", "segment.update", "smart_attribution.change", "smart_attribution.delete", "tracking_provider.change", "tracking_html.put", "affiliate_network.change", "affiliate_network.delete"])
179
203
  unless validator.valid?(action)
180
204
  fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}."
181
205
  end
@@ -188,6 +212,7 @@ module UltracartClient
188
212
  return true if self.equal?(o)
189
213
  self.class == o.class &&
190
214
  action == o.action &&
215
+ affiliate_network == o.affiliate_network &&
191
216
  content == o.content &&
192
217
  experiment_start == o.experiment_start &&
193
218
  item_attribute_rows == o.item_attribute_rows &&
@@ -195,7 +220,9 @@ module UltracartClient
195
220
  params == o.params &&
196
221
  reason == o.reason &&
197
222
  redirect_rows == o.redirect_rows &&
198
- segment_update == o.segment_update
223
+ segment_update == o.segment_update &&
224
+ smart_attribution == o.smart_attribution &&
225
+ tracking_provider == o.tracking_provider
199
226
  end
200
227
 
201
228
  # @see the `==` method
@@ -207,7 +234,7 @@ module UltracartClient
207
234
  # Calculates hash code according to all attributes.
208
235
  # @return [Integer] Hash code
209
236
  def hash
210
- [action, content, experiment_start, item_attribute_rows, item_pricing, params, reason, redirect_rows, segment_update].hash
237
+ [action, affiliate_network, content, experiment_start, item_attribute_rows, item_pricing, params, reason, redirect_rows, segment_update, smart_attribution, tracking_provider].hash
211
238
  end
212
239
 
213
240
  # Builds the object from hash
@@ -15,6 +15,9 @@ require 'time'
15
15
 
16
16
  module UltracartClient
17
17
  class SfvbApprovalParams
18
+ # The affiliate network, for affiliate_network.change and affiliate_network.delete. 0 or left out for affiliate_network.change of a network the create call will add.
19
+ attr_accessor :affiliate_network_oid
20
+
18
21
  # For sequence_step.move, the step it moves after. Or branch_step_uuid with side.
19
22
  attr_accessor :after_step_uuid
20
23
 
@@ -27,7 +30,7 @@ module UltracartClient
27
30
  # For sequence_step.move, the condition, split or inboxgeek step it moves to the start of a side of.
28
31
  attr_accessor :branch_step_uuid
29
32
 
30
- # For file.put_script, the SHA-256 of the exact bytes approved. Set by the server, never by the caller. The write must send bytes with this hash.
33
+ # For file.put_script and tracking_html.put, the SHA-256 of the exact bytes approved, and for affiliate_network.change the SHA-256 of the conversion pixel. Set by the server, never by the caller. The write must send bytes with this hash.
31
34
  attr_accessor :content_sha256
32
35
 
33
36
  # For sending_domain.delete, the sending domain.
@@ -48,7 +51,7 @@ module UltracartClient
48
51
  # The file path, for file.delete and file.put_script, or the page path for experiment.start of a page experiment. Exactly as the gated call will send it.
49
52
  attr_accessor :path
50
53
 
51
- # For experiment.start of a url experiment, the hash of the checked experiment approved, and for item.pricing the hash of the change. Set by the server. The gated call must send the same.
54
+ # For experiment.start of a url experiment, the hash of the checked experiment approved, for item.pricing, tracking_provider.change and affiliate_network.change the hash of the change, and for smart_attribution.change the hash of the configuration the change would store. Set by the server. The gated call must send the same.
52
55
  attr_accessor :request_sha256
53
56
 
54
57
  # For redirect.delete_batch and item.attribute_batch, the plan_hash of the exact rows approved. Set by the server. The batch must send rows with this hash.
@@ -66,12 +69,15 @@ module UltracartClient
66
69
  # For sequence_step.move with branch_step_uuid, the side's label from the sequence read.
67
70
  attr_accessor :side
68
71
 
69
- # For experiment.start of a page experiment, the page body name. Defaults to body.
72
+ # For experiment.start of a page experiment, the page body name, which defaults to body. For tracking_html.put, tracking or conversion.
70
73
  attr_accessor :slot
71
74
 
72
75
  # The step to remove, for sequence_step.delete, to move, for sequence_step.move, or to turn on, for sequence_step.enable_postcard.
73
76
  attr_accessor :step_uuid
74
77
 
78
+ # The tracking provider key, for tracking_provider.change.
79
+ attr_accessor :tracking_provider
80
+
75
81
  # For upsell.enable, what to switch on.
76
82
  attr_accessor :upsell_kind
77
83
 
@@ -112,6 +118,7 @@ module UltracartClient
112
118
  # Attribute mapping from ruby-style variable name to JSON key.
113
119
  def self.attribute_map
114
120
  {
121
+ :'affiliate_network_oid' => :'affiliate_network_oid',
115
122
  :'after_step_uuid' => :'after_step_uuid',
116
123
  :'attribute_names' => :'attribute_names',
117
124
  :'blog_post_oid' => :'blog_post_oid',
@@ -131,6 +138,7 @@ module UltracartClient
131
138
  :'side' => :'side',
132
139
  :'slot' => :'slot',
133
140
  :'step_uuid' => :'step_uuid',
141
+ :'tracking_provider' => :'tracking_provider',
134
142
  :'upsell_kind' => :'upsell_kind',
135
143
  :'upsell_oid' => :'upsell_oid',
136
144
  :'version' => :'version',
@@ -147,6 +155,7 @@ module UltracartClient
147
155
  # Attribute type mapping.
148
156
  def self.openapi_types
149
157
  {
158
+ :'affiliate_network_oid' => :'Integer',
150
159
  :'after_step_uuid' => :'String',
151
160
  :'attribute_names' => :'Array<String>',
152
161
  :'blog_post_oid' => :'Integer',
@@ -166,6 +175,7 @@ module UltracartClient
166
175
  :'side' => :'String',
167
176
  :'slot' => :'String',
168
177
  :'step_uuid' => :'String',
178
+ :'tracking_provider' => :'String',
169
179
  :'upsell_kind' => :'String',
170
180
  :'upsell_oid' => :'Integer',
171
181
  :'version' => :'Integer',
@@ -195,6 +205,10 @@ module UltracartClient
195
205
  h[k.to_sym] = v
196
206
  }
197
207
 
208
+ if attributes.key?(:'affiliate_network_oid')
209
+ self.affiliate_network_oid = attributes[:'affiliate_network_oid']
210
+ end
211
+
198
212
  if attributes.key?(:'after_step_uuid')
199
213
  self.after_step_uuid = attributes[:'after_step_uuid']
200
214
  end
@@ -273,6 +287,10 @@ module UltracartClient
273
287
  self.step_uuid = attributes[:'step_uuid']
274
288
  end
275
289
 
290
+ if attributes.key?(:'tracking_provider')
291
+ self.tracking_provider = attributes[:'tracking_provider']
292
+ end
293
+
276
294
  if attributes.key?(:'upsell_kind')
277
295
  self.upsell_kind = attributes[:'upsell_kind']
278
296
  end
@@ -324,6 +342,7 @@ module UltracartClient
324
342
  def ==(o)
325
343
  return true if self.equal?(o)
326
344
  self.class == o.class &&
345
+ affiliate_network_oid == o.affiliate_network_oid &&
327
346
  after_step_uuid == o.after_step_uuid &&
328
347
  attribute_names == o.attribute_names &&
329
348
  blog_post_oid == o.blog_post_oid &&
@@ -343,6 +362,7 @@ module UltracartClient
343
362
  side == o.side &&
344
363
  slot == o.slot &&
345
364
  step_uuid == o.step_uuid &&
365
+ tracking_provider == o.tracking_provider &&
346
366
  upsell_kind == o.upsell_kind &&
347
367
  upsell_oid == o.upsell_oid &&
348
368
  version == o.version &&
@@ -359,7 +379,7 @@ module UltracartClient
359
379
  # Calculates hash code according to all attributes.
360
380
  # @return [Integer] Hash code
361
381
  def hash
362
- [after_step_uuid, attribute_names, blog_post_oid, branch_step_uuid, content_sha256, domain, esp_twilio_uuid, experiment_oid, item_count, merchant_item_oid, path, request_sha256, rows_sha256, rule_count, segment_uuid, sequence_uuid, side, slot, step_uuid, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
382
+ [affiliate_network_oid, after_step_uuid, attribute_names, blog_post_oid, branch_step_uuid, content_sha256, domain, esp_twilio_uuid, experiment_oid, item_count, merchant_item_oid, path, request_sha256, rows_sha256, rule_count, segment_uuid, sequence_uuid, side, slot, step_uuid, tracking_provider, upsell_kind, upsell_oid, version, widget_id, winner_variation_number].hash
363
383
  end
364
384
 
365
385
  # Builds the object from hash
@@ -36,6 +36,9 @@ module UltracartClient
36
36
  # Where this container lives.
37
37
  attr_accessor :owner_type
38
38
 
39
+ # Quality warnings from validating this write. The write succeeded; each one says what to look at, such as a postcard QR code URL with a fragment. Absent when there are none.
40
+ attr_accessor :warnings
41
+
39
42
  class EnumAttributeValidator
40
43
  attr_reader :datatype
41
44
  attr_reader :allowable_values
@@ -67,7 +70,8 @@ module UltracartClient
67
70
  :'last_modified' => :'last_modified',
68
71
  :'merchant_item_id' => :'merchant_item_id',
69
72
  :'owner_object_id' => :'owner_object_id',
70
- :'owner_type' => :'owner_type'
73
+ :'owner_type' => :'owner_type',
74
+ :'warnings' => :'warnings'
71
75
  }
72
76
  end
73
77
 
@@ -85,7 +89,8 @@ module UltracartClient
85
89
  :'last_modified' => :'String',
86
90
  :'merchant_item_id' => :'String',
87
91
  :'owner_object_id' => :'String',
88
- :'owner_type' => :'String'
92
+ :'owner_type' => :'String',
93
+ :'warnings' => :'Array<SfvbErrorDetail>'
89
94
  }
90
95
  end
91
96
 
@@ -137,6 +142,12 @@ module UltracartClient
137
142
  if attributes.key?(:'owner_type')
138
143
  self.owner_type = attributes[:'owner_type']
139
144
  end
145
+
146
+ if attributes.key?(:'warnings')
147
+ if (value = attributes[:'warnings']).is_a?(Array)
148
+ self.warnings = value
149
+ end
150
+ end
140
151
  end
141
152
 
142
153
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -175,7 +186,8 @@ module UltracartClient
175
186
  last_modified == o.last_modified &&
176
187
  merchant_item_id == o.merchant_item_id &&
177
188
  owner_object_id == o.owner_object_id &&
178
- owner_type == o.owner_type
189
+ owner_type == o.owner_type &&
190
+ warnings == o.warnings
179
191
  end
180
192
 
181
193
  # @see the `==` method
@@ -187,7 +199,7 @@ module UltracartClient
187
199
  # Calculates hash code according to all attributes.
188
200
  # @return [Integer] Hash code
189
201
  def hash
190
- [cjson, container_name, hash_sha256, last_modified, merchant_item_id, owner_object_id, owner_type].hash
202
+ [cjson, container_name, hash_sha256, last_modified, merchant_item_id, owner_object_id, owner_type, warnings].hash
191
203
  end
192
204
 
193
205
  # Builds the object from hash
@@ -0,0 +1,324 @@
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 SfvbSmartAttribution
18
+ # The global assist credit, 0 to 1.
19
+ attr_accessor :assist_percent
20
+
21
+ # position_based, linear, time_decay or custom.
22
+ attr_accessor :attribution_model
23
+
24
+ # Platforms detected from the storefront's tracking integrations that are not configured yet, with suggested settings.
25
+ attr_accessor :available_platforms
26
+
27
+ # The global closer credit, 0 to 1.
28
+ attr_accessor :closer_percent
29
+
30
+ # True when the storefront has a saved configuration. When false, the other fields are the defaults an enable would save.
31
+ attr_accessor :configured
32
+
33
+ # The hash of the configuration. Send it as If-Match when changing or deleting it.
34
+ attr_accessor :hash_sha256
35
+
36
+ # How many days of a shopper's visits count toward an order, 7 to 365.
37
+ attr_accessor :lookback_days
38
+
39
+ # disabled, report_only (decisions are recorded but every platform reports as before) or active (Smart Attribution decides whether each platform's conversion fires and what value it reports).
40
+ attr_accessor :mode
41
+
42
+ # The global originator credit, 0 to 1. The three global percentages total exactly 1.
43
+ attr_accessor :originator_percent
44
+
45
+ # The configured platforms.
46
+ attr_accessor :platforms
47
+
48
+ # The storefront this configuration belongs to.
49
+ attr_accessor :storefront_oid
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'assist_percent' => :'assist_percent',
55
+ :'attribution_model' => :'attribution_model',
56
+ :'available_platforms' => :'available_platforms',
57
+ :'closer_percent' => :'closer_percent',
58
+ :'configured' => :'configured',
59
+ :'hash_sha256' => :'hash_sha256',
60
+ :'lookback_days' => :'lookback_days',
61
+ :'mode' => :'mode',
62
+ :'originator_percent' => :'originator_percent',
63
+ :'platforms' => :'platforms',
64
+ :'storefront_oid' => :'storefront_oid'
65
+ }
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'assist_percent' => :'Float',
77
+ :'attribution_model' => :'String',
78
+ :'available_platforms' => :'Array<SfvbSmartAttributionPlatform>',
79
+ :'closer_percent' => :'Float',
80
+ :'configured' => :'Boolean',
81
+ :'hash_sha256' => :'String',
82
+ :'lookback_days' => :'Integer',
83
+ :'mode' => :'String',
84
+ :'originator_percent' => :'Float',
85
+ :'platforms' => :'Array<SfvbSmartAttributionPlatform>',
86
+ :'storefront_oid' => :'Integer'
87
+ }
88
+ end
89
+
90
+ # List of attributes with nullable: true
91
+ def self.openapi_nullable
92
+ Set.new([
93
+ ])
94
+ end
95
+
96
+ # Initializes the object
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ def initialize(attributes = {})
99
+ if (!attributes.is_a?(Hash))
100
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbSmartAttribution` initialize method"
101
+ end
102
+
103
+ # check to see if the attribute exists and convert string to symbol for hash key
104
+ attributes = attributes.each_with_object({}) { |(k, v), h|
105
+ if (!self.class.attribute_map.key?(k.to_sym))
106
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbSmartAttribution`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
107
+ end
108
+ h[k.to_sym] = v
109
+ }
110
+
111
+ if attributes.key?(:'assist_percent')
112
+ self.assist_percent = attributes[:'assist_percent']
113
+ end
114
+
115
+ if attributes.key?(:'attribution_model')
116
+ self.attribution_model = attributes[:'attribution_model']
117
+ end
118
+
119
+ if attributes.key?(:'available_platforms')
120
+ if (value = attributes[:'available_platforms']).is_a?(Array)
121
+ self.available_platforms = value
122
+ end
123
+ end
124
+
125
+ if attributes.key?(:'closer_percent')
126
+ self.closer_percent = attributes[:'closer_percent']
127
+ end
128
+
129
+ if attributes.key?(:'configured')
130
+ self.configured = attributes[:'configured']
131
+ end
132
+
133
+ if attributes.key?(:'hash_sha256')
134
+ self.hash_sha256 = attributes[:'hash_sha256']
135
+ end
136
+
137
+ if attributes.key?(:'lookback_days')
138
+ self.lookback_days = attributes[:'lookback_days']
139
+ end
140
+
141
+ if attributes.key?(:'mode')
142
+ self.mode = attributes[:'mode']
143
+ end
144
+
145
+ if attributes.key?(:'originator_percent')
146
+ self.originator_percent = attributes[:'originator_percent']
147
+ end
148
+
149
+ if attributes.key?(:'platforms')
150
+ if (value = attributes[:'platforms']).is_a?(Array)
151
+ self.platforms = value
152
+ end
153
+ end
154
+
155
+ if attributes.key?(:'storefront_oid')
156
+ self.storefront_oid = attributes[:'storefront_oid']
157
+ end
158
+ end
159
+
160
+ # Show invalid properties with the reasons. Usually used together with valid?
161
+ # @return Array for valid properties with the reasons
162
+ def list_invalid_properties
163
+ invalid_properties = Array.new
164
+ invalid_properties
165
+ end
166
+
167
+ # Check to see if the all the properties in the model are valid
168
+ # @return true if the model is valid
169
+ def valid?
170
+ true
171
+ end
172
+
173
+ # Checks equality by comparing each attribute.
174
+ # @param [Object] Object to be compared
175
+ def ==(o)
176
+ return true if self.equal?(o)
177
+ self.class == o.class &&
178
+ assist_percent == o.assist_percent &&
179
+ attribution_model == o.attribution_model &&
180
+ available_platforms == o.available_platforms &&
181
+ closer_percent == o.closer_percent &&
182
+ configured == o.configured &&
183
+ hash_sha256 == o.hash_sha256 &&
184
+ lookback_days == o.lookback_days &&
185
+ mode == o.mode &&
186
+ originator_percent == o.originator_percent &&
187
+ platforms == o.platforms &&
188
+ storefront_oid == o.storefront_oid
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [assist_percent, attribution_model, available_platforms, closer_percent, configured, hash_sha256, lookback_days, mode, originator_percent, platforms, storefront_oid].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ new.build_from_hash(attributes)
208
+ end
209
+
210
+ # Builds the object from hash
211
+ # @param [Hash] attributes Model attributes in the form of hash
212
+ # @return [Object] Returns the model itself
213
+ def build_from_hash(attributes)
214
+ return nil unless attributes.is_a?(Hash)
215
+ attributes = attributes.transform_keys(&:to_sym)
216
+ self.class.openapi_types.each_pair do |key, type|
217
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
218
+ self.send("#{key}=", nil)
219
+ elsif type =~ /\AArray<(.*)>/i
220
+ # check to ensure the input is an array given that the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
223
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
+ end
225
+ elsif !attributes[self.class.attribute_map[key]].nil?
226
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
+ end
228
+ end
229
+
230
+ self
231
+ end
232
+
233
+ # Deserializes the data based on type
234
+ # @param string type Data type
235
+ # @param string value Value to be deserialized
236
+ # @return [Object] Deserialized data
237
+ def _deserialize(type, value)
238
+ case type.to_sym
239
+ when :Time
240
+ Time.parse(value)
241
+ when :Date
242
+ Date.parse(value)
243
+ when :String
244
+ value.to_s
245
+ when :Integer
246
+ value.to_i
247
+ when :Float
248
+ value.to_f
249
+ when :Boolean
250
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
+ true
252
+ else
253
+ false
254
+ end
255
+ when :Object
256
+ # generic object (usually a Hash), return directly
257
+ value
258
+ when /\AArray<(?<inner_type>.+)>\z/
259
+ inner_type = Regexp.last_match[:inner_type]
260
+ value.map { |v| _deserialize(inner_type, v) }
261
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
+ k_type = Regexp.last_match[:k_type]
263
+ v_type = Regexp.last_match[:v_type]
264
+ {}.tap do |hash|
265
+ value.each do |k, v|
266
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
+ end
268
+ end
269
+ else # model
270
+ # models (e.g. Pet) or oneOf
271
+ klass = UltracartClient.const_get(type)
272
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
273
+ end
274
+ end
275
+
276
+ # Returns the string representation of the object
277
+ # @return [String] String presentation of the object
278
+ def to_s
279
+ to_hash.to_s
280
+ end
281
+
282
+ # to_body is an alias to to_hash (backward compatibility)
283
+ # @return [Hash] Returns the object in the form of hash
284
+ def to_body
285
+ to_hash
286
+ end
287
+
288
+ # Returns the object in the form of hash
289
+ # @return [Hash] Returns the object in the form of hash
290
+ def to_hash
291
+ hash = {}
292
+ self.class.attribute_map.each_pair do |attr, param|
293
+ value = self.send(attr)
294
+ if value.nil?
295
+ is_nullable = self.class.openapi_nullable.include?(attr)
296
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
297
+ end
298
+
299
+ hash[param] = _to_hash(value)
300
+ end
301
+ hash
302
+ end
303
+
304
+ # Outputs non-array value in the form of hash
305
+ # For object, use to_hash. Otherwise, just return the value
306
+ # @param [Object] value Any valid value
307
+ # @return [Hash] Returns the value in the form of hash
308
+ def _to_hash(value)
309
+ if value.is_a?(Array)
310
+ value.compact.map { |v| _to_hash(v) }
311
+ elsif value.is_a?(Hash)
312
+ {}.tap do |hash|
313
+ value.each { |k, v| hash[k] = _to_hash(v) }
314
+ end
315
+ elsif value.respond_to? :to_hash
316
+ value.to_hash
317
+ else
318
+ value
319
+ end
320
+ end
321
+
322
+ end
323
+
324
+ end