Class: ConnectWise::WorkflowAction

Inherits:
Object
  • Object
show all
Defined in:
lib/connectwise-ruby-sdk/models/workflow_action.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ WorkflowAction

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
215
216
217
218
219
220
221
222
223
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
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 180

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}

  if attributes.has_key?(:'id')
    self.id = attributes[:'id']
  end

  if attributes.has_key?(:'notifyType')
    self.notify_type = attributes[:'notifyType']
  end

  if attributes.has_key?(:'notifyWho')
    self.notify_who = attributes[:'notifyWho']
  end

  if attributes.has_key?(:'specificMemberTo')
    self.specific_member_to = attributes[:'specificMemberTo']
  end

  if attributes.has_key?(:'emailRecipient')
    self.email_recipient = attributes[:'emailRecipient']
  end

  if attributes.has_key?(:'notifyFrom')
    self.notify_from = attributes[:'notifyFrom']
  end

  if attributes.has_key?(:'specificMemberFrom')
    self.specific_member_from = attributes[:'specificMemberFrom']
  end

  if attributes.has_key?(:'emailFrom')
    self.email_from = attributes[:'emailFrom']
  end

  if attributes.has_key?(:'ccContact')
    self.cc_contact = attributes[:'ccContact']
  end

  if attributes.has_key?(:'bccContact')
    self.bcc_contact = attributes[:'bccContact']
  end

  if attributes.has_key?(:'subject')
    self.subject = attributes[:'subject']
  end

  if attributes.has_key?(:'notes')
    self.notes = attributes[:'notes']
  end

  if attributes.has_key?(:'activityStatus')
    self.activity_status = attributes[:'activityStatus']
  end

  if attributes.has_key?(:'activityType')
    self.activity_type = attributes[:'activityType']
  end

  if attributes.has_key?(:'attachedTrack')
    self.attached_track = attributes[:'attachedTrack']
  end

  if attributes.has_key?(:'daysToExecute')
    self.days_to_execute = attributes[:'daysToExecute']
  end

  if attributes.has_key?(:'board')
    self.board = attributes[:'board']
  end

  if attributes.has_key?(:'boardStatus')
    self.board_status = attributes[:'boardStatus']
  end

  if attributes.has_key?(:'serviceType')
    self.service_type = attributes[:'serviceType']
  end

  if attributes.has_key?(:'group')
    self.group = attributes[:'group']
  end

  if attributes.has_key?(:'serviceTemplate')
    self.service_template = attributes[:'serviceTemplate']
  end

  if attributes.has_key?(:'invoiceMinDays')
    self.invoice_min_days = attributes[:'invoiceMinDays']
  end

  if attributes.has_key?(:'automateScript')
    self.automate_script = attributes[:'automateScript']
  end

  if attributes.has_key?(:'scriptSuccessStatus')
    self.script_success_status = attributes[:'scriptSuccessStatus']
  end

  if attributes.has_key?(:'scriptFailStatus')
    self.script_fail_status = attributes[:'scriptFailStatus']
  end

  if attributes.has_key?(:'detailNotesFlag')
    self.detail_notes_flag = attributes[:'detailNotesFlag']
  end

  if attributes.has_key?(:'internalNotesFlag')
    self.internal_notes_flag = attributes[:'internalNotesFlag']
  end

  if attributes.has_key?(:'auditNotesFlag')
    self.audit_notes_flag = attributes[:'auditNotesFlag']
  end

  if attributes.has_key?(:'servicePriority')
    self.service_priority = attributes[:'servicePriority']
  end

  if attributes.has_key?(:'updateOwnerFlag')
    self.update_owner_flag = attributes[:'updateOwnerFlag']
  end

  if attributes.has_key?(:'salesOrderStatus')
    self.sales_order_status = attributes[:'salesOrderStatus']
  end

  if attributes.has_key?(:'projectStatus')
    self.project_status = attributes[:'projectStatus']
  end

  if attributes.has_key?(:'companyStatus')
    self.company_status = attributes[:'companyStatus']
  end

  if attributes.has_key?(:'_info')
    self._info = attributes[:'_info']
  end

end

Instance Attribute Details

#_infoObject

Metadata of the entity



95
96
97
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 95

def _info
  @_info
end

#activity_statusObject

Required when notifyType is set to: "Create Activity"



39
40
41
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 39

def activity_status
  @activity_status
end

#activity_typeObject

Required when notifyType is set to: "Create Activity"



42
43
44
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 42

def activity_type
  @activity_type
end

#attached_trackObject

Required when notifyType is set to: "Attach Track"



45
46
47
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 45

def attached_track
  @attached_track
end

#audit_notes_flagObject

Returns the value of attribute audit_notes_flag.



78
79
80
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 78

def audit_notes_flag
  @audit_notes_flag
end

#automate_scriptObject

Required when notifyType is set to: "Run Connectwise Automate Script"



66
67
68
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 66

def automate_script
  @automate_script
end

#bcc_contactObject

Returns the value of attribute bcc_contact.



31
32
33
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 31

def bcc_contact
  @bcc_contact
end

#boardObject

Required when notifyType is set to: "Change Board"



50
51
52
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 50

def board
  @board
end

#board_statusObject

Required when notifyType is set to: "Change Board", "Change Ticket Status"



53
54
55
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 53

def board_status
  @board_status
end

#cc_contactObject

Returns the value of attribute cc_contact.



29
30
31
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 29

def cc_contact
  @cc_contact
end

#company_statusObject

Required when notifyType is set to: "Change Company Status"



92
93
94
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 92

def company_status
  @company_status
end

#days_to_executeObject

Returns the value of attribute days_to_execute.



47
48
49
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 47

def days_to_execute
  @days_to_execute
end

#detail_notes_flagObject

Returns the value of attribute detail_notes_flag.



74
75
76
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 74

def detail_notes_flag
  @detail_notes_flag
end

#email_fromObject

Required when notifyFrom is set to: "Email Address"



27
28
29
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 27

def email_from
  @email_from
end

#email_recipientObject

Required when notifyWho is set to: "Email Address"



18
19
20
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 18

def email_recipient
  @email_recipient
end

#groupObject

Required when notifyType is set to: "Add to Group"



58
59
60
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 58

def group
  @group
end

#idObject

Returns the value of attribute id.



7
8
9
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 7

def id
  @id
end

#internal_notes_flagObject

Returns the value of attribute internal_notes_flag.



76
77
78
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 76

def internal_notes_flag
  @internal_notes_flag
end

#invoice_min_daysObject

Returns the value of attribute invoice_min_days.



63
64
65
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 63

def invoice_min_days
  @invoice_min_days
end

#notesObject

Returns the value of attribute notes.



36
37
38
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 36

def notes
  @notes
end

#notify_fromObject

Required when notifyType is set to: "Create Activity", "Send Email", "Assign Resource"



21
22
23
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 21

def notify_from
  @notify_from
end

#notify_typeObject

Returns the value of attribute notify_type.



9
10
11
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 9

def notify_type
  @notify_type
end

#notify_whoObject

Required when notifyType is set to: "Create Activity", "Send Email", "Add Follower", "Assign Resource", "Close Survey"



12
13
14
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 12

def notify_who
  @notify_who
end

#project_statusObject

Required when notifyType is set to: "Change Project Status"



89
90
91
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 89

def project_status
  @project_status
end

#sales_order_statusObject

Required when notifyType is set to: "Change Sales Order Status"



86
87
88
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 86

def sales_order_status
  @sales_order_status
end

#script_fail_statusObject

Required when notifyType is set to: "Run Connectwise Automate Script"



72
73
74
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 72

def script_fail_status
  @script_fail_status
end

#script_success_statusObject

Required when notifyType is set to: "Run Connectwise Automate Script"



69
70
71
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 69

def script_success_status
  @script_success_status
end

#service_priorityObject

Required when notifyType is set to: "Change Ticket Priority"



81
82
83
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 81

def service_priority
  @service_priority
end

#service_templateObject

Required when notifyType is set to: "Create a Service Ticket"



61
62
63
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 61

def service_template
  @service_template
end

#service_typeObject

Returns the value of attribute service_type.



55
56
57
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 55

def service_type
  @service_type
end

#specific_member_fromObject

Required when notifyFrom is set to: "Specific Member"



24
25
26
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 24

def specific_member_from
  @specific_member_from
end

#specific_member_toObject

Required when notifyWho is set to: "Specific Member", "



15
16
17
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 15

def specific_member_to
  @specific_member_to
end

#subjectObject

Required when notifyType is set to: "Create Activity", "Send Email", "Assign Resource"



34
35
36
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 34

def subject
  @subject
end

#update_owner_flagObject

Returns the value of attribute update_owner_flag.



83
84
85
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 83

def update_owner_flag
  @update_owner_flag
end

Class Method Details

.attribute_mapObject

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



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 99

def self.attribute_map
  {
    :'id' => :'id',
    :'notify_type' => :'notifyType',
    :'notify_who' => :'notifyWho',
    :'specific_member_to' => :'specificMemberTo',
    :'email_recipient' => :'emailRecipient',
    :'notify_from' => :'notifyFrom',
    :'specific_member_from' => :'specificMemberFrom',
    :'email_from' => :'emailFrom',
    :'cc_contact' => :'ccContact',
    :'bcc_contact' => :'bccContact',
    :'subject' => :'subject',
    :'notes' => :'notes',
    :'activity_status' => :'activityStatus',
    :'activity_type' => :'activityType',
    :'attached_track' => :'attachedTrack',
    :'days_to_execute' => :'daysToExecute',
    :'board' => :'board',
    :'board_status' => :'boardStatus',
    :'service_type' => :'serviceType',
    :'group' => :'group',
    :'service_template' => :'serviceTemplate',
    :'invoice_min_days' => :'invoiceMinDays',
    :'automate_script' => :'automateScript',
    :'script_success_status' => :'scriptSuccessStatus',
    :'script_fail_status' => :'scriptFailStatus',
    :'detail_notes_flag' => :'detailNotesFlag',
    :'internal_notes_flag' => :'internalNotesFlag',
    :'audit_notes_flag' => :'auditNotesFlag',
    :'service_priority' => :'servicePriority',
    :'update_owner_flag' => :'updateOwnerFlag',
    :'sales_order_status' => :'salesOrderStatus',
    :'project_status' => :'projectStatus',
    :'company_status' => :'companyStatus',
    :'_info' => :'_info'
  }
end

.swagger_typesObject

Attribute type mapping.



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
172
173
174
175
176
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 139

def self.swagger_types
  {
    :'id' => :'Integer',
    :'notify_type' => :'NotifyTypeReference',
    :'notify_who' => :'NotificationRecipientReference',
    :'specific_member_to' => :'MemberReference',
    :'email_recipient' => :'String',
    :'notify_from' => :'NotificationRecipientReference',
    :'specific_member_from' => :'MemberReference',
    :'email_from' => :'String',
    :'cc_contact' => :'ContactReference',
    :'bcc_contact' => :'ContactReference',
    :'subject' => :'String',
    :'notes' => :'String',
    :'activity_status' => :'ActivityStatusReference',
    :'activity_type' => :'ActivityTypeReference',
    :'attached_track' => :'TrackReference',
    :'days_to_execute' => :'Integer',
    :'board' => :'BoardReference',
    :'board_status' => :'ServiceStatusReference',
    :'service_type' => :'ServiceTypeReference',
    :'group' => :'GroupReference',
    :'service_template' => :'ServiceTemplateReference',
    :'invoice_min_days' => :'Integer',
    :'automate_script' => :'AutomateScriptReference',
    :'script_success_status' => :'ServiceStatusReference',
    :'script_fail_status' => :'ServiceStatusReference',
    :'detail_notes_flag' => :'BOOLEAN',
    :'internal_notes_flag' => :'BOOLEAN',
    :'audit_notes_flag' => :'BOOLEAN',
    :'service_priority' => :'PriorityReference',
    :'update_owner_flag' => :'BOOLEAN',
    :'sales_order_status' => :'OrderStatusReference',
    :'project_status' => :'ProjectStatusReference',
    :'company_status' => :'CompanyStatusReference',
    :'_info' => :'Metadata'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 392

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      notify_type == o.notify_type &&
      notify_who == o.notify_who &&
      specific_member_to == o.specific_member_to &&
      email_recipient == o.email_recipient &&
      notify_from == o.notify_from &&
      specific_member_from == o.specific_member_from &&
      email_from == o.email_from &&
      cc_contact == o.cc_contact &&
      bcc_contact == o.bcc_contact &&
      subject == o.subject &&
      notes == o.notes &&
      activity_status == o.activity_status &&
      activity_type == o.activity_type &&
      attached_track == o.attached_track &&
      days_to_execute == o.days_to_execute &&
      board == o.board &&
      board_status == o.board_status &&
      service_type == o.service_type &&
      group == o.group &&
      service_template == o.service_template &&
      invoice_min_days == o.invoice_min_days &&
      automate_script == o.automate_script &&
      script_success_status == o.script_success_status &&
      script_fail_status == o.script_fail_status &&
      detail_notes_flag == o.detail_notes_flag &&
      internal_notes_flag == o.internal_notes_flag &&
      audit_notes_flag == o.audit_notes_flag &&
      service_priority == o.service_priority &&
      update_owner_flag == o.update_owner_flag &&
      sales_order_status == o.sales_order_status &&
      project_status == o.project_status &&
      company_status == o.company_status &&
      _info == o._info
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



467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 467

def _deserialize(type, value)
  case type.to_sym
  when :DateTime
    DateTime.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
    temp_model = ConnectWise.const_get(type).new
    temp_model.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



533
534
535
536
537
538
539
540
541
542
543
544
545
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 533

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



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 446

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the 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 # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


433
434
435
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 433

def eql?(o)
  self == o
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



439
440
441
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 439

def hash
  [id, notify_type, notify_who, specific_member_to, email_recipient, notify_from, specific_member_from, email_from, cc_contact, bcc_contact, subject, notes, activity_status, activity_type, attached_track, days_to_execute, board, board_status, service_type, group, service_template, invoice_min_days, automate_script, script_success_status, script_fail_status, detail_notes_flag, internal_notes_flag, audit_notes_flag, service_priority, update_owner_flag, sales_order_status, project_status, company_status, _info].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properies with the reasons



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 326

def list_invalid_properties
  invalid_properties = Array.new
  if @notify_type.nil?
    invalid_properties.push("invalid value for 'notify_type', notify_type cannot be nil.")
  end

  if !@email_recipient.nil? && @email_recipient.to_s.length > 250
    invalid_properties.push("invalid value for 'email_recipient', the character length must be smaller than or equal to 250.")
  end

  if !@email_from.nil? && @email_from.to_s.length > 250
    invalid_properties.push("invalid value for 'email_from', the character length must be smaller than or equal to 250.")
  end

  if !@subject.nil? && @subject.to_s.length > 100
    invalid_properties.push("invalid value for 'subject', the character length must be smaller than or equal to 100.")
  end

  return 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



513
514
515
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 513

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



519
520
521
522
523
524
525
526
527
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 519

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    next if value.nil?
    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



507
508
509
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 507

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



349
350
351
352
353
354
355
# File 'lib/connectwise-ruby-sdk/models/workflow_action.rb', line 349

def valid?
  return false if @notify_type.nil?
  return false if !@email_recipient.nil? && @email_recipient.to_s.length > 250
  return false if !@email_from.nil? && @email_from.to_s.length > 250
  return false if !@subject.nil? && @subject.to_s.length > 100
  return true
end