ultracart_api 4.1.241 → 4.1.242

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.
@@ -0,0 +1,232 @@
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 SfvbThemeChangeLogEntry
18
+ # What changed in this version, each as category - description.
19
+ attr_accessor :changes
20
+
21
+ # Theme version this entry describes.
22
+ attr_accessor :version
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'changes' => :'changes',
28
+ :'version' => :'version'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'changes' => :'Array<String>',
41
+ :'version' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::SfvbThemeChangeLogEntry` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::SfvbThemeChangeLogEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'changes')
67
+ if (value = attributes[:'changes']).is_a?(Array)
68
+ self.changes = value
69
+ end
70
+ end
71
+
72
+ if attributes.key?(:'version')
73
+ self.version = attributes[:'version']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ invalid_properties = Array.new
81
+ invalid_properties
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ true
88
+ end
89
+
90
+ # Checks equality by comparing each attribute.
91
+ # @param [Object] Object to be compared
92
+ def ==(o)
93
+ return true if self.equal?(o)
94
+ self.class == o.class &&
95
+ changes == o.changes &&
96
+ version == o.version
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [changes, version].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ self.class.openapi_types.each_pair do |key, type|
125
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
126
+ self.send("#{key}=", nil)
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
131
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ end
133
+ elsif !attributes[self.class.attribute_map[key]].nil?
134
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ end
136
+ end
137
+
138
+ self
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def _deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = UltracartClient.const_get(type)
180
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end
@@ -24,12 +24,16 @@ module UltracartClient
24
24
  # Name for the new theme.
25
25
  attr_accessor :theme_name
26
26
 
27
+ # Upgrade the copy to this theme version after copying it, as the admin's Duplicate and Upgrade does. Only the copy is upgraded - the source theme is never touched. Must be one of the available_versions from getSfvbThemeUpgradeCheck, which also predicts the merge conflicts. Omit for a plain copy.
28
+ attr_accessor :upgrade_to_version
29
+
27
30
  # Attribute mapping from ruby-style variable name to JSON key.
28
31
  def self.attribute_map
29
32
  {
30
33
  :'folder' => :'folder',
31
34
  :'target_storefront_oid' => :'target_storefront_oid',
32
- :'theme_name' => :'theme_name'
35
+ :'theme_name' => :'theme_name',
36
+ :'upgrade_to_version' => :'upgrade_to_version'
33
37
  }
34
38
  end
35
39
 
@@ -43,7 +47,8 @@ module UltracartClient
43
47
  {
44
48
  :'folder' => :'String',
45
49
  :'target_storefront_oid' => :'Integer',
46
- :'theme_name' => :'String'
50
+ :'theme_name' => :'String',
51
+ :'upgrade_to_version' => :'String'
47
52
  }
48
53
  end
49
54
 
@@ -79,6 +84,10 @@ module UltracartClient
79
84
  if attributes.key?(:'theme_name')
80
85
  self.theme_name = attributes[:'theme_name']
81
86
  end
87
+
88
+ if attributes.key?(:'upgrade_to_version')
89
+ self.upgrade_to_version = attributes[:'upgrade_to_version']
90
+ end
82
91
  end
83
92
 
84
93
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -101,7 +110,8 @@ module UltracartClient
101
110
  self.class == o.class &&
102
111
  folder == o.folder &&
103
112
  target_storefront_oid == o.target_storefront_oid &&
104
- theme_name == o.theme_name
113
+ theme_name == o.theme_name &&
114
+ upgrade_to_version == o.upgrade_to_version
105
115
  end
106
116
 
107
117
  # @see the `==` method
@@ -113,7 +123,7 @@ module UltracartClient
113
123
  # Calculates hash code according to all attributes.
114
124
  # @return [Integer] Hash code
115
125
  def hash
116
- [folder, target_storefront_oid, theme_name].hash
126
+ [folder, target_storefront_oid, theme_name, upgrade_to_version].hash
117
127
  end
118
128
 
119
129
  # Builds the object from hash
@@ -30,6 +30,9 @@ module UltracartClient
30
30
  # Job handle. Poll getSfvbThemeJob with this.
31
31
  attr_accessor :job_id
32
32
 
33
+ # Paths of the copy's files that still have unresolved merge conflicts, read fresh on every poll, so the list shrinks as you resolve them. Each needs its conflict marker lines resolved and the file saved before the theme can be activated. Empty when there are none.
34
+ attr_accessor :merge_conflicts
35
+
33
36
  # Percent complete, 0-100.
34
37
  attr_accessor :progress
35
38
 
@@ -48,9 +51,15 @@ module UltracartClient
48
51
  # True only when the job finished successfully. Check complete first.
49
52
  attr_accessor :success
50
53
 
51
- # Path the new theme is being created at. Returned when the job is started and on every poll, so you do not have to keep the response that started it. The theme oid itself is NOT returned, so once the job completes you list themes and match on this path. It is also what success is checked against - a finished job whose theme is not here reports success false rather than pretending.
54
+ # Path the new theme is being created at. Returned when the job is started and on every poll, so you do not have to keep the response that started it. Once the job completes, the theme found at this path is reported as theme_oid. It is also what success is checked against - a finished job whose theme is not here reports success false rather than pretending.
52
55
  attr_accessor :target_path
53
56
 
57
+ # Oid of the theme the job created, once it is complete and the theme exists. Null until then.
58
+ attr_accessor :theme_oid
59
+
60
+ # The version the copy was asked to be upgraded to, when the duplicate asked for an upgrade. Null for a plain copy. A complete job reports success only when the copy is at this version.
61
+ attr_accessor :upgrade_to_version
62
+
54
63
  class EnumAttributeValidator
55
64
  attr_reader :datatype
56
65
  attr_reader :allowable_values
@@ -81,13 +90,16 @@ module UltracartClient
81
90
  :'error_message' => :'error_message',
82
91
  :'finished_dts' => :'finished_dts',
83
92
  :'job_id' => :'job_id',
93
+ :'merge_conflicts' => :'merge_conflicts',
84
94
  :'progress' => :'progress',
85
95
  :'progress_description' => :'progress_description',
86
96
  :'started_dts' => :'started_dts',
87
97
  :'status' => :'status',
88
98
  :'submitted_dts' => :'submitted_dts',
89
99
  :'success' => :'success',
90
- :'target_path' => :'target_path'
100
+ :'target_path' => :'target_path',
101
+ :'theme_oid' => :'theme_oid',
102
+ :'upgrade_to_version' => :'upgrade_to_version'
91
103
  }
92
104
  end
93
105
 
@@ -104,13 +116,16 @@ module UltracartClient
104
116
  :'error_message' => :'String',
105
117
  :'finished_dts' => :'String',
106
118
  :'job_id' => :'Integer',
119
+ :'merge_conflicts' => :'Array<String>',
107
120
  :'progress' => :'Integer',
108
121
  :'progress_description' => :'String',
109
122
  :'started_dts' => :'String',
110
123
  :'status' => :'String',
111
124
  :'submitted_dts' => :'String',
112
125
  :'success' => :'Boolean',
113
- :'target_path' => :'String'
126
+ :'target_path' => :'String',
127
+ :'theme_oid' => :'Integer',
128
+ :'upgrade_to_version' => :'String'
114
129
  }
115
130
  end
116
131
 
@@ -155,6 +170,12 @@ module UltracartClient
155
170
  self.job_id = attributes[:'job_id']
156
171
  end
157
172
 
173
+ if attributes.key?(:'merge_conflicts')
174
+ if (value = attributes[:'merge_conflicts']).is_a?(Array)
175
+ self.merge_conflicts = value
176
+ end
177
+ end
178
+
158
179
  if attributes.key?(:'progress')
159
180
  self.progress = attributes[:'progress']
160
181
  end
@@ -182,6 +203,14 @@ module UltracartClient
182
203
  if attributes.key?(:'target_path')
183
204
  self.target_path = attributes[:'target_path']
184
205
  end
206
+
207
+ if attributes.key?(:'theme_oid')
208
+ self.theme_oid = attributes[:'theme_oid']
209
+ end
210
+
211
+ if attributes.key?(:'upgrade_to_version')
212
+ self.upgrade_to_version = attributes[:'upgrade_to_version']
213
+ end
185
214
  end
186
215
 
187
216
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -219,13 +248,16 @@ module UltracartClient
219
248
  error_message == o.error_message &&
220
249
  finished_dts == o.finished_dts &&
221
250
  job_id == o.job_id &&
251
+ merge_conflicts == o.merge_conflicts &&
222
252
  progress == o.progress &&
223
253
  progress_description == o.progress_description &&
224
254
  started_dts == o.started_dts &&
225
255
  status == o.status &&
226
256
  submitted_dts == o.submitted_dts &&
227
257
  success == o.success &&
228
- target_path == o.target_path
258
+ target_path == o.target_path &&
259
+ theme_oid == o.theme_oid &&
260
+ upgrade_to_version == o.upgrade_to_version
229
261
  end
230
262
 
231
263
  # @see the `==` method
@@ -237,7 +269,7 @@ module UltracartClient
237
269
  # Calculates hash code according to all attributes.
238
270
  # @return [Integer] Hash code
239
271
  def hash
240
- [complete, description, error_message, finished_dts, job_id, progress, progress_description, started_dts, status, submitted_dts, success, target_path].hash
272
+ [complete, description, error_message, finished_dts, job_id, merge_conflicts, progress, progress_description, started_dts, status, submitted_dts, success, target_path, theme_oid, upgrade_to_version].hash
241
273
  end
242
274
 
243
275
  # Builds the object from hash