Class: UltracartClient::WorkflowTask

Inherits:
Object
  • Object
show all
Defined in:
lib/ultracart_api/models/workflow_task.rb

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ WorkflowTask

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
# File 'lib/ultracart_api/models/workflow_task.rb', line 224

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::WorkflowTask` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      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
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'assigned_to_group')
    self.assigned_to_group = attributes[:'assigned_to_group']
  end

  if attributes.key?(:'assigned_to_group_id')
    self.assigned_to_group_id = attributes[:'assigned_to_group_id']
  end

  if attributes.key?(:'assigned_to_user')
    self.assigned_to_user = attributes[:'assigned_to_user']
  end

  if attributes.key?(:'assigned_to_user_id')
    self.assigned_to_user_id = attributes[:'assigned_to_user_id']
  end

  if attributes.key?(:'assigned_to_user_or_group')
    self.assigned_to_user_or_group = attributes[:'assigned_to_user_or_group']
  end

  if attributes.key?(:'attachments')
    if (value = attributes[:'attachments']).is_a?(Array)
      self.attachments = value
    end
  end

  if attributes.key?(:'created_by')
    self.created_by = attributes[:'created_by']
  end

  if attributes.key?(:'created_dts')
    self.created_dts = attributes[:'created_dts']
  end

  if attributes.key?(:'delay_until_dts')
    self.delay_until_dts = attributes[:'delay_until_dts']
  end

  if attributes.key?(:'dependant_workflow_task_uuid')
    self.dependant_workflow_task_uuid = attributes[:'dependant_workflow_task_uuid']
  end

  if attributes.key?(:'due_dts')
    self.due_dts = attributes[:'due_dts']
  end

  if attributes.key?(:'expiration_dts')
    self.expiration_dts = attributes[:'expiration_dts']
  end

  if attributes.key?(:'global_task_number')
    self.global_task_number = attributes[:'global_task_number']
  end

  if attributes.key?(:'histories')
    if (value = attributes[:'histories']).is_a?(Array)
      self.histories = value
    end
  end

  if attributes.key?(:'last_update_dts')
    self.last_update_dts = attributes[:'last_update_dts']
  end

  if attributes.key?(:'merchant_id')
    self.merchant_id = attributes[:'merchant_id']
  end

  if attributes.key?(:'notes')
    if (value = attributes[:'notes']).is_a?(Array)
      self.notes = value
    end
  end

  if attributes.key?(:'object_email')
    self.object_email = attributes[:'object_email']
  end

  if attributes.key?(:'object_id')
    self.object_id = attributes[:'object_id']
  end

  if attributes.key?(:'object_task_number')
    self.object_task_number = attributes[:'object_task_number']
  end

  if attributes.key?(:'object_type')
    self.object_type = attributes[:'object_type']
  end

  if attributes.key?(:'object_url')
    self.object_url = attributes[:'object_url']
  end

  if attributes.key?(:'priority')
    self.priority = attributes[:'priority']
  end

  if attributes.key?(:'properties')
    if (value = attributes[:'properties']).is_a?(Array)
      self.properties = value
    end
  end

  if attributes.key?(:'related_workflow_task_uuid')
    self.related_workflow_task_uuid = attributes[:'related_workflow_task_uuid']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.key?(:'system_task_type')
    self.system_task_type = attributes[:'system_task_type']
  end

  if attributes.key?(:'tags')
    if (value = attributes[:'tags']).is_a?(Array)
      self.tags = value
    end
  end

  if attributes.key?(:'task_context')
    self.task_context = attributes[:'task_context']
  end

  if attributes.key?(:'task_details')
    self.task_details = attributes[:'task_details']
  end

  if attributes.key?(:'task_name')
    self.task_name = attributes[:'task_name']
  end

  if attributes.key?(:'workflow_task_uuid')
    self.workflow_task_uuid = attributes[:'workflow_task_uuid']
  end
end

Instance Attribute Details

#assigned_to_groupObject

Assigned to group



19
20
21
# File 'lib/ultracart_api/models/workflow_task.rb', line 19

def assigned_to_group
  @assigned_to_group
end

#assigned_to_group_idObject

Assigned to group ID



22
23
24
# File 'lib/ultracart_api/models/workflow_task.rb', line 22

def assigned_to_group_id
  @assigned_to_group_id
end

#assigned_to_userObject

Assigned to user



25
26
27
# File 'lib/ultracart_api/models/workflow_task.rb', line 25

def assigned_to_user
  @assigned_to_user
end

#assigned_to_user_idObject

Assigned to user ID



28
29
30
# File 'lib/ultracart_api/models/workflow_task.rb', line 28

def assigned_to_user_id
  @assigned_to_user_id
end

#assigned_to_user_or_groupObject

Assigned to user or group (used for sorting)



31
32
33
# File 'lib/ultracart_api/models/workflow_task.rb', line 31

def assigned_to_user_or_group
  @assigned_to_user_or_group
end

#attachmentsObject

Attachments to the Workflow Task



34
35
36
# File 'lib/ultracart_api/models/workflow_task.rb', line 34

def attachments
  @attachments
end

#created_byObject

Returns the value of attribute created_by.



36
37
38
# File 'lib/ultracart_api/models/workflow_task.rb', line 36

def created_by
  @created_by
end

#created_dtsObject

Date/time that the workflow task was created



39
40
41
# File 'lib/ultracart_api/models/workflow_task.rb', line 39

def created_dts
  @created_dts
end

#delay_until_dtsObject

Date/time that the workflow task should delay until



42
43
44
# File 'lib/ultracart_api/models/workflow_task.rb', line 42

def delay_until_dts
  @delay_until_dts
end

#dependant_workflow_task_uuidObject

Dependant Workflow Task UUID (must be completed before this task can be completed)



45
46
47
# File 'lib/ultracart_api/models/workflow_task.rb', line 45

def dependant_workflow_task_uuid
  @dependant_workflow_task_uuid
end

#due_dtsObject

Date/time that the workflow task is due



48
49
50
# File 'lib/ultracart_api/models/workflow_task.rb', line 48

def due_dts
  @due_dts
end

#expiration_dtsObject

Date/time that the workflow task will expire and be closed. This is set by system generated tasks.



51
52
53
# File 'lib/ultracart_api/models/workflow_task.rb', line 51

def expiration_dts
  @expiration_dts
end

#global_task_numberObject

Global task number



54
55
56
# File 'lib/ultracart_api/models/workflow_task.rb', line 54

def global_task_number
  @global_task_number
end

#historiesObject

Array of history records for the task



57
58
59
# File 'lib/ultracart_api/models/workflow_task.rb', line 57

def histories
  @histories
end

#last_update_dtsObject

Date/time that the workflow task was last updated



60
61
62
# File 'lib/ultracart_api/models/workflow_task.rb', line 60

def last_update_dts
  @last_update_dts
end

#merchant_idObject

Merchant ID



63
64
65
# File 'lib/ultracart_api/models/workflow_task.rb', line 63

def merchant_id
  @merchant_id
end

#notesObject

Notes on the Workflow Task



66
67
68
# File 'lib/ultracart_api/models/workflow_task.rb', line 66

def notes
  @notes
end

#object_emailObject

Object is associated with customer email



69
70
71
# File 'lib/ultracart_api/models/workflow_task.rb', line 69

def object_email
  @object_email
end

#object_idObject

Object ID



72
73
74
# File 'lib/ultracart_api/models/workflow_task.rb', line 72

def object_id
  @object_id
end

#object_task_numberObject

Object specific task number



75
76
77
# File 'lib/ultracart_api/models/workflow_task.rb', line 75

def object_task_number
  @object_task_number
end

#object_typeObject

Object Type



78
79
80
# File 'lib/ultracart_api/models/workflow_task.rb', line 78

def object_type
  @object_type
end

#object_urlObject

Object URL



81
82
83
# File 'lib/ultracart_api/models/workflow_task.rb', line 81

def object_url
  @object_url
end

#priorityObject

Priority



84
85
86
# File 'lib/ultracart_api/models/workflow_task.rb', line 84

def priority
  @priority
end

#propertiesObject

Properties



87
88
89
# File 'lib/ultracart_api/models/workflow_task.rb', line 87

def properties
  @properties
end

Related Workflow Task UUID



90
91
92
# File 'lib/ultracart_api/models/workflow_task.rb', line 90

def related_workflow_task_uuid
  @related_workflow_task_uuid
end

#statusObject

Status of the workflow task



93
94
95
# File 'lib/ultracart_api/models/workflow_task.rb', line 93

def status
  @status
end

#system_task_typeObject

Constant for the type of system generated task



96
97
98
# File 'lib/ultracart_api/models/workflow_task.rb', line 96

def system_task_type
  @system_task_type
end

#tagsObject

Tags



99
100
101
# File 'lib/ultracart_api/models/workflow_task.rb', line 99

def tags
  @tags
end

#task_contextObject

User friendly string of the task context



102
103
104
# File 'lib/ultracart_api/models/workflow_task.rb', line 102

def task_context
  @task_context
end

#task_detailsObject

Task Details



105
106
107
# File 'lib/ultracart_api/models/workflow_task.rb', line 105

def task_details
  @task_details
end

#task_nameObject

Task Name



108
109
110
# File 'lib/ultracart_api/models/workflow_task.rb', line 108

def task_name
  @task_name
end

#workflow_task_uuidObject

Workflow Task UUID



111
112
113
# File 'lib/ultracart_api/models/workflow_task.rb', line 111

def workflow_task_uuid
  @workflow_task_uuid
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



174
175
176
# File 'lib/ultracart_api/models/workflow_task.rb', line 174

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/ultracart_api/models/workflow_task.rb', line 136

def self.attribute_map
  {
    :'assigned_to_group' => :'assigned_to_group',
    :'assigned_to_group_id' => :'assigned_to_group_id',
    :'assigned_to_user' => :'assigned_to_user',
    :'assigned_to_user_id' => :'assigned_to_user_id',
    :'assigned_to_user_or_group' => :'assigned_to_user_or_group',
    :'attachments' => :'attachments',
    :'created_by' => :'created_by',
    :'created_dts' => :'created_dts',
    :'delay_until_dts' => :'delay_until_dts',
    :'dependant_workflow_task_uuid' => :'dependant_workflow_task_uuid',
    :'due_dts' => :'due_dts',
    :'expiration_dts' => :'expiration_dts',
    :'global_task_number' => :'global_task_number',
    :'histories' => :'histories',
    :'last_update_dts' => :'last_update_dts',
    :'merchant_id' => :'merchant_id',
    :'notes' => :'notes',
    :'object_email' => :'object_email',
    :'object_id' => :'object_id',
    :'object_task_number' => :'object_task_number',
    :'object_type' => :'object_type',
    :'object_url' => :'object_url',
    :'priority' => :'priority',
    :'properties' => :'properties',
    :'related_workflow_task_uuid' => :'related_workflow_task_uuid',
    :'status' => :'status',
    :'system_task_type' => :'system_task_type',
    :'tags' => :'tags',
    :'task_context' => :'task_context',
    :'task_details' => :'task_details',
    :'task_name' => :'task_name',
    :'workflow_task_uuid' => :'workflow_task_uuid'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



491
492
493
# File 'lib/ultracart_api/models/workflow_task.rb', line 491

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



217
218
219
220
# File 'lib/ultracart_api/models/workflow_task.rb', line 217

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/ultracart_api/models/workflow_task.rb', line 179

def self.openapi_types
  {
    :'assigned_to_group' => :'String',
    :'assigned_to_group_id' => :'Integer',
    :'assigned_to_user' => :'String',
    :'assigned_to_user_id' => :'Integer',
    :'assigned_to_user_or_group' => :'String',
    :'attachments' => :'Array<WorkflowAttachment>',
    :'created_by' => :'WorkflowUser',
    :'created_dts' => :'String',
    :'delay_until_dts' => :'String',
    :'dependant_workflow_task_uuid' => :'String',
    :'due_dts' => :'String',
    :'expiration_dts' => :'String',
    :'global_task_number' => :'Integer',
    :'histories' => :'Array<WorkflowTaskHistory>',
    :'last_update_dts' => :'String',
    :'merchant_id' => :'String',
    :'notes' => :'Array<WorkflowNote>',
    :'object_email' => :'String',
    :'object_id' => :'String',
    :'object_task_number' => :'Integer',
    :'object_type' => :'String',
    :'object_url' => :'String',
    :'priority' => :'String',
    :'properties' => :'Array<Property>',
    :'related_workflow_task_uuid' => :'String',
    :'status' => :'String',
    :'system_task_type' => :'String',
    :'tags' => :'Array<String>',
    :'task_context' => :'String',
    :'task_details' => :'String',
    :'task_name' => :'String',
    :'workflow_task_uuid' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/ultracart_api/models/workflow_task.rb', line 439

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      assigned_to_group == o.assigned_to_group &&
      assigned_to_group_id == o.assigned_to_group_id &&
      assigned_to_user == o.assigned_to_user &&
      assigned_to_user_id == o.assigned_to_user_id &&
      assigned_to_user_or_group == o.assigned_to_user_or_group &&
      attachments == o.attachments &&
      created_by == o.created_by &&
      created_dts == o.created_dts &&
      delay_until_dts == o.delay_until_dts &&
      dependant_workflow_task_uuid == o.dependant_workflow_task_uuid &&
      due_dts == o.due_dts &&
      expiration_dts == o.expiration_dts &&
      global_task_number == o.global_task_number &&
      histories == o.histories &&
      last_update_dts == o.last_update_dts &&
      merchant_id == o.merchant_id &&
      notes == o.notes &&
      object_email == o.object_email &&
      object_id == o.object_id &&
      object_task_number == o.object_task_number &&
      object_type == o.object_type &&
      object_url == o.object_url &&
      priority == o.priority &&
      properties == o.properties &&
      related_workflow_task_uuid == o.related_workflow_task_uuid &&
      status == o.status &&
      system_task_type == o.system_task_type &&
      tags == o.tags &&
      task_context == o.task_context &&
      task_details == o.task_details &&
      task_name == o.task_name &&
      workflow_task_uuid == o.workflow_task_uuid
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/ultracart_api/models/workflow_task.rb', line 522

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = UltracartClient.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



593
594
595
596
597
598
599
600
601
602
603
604
605
# File 'lib/ultracart_api/models/workflow_task.rb', line 593

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
# File 'lib/ultracart_api/models/workflow_task.rb', line 498

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{key}=", nil)
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


478
479
480
# File 'lib/ultracart_api/models/workflow_task.rb', line 478

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



484
485
486
# File 'lib/ultracart_api/models/workflow_task.rb', line 484

def hash
  [assigned_to_group, assigned_to_group_id, assigned_to_user, assigned_to_user_id, assigned_to_user_or_group, attachments, created_by, created_dts, delay_until_dts, dependant_workflow_task_uuid, due_dts, expiration_dts, global_task_number, histories, last_update_dts, merchant_id, notes, object_email, object_id, object_task_number, object_type, object_url, priority, properties, related_workflow_task_uuid, status, system_task_type, tags, task_context, task_details, task_name, workflow_task_uuid].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



378
379
380
381
# File 'lib/ultracart_api/models/workflow_task.rb', line 378

def list_invalid_properties
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



569
570
571
# File 'lib/ultracart_api/models/workflow_task.rb', line 569

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/ultracart_api/models/workflow_task.rb', line 575

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



563
564
565
# File 'lib/ultracart_api/models/workflow_task.rb', line 563

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



385
386
387
388
389
390
391
392
393
394
395
# File 'lib/ultracart_api/models/workflow_task.rb', line 385

def valid?
  object_type_validator = EnumAttributeValidator.new('String', ["order", "auto order", "item", "customer profile", "storefront"])
  return false unless object_type_validator.valid?(@object_type)
  priority_validator = EnumAttributeValidator.new('String', ["1 - low", "2 - medium", "3 - high", "4 - critical"])
  return false unless priority_validator.valid?(@priority)
  status_validator = EnumAttributeValidator.new('String', ["open", "closed", "delayed", "awaiting customer feedback", "closed - system", "closed - customer", "closed - expiration"])
  return false unless status_validator.valid?(@status)
  system_task_type_validator = EnumAttributeValidator.new('String', ["order_accounts_receivable", "order_fraud_review", "auto_order_card_update_issue", "auto_order_canceled_payment", "item_low_stock", "item_out_of_stock"])
  return false unless system_task_type_validator.valid?(@system_task_type)
  true
end