ultracart_api 3.10.164 → 3.10.165

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -4
  3. data/docs/WorkflowApi.md +436 -0
  4. data/docs/WorkflowAttachment.md +12 -0
  5. data/docs/WorkflowAttachmentUploadUrl.md +9 -0
  6. data/docs/WorkflowAttachmentUploadUrlResponse.md +12 -0
  7. data/docs/WorkflowGroup.md +9 -0
  8. data/docs/WorkflowGroupsResponse.md +12 -0
  9. data/docs/WorkflowNote.md +13 -0
  10. data/docs/WorkflowTask.md +29 -0
  11. data/docs/WorkflowTaskHistory.md +11 -0
  12. data/docs/WorkflowTaskResponse.md +12 -0
  13. data/docs/WorkflowTasksRequest.md +23 -0
  14. data/docs/WorkflowTasksResponse.md +12 -0
  15. data/docs/WorkflowUser.md +10 -0
  16. data/docs/WorkflowUsersResponse.md +12 -0
  17. data/lib/ultracart_api/api/workflow_api.rb +497 -0
  18. data/lib/ultracart_api/models/workflow_attachment.rb +225 -0
  19. data/lib/ultracart_api/models/workflow_attachment_upload_url.rb +193 -0
  20. data/lib/ultracart_api/models/workflow_attachment_upload_url_response.rb +221 -0
  21. data/lib/ultracart_api/models/workflow_group.rb +195 -0
  22. data/lib/ultracart_api/models/workflow_groups_response.rb +224 -0
  23. data/lib/ultracart_api/models/workflow_note.rb +236 -0
  24. data/lib/ultracart_api/models/workflow_task.rb +458 -0
  25. data/lib/ultracart_api/models/workflow_task_history.rb +214 -0
  26. data/lib/ultracart_api/models/workflow_task_response.rb +221 -0
  27. data/lib/ultracart_api/models/workflow_tasks_request.rb +392 -0
  28. data/lib/ultracart_api/models/workflow_tasks_response.rb +224 -0
  29. data/lib/ultracart_api/models/workflow_user.rb +205 -0
  30. data/lib/ultracart_api/models/workflow_users_response.rb +224 -0
  31. data/lib/ultracart_api/version.rb +1 -1
  32. data/lib/ultracart_api.rb +14 -0
  33. metadata +29 -1
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class WorkflowTaskResponse
17
+ attr_accessor :error
18
+
19
+ attr_accessor :metadata
20
+
21
+ # Indicates if API call was successful
22
+ attr_accessor :success
23
+
24
+ attr_accessor :task
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'error' => :'error',
32
+ :'metadata' => :'metadata',
33
+ :'success' => :'success',
34
+ :'task' => :'task',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'error' => :'Error',
43
+ :'metadata' => :'ResponseMetadata',
44
+ :'success' => :'BOOLEAN',
45
+ :'task' => :'WorkflowTask',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'error')
59
+ self.error = attributes[:'error']
60
+ end
61
+
62
+ if attributes.has_key?(:'metadata')
63
+ self.metadata = attributes[:'metadata']
64
+ end
65
+
66
+ if attributes.has_key?(:'success')
67
+ self.success = attributes[:'success']
68
+ end
69
+
70
+ if attributes.has_key?(:'task')
71
+ self.task = attributes[:'task']
72
+ end
73
+
74
+ if attributes.has_key?(:'warning')
75
+ self.warning = attributes[:'warning']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ invalid_properties = Array.new
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ true
90
+ end
91
+
92
+ # Checks equality by comparing each attribute.
93
+ # @param [Object] Object to be compared
94
+ def ==(o)
95
+ return true if self.equal?(o)
96
+ self.class == o.class &&
97
+ error == o.error &&
98
+ metadata == o.metadata &&
99
+ success == o.success &&
100
+ task == o.task &&
101
+ warning == o.warning
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Fixnum] Hash code
112
+ def hash
113
+ [error, metadata, success, task, warning].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ self.class.swagger_types.each_pair do |key, type|
122
+ if type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
126
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
127
+ end
128
+ elsif !attributes[self.class.attribute_map[key]].nil?
129
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
130
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
131
+ end
132
+
133
+ self
134
+ end
135
+
136
+ # Deserializes the data based on type
137
+ # @param string type Data type
138
+ # @param string value Value to be deserialized
139
+ # @return [Object] Deserialized data
140
+ def _deserialize(type, value)
141
+ case type.to_sym
142
+ when :DateTime
143
+ DateTime.parse(value)
144
+ when :Date
145
+ Date.parse(value)
146
+ when :String
147
+ value.to_s
148
+ when :Integer
149
+ value.to_i
150
+ when :Float
151
+ value.to_f
152
+ when :BOOLEAN
153
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
154
+ true
155
+ else
156
+ false
157
+ end
158
+ when :Object
159
+ # generic object (usually a Hash), return directly
160
+ value
161
+ when /\AArray<(?<inner_type>.+)>\z/
162
+ inner_type = Regexp.last_match[:inner_type]
163
+ value.map { |v| _deserialize(inner_type, v) }
164
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
165
+ k_type = Regexp.last_match[:k_type]
166
+ v_type = Regexp.last_match[:v_type]
167
+ {}.tap do |hash|
168
+ value.each do |k, v|
169
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
170
+ end
171
+ end
172
+ else # model
173
+ temp_model = UltracartClient.const_get(type).new
174
+ temp_model.build_from_hash(value)
175
+ end
176
+ end
177
+
178
+ # Returns the string representation of the object
179
+ # @return [String] String presentation of the object
180
+ def to_s
181
+ to_hash.to_s
182
+ end
183
+
184
+ # to_body is an alias to to_hash (backward compatibility)
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_body
187
+ to_hash
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ next if value.nil?
197
+ hash[param] = _to_hash(value)
198
+ end
199
+ hash
200
+ end
201
+
202
+ # Outputs non-array value in the form of hash
203
+ # For object, use to_hash. Otherwise, just return the value
204
+ # @param [Object] value Any valid value
205
+ # @return [Hash] Returns the value in the form of hash
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map { |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+ end
@@ -0,0 +1,392 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class WorkflowTasksRequest
17
+ # Assigned to group ID
18
+ attr_accessor :assigned_to_group_id
19
+
20
+ # Tasks are assigned to me either by direct user id or a group that the user is a member of
21
+ attr_accessor :assigned_to_me
22
+
23
+ # Assigned to user ID
24
+ attr_accessor :assigned_to_user_id
25
+
26
+ attr_accessor :created_by
27
+
28
+ # Date/time that the workflow task was created
29
+ attr_accessor :created_dts_begin
30
+
31
+ # Date/time that the workflow task was created
32
+ attr_accessor :created_dts_end
33
+
34
+ # Date/time that the workflow task should delay until
35
+ attr_accessor :delay_until_dts
36
+
37
+ # Date/time that the workflow task is due
38
+ attr_accessor :due_dts_begin
39
+
40
+ # Date/time that the workflow task is due
41
+ attr_accessor :due_dts_end
42
+
43
+ # Date/time that the workflow task was last updated
44
+ attr_accessor :last_update_dts_begin
45
+
46
+ # Date/time that the workflow task was last updated
47
+ attr_accessor :last_update_dts_end
48
+
49
+ # Object is associated with customer email
50
+ attr_accessor :object_email
51
+
52
+ # Object Type
53
+ attr_accessor :object_type
54
+
55
+ # Priority
56
+ attr_accessor :priority
57
+
58
+ # Status of the workflow task
59
+ attr_accessor :status
60
+
61
+ # Tasks that are unassigned to a user or group
62
+ attr_accessor :unassigned
63
+
64
+ class EnumAttributeValidator
65
+ attr_reader :datatype
66
+ attr_reader :allowable_values
67
+
68
+ def initialize(datatype, allowable_values)
69
+ @allowable_values = allowable_values.map do |value|
70
+ case datatype.to_s
71
+ when /Integer/i
72
+ value.to_i
73
+ when /Float/i
74
+ value.to_f
75
+ else
76
+ value
77
+ end
78
+ end
79
+ end
80
+
81
+ def valid?(value)
82
+ !value || allowable_values.include?(value)
83
+ end
84
+ end
85
+
86
+ # Attribute mapping from ruby-style variable name to JSON key.
87
+ def self.attribute_map
88
+ {
89
+ :'assigned_to_group_id' => :'assigned_to_group_id',
90
+ :'assigned_to_me' => :'assigned_to_me',
91
+ :'assigned_to_user_id' => :'assigned_to_user_id',
92
+ :'created_by' => :'created_by',
93
+ :'created_dts_begin' => :'created_dts_begin',
94
+ :'created_dts_end' => :'created_dts_end',
95
+ :'delay_until_dts' => :'delay_until_dts',
96
+ :'due_dts_begin' => :'due_dts_begin',
97
+ :'due_dts_end' => :'due_dts_end',
98
+ :'last_update_dts_begin' => :'last_update_dts_begin',
99
+ :'last_update_dts_end' => :'last_update_dts_end',
100
+ :'object_email' => :'object_email',
101
+ :'object_type' => :'object_type',
102
+ :'priority' => :'priority',
103
+ :'status' => :'status',
104
+ :'unassigned' => :'unassigned'
105
+ }
106
+ end
107
+
108
+ # Attribute type mapping.
109
+ def self.swagger_types
110
+ {
111
+ :'assigned_to_group_id' => :'Integer',
112
+ :'assigned_to_me' => :'BOOLEAN',
113
+ :'assigned_to_user_id' => :'Integer',
114
+ :'created_by' => :'WorkflowUser',
115
+ :'created_dts_begin' => :'String',
116
+ :'created_dts_end' => :'String',
117
+ :'delay_until_dts' => :'String',
118
+ :'due_dts_begin' => :'String',
119
+ :'due_dts_end' => :'String',
120
+ :'last_update_dts_begin' => :'String',
121
+ :'last_update_dts_end' => :'String',
122
+ :'object_email' => :'String',
123
+ :'object_type' => :'String',
124
+ :'priority' => :'String',
125
+ :'status' => :'String',
126
+ :'unassigned' => :'BOOLEAN'
127
+ }
128
+ end
129
+
130
+ # Initializes the object
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ def initialize(attributes = {})
133
+ return unless attributes.is_a?(Hash)
134
+
135
+ # convert string to symbol for hash key
136
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
137
+
138
+ if attributes.has_key?(:'assigned_to_group_id')
139
+ self.assigned_to_group_id = attributes[:'assigned_to_group_id']
140
+ end
141
+
142
+ if attributes.has_key?(:'assigned_to_me')
143
+ self.assigned_to_me = attributes[:'assigned_to_me']
144
+ end
145
+
146
+ if attributes.has_key?(:'assigned_to_user_id')
147
+ self.assigned_to_user_id = attributes[:'assigned_to_user_id']
148
+ end
149
+
150
+ if attributes.has_key?(:'created_by')
151
+ self.created_by = attributes[:'created_by']
152
+ end
153
+
154
+ if attributes.has_key?(:'created_dts_begin')
155
+ self.created_dts_begin = attributes[:'created_dts_begin']
156
+ end
157
+
158
+ if attributes.has_key?(:'created_dts_end')
159
+ self.created_dts_end = attributes[:'created_dts_end']
160
+ end
161
+
162
+ if attributes.has_key?(:'delay_until_dts')
163
+ self.delay_until_dts = attributes[:'delay_until_dts']
164
+ end
165
+
166
+ if attributes.has_key?(:'due_dts_begin')
167
+ self.due_dts_begin = attributes[:'due_dts_begin']
168
+ end
169
+
170
+ if attributes.has_key?(:'due_dts_end')
171
+ self.due_dts_end = attributes[:'due_dts_end']
172
+ end
173
+
174
+ if attributes.has_key?(:'last_update_dts_begin')
175
+ self.last_update_dts_begin = attributes[:'last_update_dts_begin']
176
+ end
177
+
178
+ if attributes.has_key?(:'last_update_dts_end')
179
+ self.last_update_dts_end = attributes[:'last_update_dts_end']
180
+ end
181
+
182
+ if attributes.has_key?(:'object_email')
183
+ self.object_email = attributes[:'object_email']
184
+ end
185
+
186
+ if attributes.has_key?(:'object_type')
187
+ self.object_type = attributes[:'object_type']
188
+ end
189
+
190
+ if attributes.has_key?(:'priority')
191
+ self.priority = attributes[:'priority']
192
+ end
193
+
194
+ if attributes.has_key?(:'status')
195
+ self.status = attributes[:'status']
196
+ end
197
+
198
+ if attributes.has_key?(:'unassigned')
199
+ self.unassigned = attributes[:'unassigned']
200
+ end
201
+ end
202
+
203
+ # Show invalid properties with the reasons. Usually used together with valid?
204
+ # @return Array for valid properties with the reasons
205
+ def list_invalid_properties
206
+ invalid_properties = Array.new
207
+ invalid_properties
208
+ end
209
+
210
+ # Check to see if the all the properties in the model are valid
211
+ # @return true if the model is valid
212
+ def valid?
213
+ object_type_validator = EnumAttributeValidator.new('String', ['order', 'auto order', 'item', 'customer profile'])
214
+ return false unless object_type_validator.valid?(@object_type)
215
+ priority_validator = EnumAttributeValidator.new('String', ['1 - low', '2 - medium', '3 - high', '4 - critical'])
216
+ return false unless priority_validator.valid?(@priority)
217
+ status_validator = EnumAttributeValidator.new('String', ['open', 'closed', 'delayed', 'awaiting customer feedback'])
218
+ return false unless status_validator.valid?(@status)
219
+ true
220
+ end
221
+
222
+ # Custom attribute writer method checking allowed values (enum).
223
+ # @param [Object] object_type Object to be assigned
224
+ def object_type=(object_type)
225
+ validator = EnumAttributeValidator.new('String', ['order', 'auto order', 'item', 'customer profile'])
226
+ unless validator.valid?(object_type)
227
+ fail ArgumentError, 'invalid value for "object_type", must be one of #{validator.allowable_values}.'
228
+ end
229
+ @object_type = object_type
230
+ end
231
+
232
+ # Custom attribute writer method checking allowed values (enum).
233
+ # @param [Object] priority Object to be assigned
234
+ def priority=(priority)
235
+ validator = EnumAttributeValidator.new('String', ['1 - low', '2 - medium', '3 - high', '4 - critical'])
236
+ unless validator.valid?(priority)
237
+ fail ArgumentError, 'invalid value for "priority", must be one of #{validator.allowable_values}.'
238
+ end
239
+ @priority = priority
240
+ end
241
+
242
+ # Custom attribute writer method checking allowed values (enum).
243
+ # @param [Object] status Object to be assigned
244
+ def status=(status)
245
+ validator = EnumAttributeValidator.new('String', ['open', 'closed', 'delayed', 'awaiting customer feedback'])
246
+ unless validator.valid?(status)
247
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
248
+ end
249
+ @status = status
250
+ end
251
+
252
+ # Checks equality by comparing each attribute.
253
+ # @param [Object] Object to be compared
254
+ def ==(o)
255
+ return true if self.equal?(o)
256
+ self.class == o.class &&
257
+ assigned_to_group_id == o.assigned_to_group_id &&
258
+ assigned_to_me == o.assigned_to_me &&
259
+ assigned_to_user_id == o.assigned_to_user_id &&
260
+ created_by == o.created_by &&
261
+ created_dts_begin == o.created_dts_begin &&
262
+ created_dts_end == o.created_dts_end &&
263
+ delay_until_dts == o.delay_until_dts &&
264
+ due_dts_begin == o.due_dts_begin &&
265
+ due_dts_end == o.due_dts_end &&
266
+ last_update_dts_begin == o.last_update_dts_begin &&
267
+ last_update_dts_end == o.last_update_dts_end &&
268
+ object_email == o.object_email &&
269
+ object_type == o.object_type &&
270
+ priority == o.priority &&
271
+ status == o.status &&
272
+ unassigned == o.unassigned
273
+ end
274
+
275
+ # @see the `==` method
276
+ # @param [Object] Object to be compared
277
+ def eql?(o)
278
+ self == o
279
+ end
280
+
281
+ # Calculates hash code according to all attributes.
282
+ # @return [Fixnum] Hash code
283
+ def hash
284
+ [assigned_to_group_id, assigned_to_me, assigned_to_user_id, created_by, created_dts_begin, created_dts_end, delay_until_dts, due_dts_begin, due_dts_end, last_update_dts_begin, last_update_dts_end, object_email, object_type, priority, status, unassigned].hash
285
+ end
286
+
287
+ # Builds the object from hash
288
+ # @param [Hash] attributes Model attributes in the form of hash
289
+ # @return [Object] Returns the model itself
290
+ def build_from_hash(attributes)
291
+ return nil unless attributes.is_a?(Hash)
292
+ self.class.swagger_types.each_pair do |key, type|
293
+ if type =~ /\AArray<(.*)>/i
294
+ # check to ensure the input is an array given that the attribute
295
+ # is documented as an array but the input is not
296
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
297
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
298
+ end
299
+ elsif !attributes[self.class.attribute_map[key]].nil?
300
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
301
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
302
+ end
303
+
304
+ self
305
+ end
306
+
307
+ # Deserializes the data based on type
308
+ # @param string type Data type
309
+ # @param string value Value to be deserialized
310
+ # @return [Object] Deserialized data
311
+ def _deserialize(type, value)
312
+ case type.to_sym
313
+ when :DateTime
314
+ DateTime.parse(value)
315
+ when :Date
316
+ Date.parse(value)
317
+ when :String
318
+ value.to_s
319
+ when :Integer
320
+ value.to_i
321
+ when :Float
322
+ value.to_f
323
+ when :BOOLEAN
324
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
325
+ true
326
+ else
327
+ false
328
+ end
329
+ when :Object
330
+ # generic object (usually a Hash), return directly
331
+ value
332
+ when /\AArray<(?<inner_type>.+)>\z/
333
+ inner_type = Regexp.last_match[:inner_type]
334
+ value.map { |v| _deserialize(inner_type, v) }
335
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
336
+ k_type = Regexp.last_match[:k_type]
337
+ v_type = Regexp.last_match[:v_type]
338
+ {}.tap do |hash|
339
+ value.each do |k, v|
340
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
341
+ end
342
+ end
343
+ else # model
344
+ temp_model = UltracartClient.const_get(type).new
345
+ temp_model.build_from_hash(value)
346
+ end
347
+ end
348
+
349
+ # Returns the string representation of the object
350
+ # @return [String] String presentation of the object
351
+ def to_s
352
+ to_hash.to_s
353
+ end
354
+
355
+ # to_body is an alias to to_hash (backward compatibility)
356
+ # @return [Hash] Returns the object in the form of hash
357
+ def to_body
358
+ to_hash
359
+ end
360
+
361
+ # Returns the object in the form of hash
362
+ # @return [Hash] Returns the object in the form of hash
363
+ def to_hash
364
+ hash = {}
365
+ self.class.attribute_map.each_pair do |attr, param|
366
+ value = self.send(attr)
367
+ next if value.nil?
368
+ hash[param] = _to_hash(value)
369
+ end
370
+ hash
371
+ end
372
+
373
+ # Outputs non-array value in the form of hash
374
+ # For object, use to_hash. Otherwise, just return the value
375
+ # @param [Object] value Any valid value
376
+ # @return [Hash] Returns the value in the form of hash
377
+ def _to_hash(value)
378
+ if value.is_a?(Array)
379
+ value.compact.map { |v| _to_hash(v) }
380
+ elsif value.is_a?(Hash)
381
+ {}.tap do |hash|
382
+ value.each { |k, v| hash[k] = _to_hash(v) }
383
+ end
384
+ elsif value.respond_to? :to_hash
385
+ value.to_hash
386
+ else
387
+ value
388
+ end
389
+ end
390
+
391
+ end
392
+ end