Method: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskQueueInstance#initialize

Defined in:
lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb

#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ TaskQueueInstance

Initialize the TaskQueueInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this TaskQueue resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



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
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb', line 393

def initialize(version, payload , workspace_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'assignment_activity_sid' => payload['assignment_activity_sid'],
        'assignment_activity_name' => payload['assignment_activity_name'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'friendly_name' => payload['friendly_name'],
        'max_reserved_workers' => payload['max_reserved_workers'] == nil ? payload['max_reserved_workers'] : payload['max_reserved_workers'].to_i,
        'reservation_activity_sid' => payload['reservation_activity_sid'],
        'reservation_activity_name' => payload['reservation_activity_name'],
        'sid' => payload['sid'],
        'target_workers' => payload['target_workers'],
        'task_order' => payload['task_order'],
        'url' => payload['url'],
        'workspace_sid' => payload['workspace_sid'],
        'links' => payload['links'],
    }

    # Context
    @instance_context = nil
    @params = { 'workspace_sid' => workspace_sid  || @properties['workspace_sid']  ,'sid' => sid  || @properties['sid']  , }
end