ultracart_api 4.1.160 → 4.1.161

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -2
  3. data/docs/SfvbApi.md +1123 -10
  4. data/docs/SfvbBlogPost.md +30 -0
  5. data/docs/SfvbBlogPostsResponse.md +24 -0
  6. data/docs/SfvbExperiment.md +36 -0
  7. data/docs/SfvbExperimentEndRequest.md +18 -0
  8. data/docs/SfvbExperimentObjective.md +24 -0
  9. data/docs/SfvbExperimentObjectivesResponse.md +18 -0
  10. data/docs/SfvbExperimentStartRequest.md +40 -0
  11. data/docs/SfvbExperimentStartVariation.md +22 -0
  12. data/docs/SfvbExperimentVariationUpdateRequest.md +18 -0
  13. data/docs/SfvbExperimentsResponse.md +18 -0
  14. data/docs/SfvbPageBlogPostSelector.md +26 -0
  15. data/docs/SfvbPageBlogPostsRequest.md +18 -0
  16. data/docs/SfvbPageBlogPostsResponse.md +22 -0
  17. data/docs/SfvbPageCreateRequest.md +34 -0
  18. data/docs/SfvbPageDuplicateRequest.md +22 -0
  19. data/docs/SfvbPageItem.md +26 -0
  20. data/docs/SfvbPageItemSelector.md +42 -0
  21. data/docs/SfvbPageItemsAddRequest.md +18 -0
  22. data/docs/SfvbPageItemsRemoveRequest.md +18 -0
  23. data/docs/SfvbPageItemsResponse.md +24 -0
  24. data/docs/SfvbPageListResponse.md +18 -0
  25. data/docs/SfvbPageResponse.md +13 -1
  26. data/docs/SfvbPageSelectors.md +26 -0
  27. data/docs/SfvbPageSettingsRequest.md +44 -0
  28. data/docs/SfvbPageSummary.md +44 -0
  29. data/docs/SfvbTemplate.md +36 -0
  30. data/docs/SfvbTemplatesResponse.md +20 -0
  31. data/lib/ultracart_api/api/sfvb_api.rb +1722 -211
  32. data/lib/ultracart_api/models/sfvb_blog_post.rb +280 -0
  33. data/lib/ultracart_api/models/sfvb_blog_posts_response.rb +252 -0
  34. data/lib/ultracart_api/models/sfvb_experiment.rb +309 -0
  35. data/lib/ultracart_api/models/sfvb_experiment_end_request.rb +220 -0
  36. data/lib/ultracart_api/models/sfvb_experiment_objective.rb +250 -0
  37. data/lib/ultracart_api/models/sfvb_experiment_objectives_response.rb +222 -0
  38. data/lib/ultracart_api/models/sfvb_experiment_start_request.rb +332 -0
  39. data/lib/ultracart_api/models/sfvb_experiment_start_variation.rb +240 -0
  40. data/lib/ultracart_api/models/sfvb_experiment_variation_update_request.rb +220 -0
  41. data/lib/ultracart_api/models/sfvb_experiments_response.rb +222 -0
  42. data/lib/ultracart_api/models/sfvb_page_blog_post_selector.rb +260 -0
  43. data/lib/ultracart_api/models/sfvb_page_blog_posts_request.rb +222 -0
  44. data/lib/ultracart_api/models/sfvb_page_blog_posts_response.rb +242 -0
  45. data/lib/ultracart_api/models/sfvb_page_create_request.rb +300 -0
  46. data/lib/ultracart_api/models/sfvb_page_duplicate_request.rb +240 -0
  47. data/lib/ultracart_api/models/sfvb_page_item.rb +260 -0
  48. data/lib/ultracart_api/models/sfvb_page_item_selector.rb +340 -0
  49. data/lib/ultracart_api/models/sfvb_page_items_add_request.rb +222 -0
  50. data/lib/ultracart_api/models/sfvb_page_items_remove_request.rb +222 -0
  51. data/lib/ultracart_api/models/sfvb_page_items_response.rb +252 -0
  52. data/lib/ultracart_api/models/sfvb_page_list_response.rb +222 -0
  53. data/lib/ultracart_api/models/sfvb_page_response.rb +64 -4
  54. data/lib/ultracart_api/models/sfvb_page_selectors.rb +264 -0
  55. data/lib/ultracart_api/models/sfvb_page_settings_request.rb +350 -0
  56. data/lib/ultracart_api/models/sfvb_page_summary.rb +350 -0
  57. data/lib/ultracart_api/models/sfvb_template.rb +310 -0
  58. data/lib/ultracart_api/models/sfvb_templates_response.rb +232 -0
  59. data/lib/ultracart_api/version.rb +1 -1
  60. data/lib/ultracart_api.rb +26 -0
  61. metadata +53 -1
@@ -0,0 +1,280 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class SfvbBlogPost
18
+ # The post author.
19
+ attr_accessor :author
20
+
21
+ # The blog post's oid. This is what a page's blog post assignment names.
22
+ attr_accessor :blog_post_oid
23
+
24
+ # When the post was published (ISO 8601, UTC), or when it was created if it has no publication time.
25
+ attr_accessor :publication_dts
26
+
27
+ # The post title.
28
+ attr_accessor :title
29
+
30
+ # True when no page shows this post yet. Only reported by the blog post list.
31
+ attr_accessor :unassigned
32
+
33
+ # The post's name in its URL.
34
+ attr_accessor :url_part
35
+
36
+ # P public, L logged in customers only, D draft.
37
+ attr_accessor :visibility
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'author' => :'author',
43
+ :'blog_post_oid' => :'blog_post_oid',
44
+ :'publication_dts' => :'publication_dts',
45
+ :'title' => :'title',
46
+ :'unassigned' => :'unassigned',
47
+ :'url_part' => :'url_part',
48
+ :'visibility' => :'visibility'
49
+ }
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'author' => :'String',
61
+ :'blog_post_oid' => :'Integer',
62
+ :'publication_dts' => :'String',
63
+ :'title' => :'String',
64
+ :'unassigned' => :'Boolean',
65
+ :'url_part' => :'String',
66
+ :'visibility' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbBlogPost` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbBlogPost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'author')
92
+ self.author = attributes[:'author']
93
+ end
94
+
95
+ if attributes.key?(:'blog_post_oid')
96
+ self.blog_post_oid = attributes[:'blog_post_oid']
97
+ end
98
+
99
+ if attributes.key?(:'publication_dts')
100
+ self.publication_dts = attributes[:'publication_dts']
101
+ end
102
+
103
+ if attributes.key?(:'title')
104
+ self.title = attributes[:'title']
105
+ end
106
+
107
+ if attributes.key?(:'unassigned')
108
+ self.unassigned = attributes[:'unassigned']
109
+ end
110
+
111
+ if attributes.key?(:'url_part')
112
+ self.url_part = attributes[:'url_part']
113
+ end
114
+
115
+ if attributes.key?(:'visibility')
116
+ self.visibility = attributes[:'visibility']
117
+ end
118
+ end
119
+
120
+ # Show invalid properties with the reasons. Usually used together with valid?
121
+ # @return Array for valid properties with the reasons
122
+ def list_invalid_properties
123
+ invalid_properties = Array.new
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ author == o.author &&
139
+ blog_post_oid == o.blog_post_oid &&
140
+ publication_dts == o.publication_dts &&
141
+ title == o.title &&
142
+ unassigned == o.unassigned &&
143
+ url_part == o.url_part &&
144
+ visibility == o.visibility
145
+ end
146
+
147
+ # @see the `==` method
148
+ # @param [Object] Object to be compared
149
+ def eql?(o)
150
+ self == o
151
+ end
152
+
153
+ # Calculates hash code according to all attributes.
154
+ # @return [Integer] Hash code
155
+ def hash
156
+ [author, blog_post_oid, publication_dts, title, unassigned, url_part, visibility].hash
157
+ end
158
+
159
+ # Builds the object from hash
160
+ # @param [Hash] attributes Model attributes in the form of hash
161
+ # @return [Object] Returns the model itself
162
+ def self.build_from_hash(attributes)
163
+ new.build_from_hash(attributes)
164
+ end
165
+
166
+ # Builds the object from hash
167
+ # @param [Hash] attributes Model attributes in the form of hash
168
+ # @return [Object] Returns the model itself
169
+ def build_from_hash(attributes)
170
+ return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
172
+ self.class.openapi_types.each_pair do |key, type|
173
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ elsif type =~ /\AArray<(.*)>/i
176
+ # check to ensure the input is an array given that the attribute
177
+ # is documented as an array but the input is not
178
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
179
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
180
+ end
181
+ elsif !attributes[self.class.attribute_map[key]].nil?
182
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
+ end
184
+ end
185
+
186
+ self
187
+ end
188
+
189
+ # Deserializes the data based on type
190
+ # @param string type Data type
191
+ # @param string value Value to be deserialized
192
+ # @return [Object] Deserialized data
193
+ def _deserialize(type, value)
194
+ case type.to_sym
195
+ when :Time
196
+ Time.parse(value)
197
+ when :Date
198
+ Date.parse(value)
199
+ when :String
200
+ value.to_s
201
+ when :Integer
202
+ value.to_i
203
+ when :Float
204
+ value.to_f
205
+ when :Boolean
206
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
207
+ true
208
+ else
209
+ false
210
+ end
211
+ when :Object
212
+ # generic object (usually a Hash), return directly
213
+ value
214
+ when /\AArray<(?<inner_type>.+)>\z/
215
+ inner_type = Regexp.last_match[:inner_type]
216
+ value.map { |v| _deserialize(inner_type, v) }
217
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
218
+ k_type = Regexp.last_match[:k_type]
219
+ v_type = Regexp.last_match[:v_type]
220
+ {}.tap do |hash|
221
+ value.each do |k, v|
222
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
223
+ end
224
+ end
225
+ else # model
226
+ # models (e.g. Pet) or oneOf
227
+ klass = UltracartClient.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
229
+ end
230
+ end
231
+
232
+ # Returns the string representation of the object
233
+ # @return [String] String presentation of the object
234
+ def to_s
235
+ to_hash.to_s
236
+ end
237
+
238
+ # to_body is an alias to to_hash (backward compatibility)
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_body
241
+ to_hash
242
+ end
243
+
244
+ # Returns the object in the form of hash
245
+ # @return [Hash] Returns the object in the form of hash
246
+ def to_hash
247
+ hash = {}
248
+ self.class.attribute_map.each_pair do |attr, param|
249
+ value = self.send(attr)
250
+ if value.nil?
251
+ is_nullable = self.class.openapi_nullable.include?(attr)
252
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
253
+ end
254
+
255
+ hash[param] = _to_hash(value)
256
+ end
257
+ hash
258
+ end
259
+
260
+ # Outputs non-array value in the form of hash
261
+ # For object, use to_hash. Otherwise, just return the value
262
+ # @param [Object] value Any valid value
263
+ # @return [Hash] Returns the value in the form of hash
264
+ def _to_hash(value)
265
+ if value.is_a?(Array)
266
+ value.compact.map { |v| _to_hash(v) }
267
+ elsif value.is_a?(Hash)
268
+ {}.tap do |hash|
269
+ value.each { |k, v| hash[k] = _to_hash(v) }
270
+ end
271
+ elsif value.respond_to? :to_hash
272
+ value.to_hash
273
+ else
274
+ value
275
+ end
276
+ end
277
+
278
+ end
279
+
280
+ end
@@ -0,0 +1,252 @@
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 SfvbBlogPostsResponse
18
+ # One page of the storefront's blog posts, newest first.
19
+ attr_accessor :blog_posts
20
+
21
+ # The page returned, starting at 1.
22
+ attr_accessor :page
23
+
24
+ # Posts per page.
25
+ attr_accessor :page_size
26
+
27
+ # How many posts match, across all pages.
28
+ attr_accessor :total
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'blog_posts' => :'blog_posts',
34
+ :'page' => :'page',
35
+ :'page_size' => :'page_size',
36
+ :'total' => :'total'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'blog_posts' => :'Array<SfvbBlogPost>',
49
+ :'page' => :'Integer',
50
+ :'page_size' => :'Integer',
51
+ :'total' => :'Integer'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbBlogPostsResponse` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbBlogPostsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'blog_posts')
77
+ if (value = attributes[:'blog_posts']).is_a?(Array)
78
+ self.blog_posts = value
79
+ end
80
+ end
81
+
82
+ if attributes.key?(:'page')
83
+ self.page = attributes[:'page']
84
+ end
85
+
86
+ if attributes.key?(:'page_size')
87
+ self.page_size = attributes[:'page_size']
88
+ end
89
+
90
+ if attributes.key?(:'total')
91
+ self.total = attributes[:'total']
92
+ end
93
+ end
94
+
95
+ # Show invalid properties with the reasons. Usually used together with valid?
96
+ # @return Array for valid properties with the reasons
97
+ def list_invalid_properties
98
+ invalid_properties = Array.new
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ blog_posts == o.blog_posts &&
114
+ page == o.page &&
115
+ page_size == o.page_size &&
116
+ total == o.total
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [blog_posts, page, page_size, total].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ attributes = attributes.transform_keys(&:to_sym)
144
+ self.class.openapi_types.each_pair do |key, type|
145
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
146
+ self.send("#{key}=", nil)
147
+ elsif type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :Time
168
+ Time.parse(value)
169
+ when :Date
170
+ Date.parse(value)
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :Boolean
178
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
179
+ true
180
+ else
181
+ false
182
+ end
183
+ when :Object
184
+ # generic object (usually a Hash), return directly
185
+ value
186
+ when /\AArray<(?<inner_type>.+)>\z/
187
+ inner_type = Regexp.last_match[:inner_type]
188
+ value.map { |v| _deserialize(inner_type, v) }
189
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
190
+ k_type = Regexp.last_match[:k_type]
191
+ v_type = Regexp.last_match[:v_type]
192
+ {}.tap do |hash|
193
+ value.each do |k, v|
194
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
195
+ end
196
+ end
197
+ else # model
198
+ # models (e.g. Pet) or oneOf
199
+ klass = UltracartClient.const_get(type)
200
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ if value.nil?
223
+ is_nullable = self.class.openapi_nullable.include?(attr)
224
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
225
+ end
226
+
227
+ hash[param] = _to_hash(value)
228
+ end
229
+ hash
230
+ end
231
+
232
+ # Outputs non-array value in the form of hash
233
+ # For object, use to_hash. Otherwise, just return the value
234
+ # @param [Object] value Any valid value
235
+ # @return [Hash] Returns the value in the form of hash
236
+ def _to_hash(value)
237
+ if value.is_a?(Array)
238
+ value.compact.map { |v| _to_hash(v) }
239
+ elsif value.is_a?(Hash)
240
+ {}.tap do |hash|
241
+ value.each { |k, v| hash[k] = _to_hash(v) }
242
+ end
243
+ elsif value.respond_to? :to_hash
244
+ value.to_hash
245
+ else
246
+ value
247
+ end
248
+ end
249
+
250
+ end
251
+
252
+ end