ultracart_api 4.0.180 → 4.0.182

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -5
  3. data/docs/ConversationApi.md +5 -5
  4. data/docs/WorkflowApi.md +603 -0
  5. data/docs/WorkflowAttachment.md +26 -0
  6. data/docs/WorkflowAttachmentUploadUrl.md +20 -0
  7. data/docs/WorkflowAttachmentUploadUrlResponse.md +26 -0
  8. data/docs/WorkflowGroup.md +20 -0
  9. data/docs/WorkflowGroupsResponse.md +26 -0
  10. data/docs/WorkflowNote.md +28 -0
  11. data/docs/WorkflowTask.md +60 -0
  12. data/docs/WorkflowTaskHistory.md +24 -0
  13. data/docs/WorkflowTaskResponse.md +26 -0
  14. data/docs/WorkflowTasksRequest.md +48 -0
  15. data/docs/WorkflowTasksResponse.md +26 -0
  16. data/docs/WorkflowUser.md +22 -0
  17. data/docs/WorkflowUsersResponse.md +26 -0
  18. data/lib/ultracart_api/api/conversation_api.rb +4 -4
  19. data/lib/ultracart_api/api/workflow_api.rb +583 -0
  20. data/lib/ultracart_api/models/workflow_attachment.rb +260 -0
  21. data/lib/ultracart_api/models/workflow_attachment_upload_url.rb +228 -0
  22. data/lib/ultracart_api/models/workflow_attachment_upload_url_response.rb +256 -0
  23. data/lib/ultracart_api/models/workflow_group.rb +230 -0
  24. data/lib/ultracart_api/models/workflow_groups_response.rb +259 -0
  25. data/lib/ultracart_api/models/workflow_note.rb +271 -0
  26. data/lib/ultracart_api/models/workflow_task.rb +493 -0
  27. data/lib/ultracart_api/models/workflow_task_history.rb +249 -0
  28. data/lib/ultracart_api/models/workflow_task_response.rb +256 -0
  29. data/lib/ultracart_api/models/workflow_tasks_request.rb +427 -0
  30. data/lib/ultracart_api/models/workflow_tasks_response.rb +259 -0
  31. data/lib/ultracart_api/models/workflow_user.rb +240 -0
  32. data/lib/ultracart_api/models/workflow_users_response.rb +259 -0
  33. data/lib/ultracart_api/version.rb +1 -1
  34. data/lib/ultracart_api.rb +14 -0
  35. metadata +30 -2
@@ -0,0 +1,493 @@
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 WorkflowTask
18
+ # Assigned to group
19
+ attr_accessor :assigned_to_group
20
+
21
+ # Assigned to group ID
22
+ attr_accessor :assigned_to_group_id
23
+
24
+ # Assigned to user
25
+ attr_accessor :assigned_to_user
26
+
27
+ # Assigned to user ID
28
+ attr_accessor :assigned_to_user_id
29
+
30
+ # Attachments to the Workflow Task
31
+ attr_accessor :attachments
32
+
33
+ attr_accessor :created_by
34
+
35
+ # Date/time that the workflow task was created
36
+ attr_accessor :created_dts
37
+
38
+ # Date/time that the workflow task should delay until
39
+ attr_accessor :delay_until_dts
40
+
41
+ # Date/time that the workflow task is due
42
+ attr_accessor :due_dts
43
+
44
+ # Array of history records for the task
45
+ attr_accessor :histories
46
+
47
+ # Date/time that the workflow task was last updated
48
+ attr_accessor :last_update_dts
49
+
50
+ # Merchant ID
51
+ attr_accessor :merchant_id
52
+
53
+ # Notes on the Workflow Task
54
+ attr_accessor :notes
55
+
56
+ # Object is associated with customer email
57
+ attr_accessor :object_email
58
+
59
+ # Object ID
60
+ attr_accessor :object_id
61
+
62
+ # Object Type
63
+ attr_accessor :object_type
64
+
65
+ # Object URL
66
+ attr_accessor :object_url
67
+
68
+ # Priority
69
+ attr_accessor :priority
70
+
71
+ # Status of the workflow task
72
+ attr_accessor :status
73
+
74
+ # Task Details
75
+ attr_accessor :task_details
76
+
77
+ # Task Name
78
+ attr_accessor :task_name
79
+
80
+ # Workflow Task UUID
81
+ attr_accessor :workflow_task_uuid
82
+
83
+ class EnumAttributeValidator
84
+ attr_reader :datatype
85
+ attr_reader :allowable_values
86
+
87
+ def initialize(datatype, allowable_values)
88
+ @allowable_values = allowable_values.map do |value|
89
+ case datatype.to_s
90
+ when /Integer/i
91
+ value.to_i
92
+ when /Float/i
93
+ value.to_f
94
+ else
95
+ value
96
+ end
97
+ end
98
+ end
99
+
100
+ def valid?(value)
101
+ !value || allowable_values.include?(value)
102
+ end
103
+ end
104
+
105
+ # Attribute mapping from ruby-style variable name to JSON key.
106
+ def self.attribute_map
107
+ {
108
+ :'assigned_to_group' => :'assigned_to_group',
109
+ :'assigned_to_group_id' => :'assigned_to_group_id',
110
+ :'assigned_to_user' => :'assigned_to_user',
111
+ :'assigned_to_user_id' => :'assigned_to_user_id',
112
+ :'attachments' => :'attachments',
113
+ :'created_by' => :'created_by',
114
+ :'created_dts' => :'created_dts',
115
+ :'delay_until_dts' => :'delay_until_dts',
116
+ :'due_dts' => :'due_dts',
117
+ :'histories' => :'histories',
118
+ :'last_update_dts' => :'last_update_dts',
119
+ :'merchant_id' => :'merchant_id',
120
+ :'notes' => :'notes',
121
+ :'object_email' => :'object_email',
122
+ :'object_id' => :'object_id',
123
+ :'object_type' => :'object_type',
124
+ :'object_url' => :'object_url',
125
+ :'priority' => :'priority',
126
+ :'status' => :'status',
127
+ :'task_details' => :'task_details',
128
+ :'task_name' => :'task_name',
129
+ :'workflow_task_uuid' => :'workflow_task_uuid'
130
+ }
131
+ end
132
+
133
+ # Returns all the JSON keys this model knows about
134
+ def self.acceptable_attributes
135
+ attribute_map.values
136
+ end
137
+
138
+ # Attribute type mapping.
139
+ def self.openapi_types
140
+ {
141
+ :'assigned_to_group' => :'String',
142
+ :'assigned_to_group_id' => :'Integer',
143
+ :'assigned_to_user' => :'String',
144
+ :'assigned_to_user_id' => :'Integer',
145
+ :'attachments' => :'Array<WorkflowAttachment>',
146
+ :'created_by' => :'WorkflowUser',
147
+ :'created_dts' => :'String',
148
+ :'delay_until_dts' => :'String',
149
+ :'due_dts' => :'String',
150
+ :'histories' => :'Array<WorkflowTaskHistory>',
151
+ :'last_update_dts' => :'String',
152
+ :'merchant_id' => :'String',
153
+ :'notes' => :'Array<WorkflowNote>',
154
+ :'object_email' => :'String',
155
+ :'object_id' => :'String',
156
+ :'object_type' => :'String',
157
+ :'object_url' => :'String',
158
+ :'priority' => :'String',
159
+ :'status' => :'String',
160
+ :'task_details' => :'String',
161
+ :'task_name' => :'String',
162
+ :'workflow_task_uuid' => :'String'
163
+ }
164
+ end
165
+
166
+ # List of attributes with nullable: true
167
+ def self.openapi_nullable
168
+ Set.new([
169
+ ])
170
+ end
171
+
172
+ # Initializes the object
173
+ # @param [Hash] attributes Model attributes in the form of hash
174
+ def initialize(attributes = {})
175
+ if (!attributes.is_a?(Hash))
176
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::WorkflowTask` initialize method"
177
+ end
178
+
179
+ # check to see if the attribute exists and convert string to symbol for hash key
180
+ attributes = attributes.each_with_object({}) { |(k, v), h|
181
+ if (!self.class.attribute_map.key?(k.to_sym))
182
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::WorkflowTask`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
183
+ end
184
+ h[k.to_sym] = v
185
+ }
186
+
187
+ if attributes.key?(:'assigned_to_group')
188
+ self.assigned_to_group = attributes[:'assigned_to_group']
189
+ end
190
+
191
+ if attributes.key?(:'assigned_to_group_id')
192
+ self.assigned_to_group_id = attributes[:'assigned_to_group_id']
193
+ end
194
+
195
+ if attributes.key?(:'assigned_to_user')
196
+ self.assigned_to_user = attributes[:'assigned_to_user']
197
+ end
198
+
199
+ if attributes.key?(:'assigned_to_user_id')
200
+ self.assigned_to_user_id = attributes[:'assigned_to_user_id']
201
+ end
202
+
203
+ if attributes.key?(:'attachments')
204
+ if (value = attributes[:'attachments']).is_a?(Array)
205
+ self.attachments = value
206
+ end
207
+ end
208
+
209
+ if attributes.key?(:'created_by')
210
+ self.created_by = attributes[:'created_by']
211
+ end
212
+
213
+ if attributes.key?(:'created_dts')
214
+ self.created_dts = attributes[:'created_dts']
215
+ end
216
+
217
+ if attributes.key?(:'delay_until_dts')
218
+ self.delay_until_dts = attributes[:'delay_until_dts']
219
+ end
220
+
221
+ if attributes.key?(:'due_dts')
222
+ self.due_dts = attributes[:'due_dts']
223
+ end
224
+
225
+ if attributes.key?(:'histories')
226
+ if (value = attributes[:'histories']).is_a?(Array)
227
+ self.histories = value
228
+ end
229
+ end
230
+
231
+ if attributes.key?(:'last_update_dts')
232
+ self.last_update_dts = attributes[:'last_update_dts']
233
+ end
234
+
235
+ if attributes.key?(:'merchant_id')
236
+ self.merchant_id = attributes[:'merchant_id']
237
+ end
238
+
239
+ if attributes.key?(:'notes')
240
+ if (value = attributes[:'notes']).is_a?(Array)
241
+ self.notes = value
242
+ end
243
+ end
244
+
245
+ if attributes.key?(:'object_email')
246
+ self.object_email = attributes[:'object_email']
247
+ end
248
+
249
+ if attributes.key?(:'object_id')
250
+ self.object_id = attributes[:'object_id']
251
+ end
252
+
253
+ if attributes.key?(:'object_type')
254
+ self.object_type = attributes[:'object_type']
255
+ end
256
+
257
+ if attributes.key?(:'object_url')
258
+ self.object_url = attributes[:'object_url']
259
+ end
260
+
261
+ if attributes.key?(:'priority')
262
+ self.priority = attributes[:'priority']
263
+ end
264
+
265
+ if attributes.key?(:'status')
266
+ self.status = attributes[:'status']
267
+ end
268
+
269
+ if attributes.key?(:'task_details')
270
+ self.task_details = attributes[:'task_details']
271
+ end
272
+
273
+ if attributes.key?(:'task_name')
274
+ self.task_name = attributes[:'task_name']
275
+ end
276
+
277
+ if attributes.key?(:'workflow_task_uuid')
278
+ self.workflow_task_uuid = attributes[:'workflow_task_uuid']
279
+ end
280
+ end
281
+
282
+ # Show invalid properties with the reasons. Usually used together with valid?
283
+ # @return Array for valid properties with the reasons
284
+ def list_invalid_properties
285
+ invalid_properties = Array.new
286
+ invalid_properties
287
+ end
288
+
289
+ # Check to see if the all the properties in the model are valid
290
+ # @return true if the model is valid
291
+ def valid?
292
+ object_type_validator = EnumAttributeValidator.new('String', ["order", "auto order", "item", "customer profile"])
293
+ return false unless object_type_validator.valid?(@object_type)
294
+ priority_validator = EnumAttributeValidator.new('String', ["1 - low", "2 - medium", "3 - high", "4 - critical"])
295
+ return false unless priority_validator.valid?(@priority)
296
+ status_validator = EnumAttributeValidator.new('String', ["open", "closed", "delayed", "awaiting customer feedback"])
297
+ return false unless status_validator.valid?(@status)
298
+ true
299
+ end
300
+
301
+ # Custom attribute writer method checking allowed values (enum).
302
+ # @param [Object] object_type Object to be assigned
303
+ def object_type=(object_type)
304
+ validator = EnumAttributeValidator.new('String', ["order", "auto order", "item", "customer profile"])
305
+ unless validator.valid?(object_type)
306
+ fail ArgumentError, "invalid value for \"object_type\", must be one of #{validator.allowable_values}."
307
+ end
308
+ @object_type = object_type
309
+ end
310
+
311
+ # Custom attribute writer method checking allowed values (enum).
312
+ # @param [Object] priority Object to be assigned
313
+ def priority=(priority)
314
+ validator = EnumAttributeValidator.new('String', ["1 - low", "2 - medium", "3 - high", "4 - critical"])
315
+ unless validator.valid?(priority)
316
+ fail ArgumentError, "invalid value for \"priority\", must be one of #{validator.allowable_values}."
317
+ end
318
+ @priority = priority
319
+ end
320
+
321
+ # Custom attribute writer method checking allowed values (enum).
322
+ # @param [Object] status Object to be assigned
323
+ def status=(status)
324
+ validator = EnumAttributeValidator.new('String', ["open", "closed", "delayed", "awaiting customer feedback"])
325
+ unless validator.valid?(status)
326
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
327
+ end
328
+ @status = status
329
+ end
330
+
331
+ # Checks equality by comparing each attribute.
332
+ # @param [Object] Object to be compared
333
+ def ==(o)
334
+ return true if self.equal?(o)
335
+ self.class == o.class &&
336
+ assigned_to_group == o.assigned_to_group &&
337
+ assigned_to_group_id == o.assigned_to_group_id &&
338
+ assigned_to_user == o.assigned_to_user &&
339
+ assigned_to_user_id == o.assigned_to_user_id &&
340
+ attachments == o.attachments &&
341
+ created_by == o.created_by &&
342
+ created_dts == o.created_dts &&
343
+ delay_until_dts == o.delay_until_dts &&
344
+ due_dts == o.due_dts &&
345
+ histories == o.histories &&
346
+ last_update_dts == o.last_update_dts &&
347
+ merchant_id == o.merchant_id &&
348
+ notes == o.notes &&
349
+ object_email == o.object_email &&
350
+ object_id == o.object_id &&
351
+ object_type == o.object_type &&
352
+ object_url == o.object_url &&
353
+ priority == o.priority &&
354
+ status == o.status &&
355
+ task_details == o.task_details &&
356
+ task_name == o.task_name &&
357
+ workflow_task_uuid == o.workflow_task_uuid
358
+ end
359
+
360
+ # @see the `==` method
361
+ # @param [Object] Object to be compared
362
+ def eql?(o)
363
+ self == o
364
+ end
365
+
366
+ # Calculates hash code according to all attributes.
367
+ # @return [Integer] Hash code
368
+ def hash
369
+ [assigned_to_group, assigned_to_group_id, assigned_to_user, assigned_to_user_id, attachments, created_by, created_dts, delay_until_dts, due_dts, histories, last_update_dts, merchant_id, notes, object_email, object_id, object_type, object_url, priority, status, task_details, task_name, workflow_task_uuid].hash
370
+ end
371
+
372
+ # Builds the object from hash
373
+ # @param [Hash] attributes Model attributes in the form of hash
374
+ # @return [Object] Returns the model itself
375
+ def self.build_from_hash(attributes)
376
+ new.build_from_hash(attributes)
377
+ end
378
+
379
+ # Builds the object from hash
380
+ # @param [Hash] attributes Model attributes in the form of hash
381
+ # @return [Object] Returns the model itself
382
+ def build_from_hash(attributes)
383
+ return nil unless attributes.is_a?(Hash)
384
+ attributes = attributes.transform_keys(&:to_sym)
385
+ self.class.openapi_types.each_pair do |key, type|
386
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
387
+ self.send("#{key}=", nil)
388
+ elsif type =~ /\AArray<(.*)>/i
389
+ # check to ensure the input is an array given that the attribute
390
+ # is documented as an array but the input is not
391
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
392
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
393
+ end
394
+ elsif !attributes[self.class.attribute_map[key]].nil?
395
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
396
+ end
397
+ end
398
+
399
+ self
400
+ end
401
+
402
+ # Deserializes the data based on type
403
+ # @param string type Data type
404
+ # @param string value Value to be deserialized
405
+ # @return [Object] Deserialized data
406
+ def _deserialize(type, value)
407
+ case type.to_sym
408
+ when :Time
409
+ Time.parse(value)
410
+ when :Date
411
+ Date.parse(value)
412
+ when :String
413
+ value.to_s
414
+ when :Integer
415
+ value.to_i
416
+ when :Float
417
+ value.to_f
418
+ when :Boolean
419
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
420
+ true
421
+ else
422
+ false
423
+ end
424
+ when :Object
425
+ # generic object (usually a Hash), return directly
426
+ value
427
+ when /\AArray<(?<inner_type>.+)>\z/
428
+ inner_type = Regexp.last_match[:inner_type]
429
+ value.map { |v| _deserialize(inner_type, v) }
430
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
431
+ k_type = Regexp.last_match[:k_type]
432
+ v_type = Regexp.last_match[:v_type]
433
+ {}.tap do |hash|
434
+ value.each do |k, v|
435
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
436
+ end
437
+ end
438
+ else # model
439
+ # models (e.g. Pet) or oneOf
440
+ klass = UltracartClient.const_get(type)
441
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
442
+ end
443
+ end
444
+
445
+ # Returns the string representation of the object
446
+ # @return [String] String presentation of the object
447
+ def to_s
448
+ to_hash.to_s
449
+ end
450
+
451
+ # to_body is an alias to to_hash (backward compatibility)
452
+ # @return [Hash] Returns the object in the form of hash
453
+ def to_body
454
+ to_hash
455
+ end
456
+
457
+ # Returns the object in the form of hash
458
+ # @return [Hash] Returns the object in the form of hash
459
+ def to_hash
460
+ hash = {}
461
+ self.class.attribute_map.each_pair do |attr, param|
462
+ value = self.send(attr)
463
+ if value.nil?
464
+ is_nullable = self.class.openapi_nullable.include?(attr)
465
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
466
+ end
467
+
468
+ hash[param] = _to_hash(value)
469
+ end
470
+ hash
471
+ end
472
+
473
+ # Outputs non-array value in the form of hash
474
+ # For object, use to_hash. Otherwise, just return the value
475
+ # @param [Object] value Any valid value
476
+ # @return [Hash] Returns the value in the form of hash
477
+ def _to_hash(value)
478
+ if value.is_a?(Array)
479
+ value.compact.map { |v| _to_hash(v) }
480
+ elsif value.is_a?(Hash)
481
+ {}.tap do |hash|
482
+ value.each { |k, v| hash[k] = _to_hash(v) }
483
+ end
484
+ elsif value.respond_to? :to_hash
485
+ value.to_hash
486
+ else
487
+ value
488
+ end
489
+ end
490
+
491
+ end
492
+
493
+ end