Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::TaskInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The ID of the account that owns this Task.
-
#addons ⇒ String
The addon data for all installed addons is returned with this attribute.
-
#age ⇒ String
The number of seconds since this task was created.
-
#assignment_status ⇒ task.Status
Returns the list of all Tasks in the workspace with the specified AssignmentStatus.
-
#attributes ⇒ String
The user-defined JSON string describing the custom attributes of this work.
-
#context ⇒ TaskContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
Date this task was created, given as ISO 8601 format.
-
#date_updated ⇒ Time
Date this task was updated, given as ISO 8601 format.
-
#delete ⇒ Boolean
Deletes the TaskInstance.
-
#fetch ⇒ TaskInstance
Fetch a TaskInstance.
-
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ TaskInstance
constructor
Initialize the TaskInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#priority ⇒ String
Retrieve the list of all Tasks in the workspace with the specified priority.
-
#reason ⇒ String
The reason the task was canceled or completed.
-
#reservations ⇒ reservations
Access the reservations.
-
#sid ⇒ String
The unique ID of the Task.
-
#task_channel_sid ⇒ String
The ID of the Task Channel.
-
#task_channel_unique_name ⇒ String
The unique name of the Task Channel.
-
#task_queue_friendly_name ⇒ String
The task_queue_friendly_name.
-
#task_queue_sid ⇒ String
Returns the list of Tasks that are currently waiting in the TaskQueue identified by the Sid specified.
-
#timeout ⇒ String
The amount of time in seconds the task is allowed to live.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(attributes: :unset, assignment_status: :unset, reason: :unset, priority: :unset, task_channel: :unset) ⇒ TaskInstance
Update the TaskInstance.
-
#url ⇒ String
The url.
-
#workflow_friendly_name ⇒ String
The workflow_friendly_name.
-
#workflow_sid ⇒ String
Returns the list of Tasks that are being controlled by the Workflow with the specified Sid value.
-
#workspace_sid ⇒ String
The ID of the Workspace that holds this Task.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ TaskInstance
Initialize the TaskInstance
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/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 399 def initialize(version, payload, workspace_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'age' => payload['age'].to_i, 'assignment_status' => payload['assignment_status'], 'attributes' => payload['attributes'], 'addons' => payload['addons'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'priority' => payload['priority'].to_i, 'reason' => payload['reason'], 'sid' => payload['sid'], 'task_queue_sid' => payload['task_queue_sid'], 'task_queue_friendly_name' => payload['task_queue_friendly_name'], 'task_channel_sid' => payload['task_channel_sid'], 'task_channel_unique_name' => payload['task_channel_unique_name'], 'timeout' => payload['timeout'].to_i, 'workflow_sid' => payload['workflow_sid'], 'workflow_friendly_name' => payload['workflow_friendly_name'], 'workspace_sid' => payload['workspace_sid'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'workspace_sid' => workspace_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The ID of the account that owns this Task.
444 445 446 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 444 def account_sid @properties['account_sid'] end |
#addons ⇒ String
Returns The addon data for all installed addons is returned with this attribute.
468 469 470 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 468 def addons @properties['addons'] end |
#age ⇒ String
Returns The number of seconds since this task was created.
450 451 452 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 450 def age @properties['age'] end |
#assignment_status ⇒ task.Status
Returns the list of all Tasks in the workspace with the specified AssignmentStatus.
456 457 458 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 456 def assignment_status @properties['assignment_status'] end |
#attributes ⇒ String
Returns The user-defined JSON string describing the custom attributes of this work.
462 463 464 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 462 def attributes @properties['attributes'] end |
#context ⇒ TaskContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
435 436 437 438 439 440 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 435 def context unless @instance_context @instance_context = TaskContext.new(@version, @params['workspace_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns Date this task was created, given as ISO 8601 format.
474 475 476 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 474 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns Date this task was updated, given as ISO 8601 format.
480 481 482 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 480 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the TaskInstance
598 599 600 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 598 def delete context.delete end |
#fetch ⇒ TaskInstance
Fetch a TaskInstance
565 566 567 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 565 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
618 619 620 621 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 618 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.TaskInstance #{values}>" end |
#links ⇒ String
Returns The links.
558 559 560 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 558 def links @properties['links'] end |
#priority ⇒ String
Returns Retrieve the list of all Tasks in the workspace with the specified priority.
486 487 488 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 486 def priority @properties['priority'] end |
#reason ⇒ String
Returns The reason the task was canceled or completed.
492 493 494 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 492 def reason @properties['reason'] end |
#reservations ⇒ reservations
Access the reservations
605 606 607 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 605 def reservations context.reservations end |
#sid ⇒ String
Returns The unique ID of the Task.
498 499 500 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 498 def sid @properties['sid'] end |
#task_channel_sid ⇒ String
Returns The ID of the Task Channel.
516 517 518 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 516 def task_channel_sid @properties['task_channel_sid'] end |
#task_channel_unique_name ⇒ String
Returns The unique name of the Task Channel.
522 523 524 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 522 def task_channel_unique_name @properties['task_channel_unique_name'] end |
#task_queue_friendly_name ⇒ String
Returns The task_queue_friendly_name.
510 511 512 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 510 def task_queue_friendly_name @properties['task_queue_friendly_name'] end |
#task_queue_sid ⇒ String
Returns the list of Tasks that are currently waiting in the TaskQueue identified by the Sid specified.
504 505 506 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 504 def task_queue_sid @properties['task_queue_sid'] end |
#timeout ⇒ String
Returns The amount of time in seconds the task is allowed to live.
528 529 530 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 528 def timeout @properties['timeout'] end |
#to_s ⇒ Object
Provide a user friendly representation
611 612 613 614 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 611 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.TaskInstance #{values}>" end |
#update(attributes: :unset, assignment_status: :unset, reason: :unset, priority: :unset, task_channel: :unset) ⇒ TaskInstance
Update the TaskInstance
585 586 587 588 589 590 591 592 593 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 585 def update(attributes: :unset, assignment_status: :unset, reason: :unset, priority: :unset, task_channel: :unset) context.update( attributes: attributes, assignment_status: assignment_status, reason: reason, priority: priority, task_channel: task_channel, ) end |
#url ⇒ String
Returns The url.
552 553 554 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 552 def url @properties['url'] end |
#workflow_friendly_name ⇒ String
Returns The workflow_friendly_name.
540 541 542 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 540 def workflow_friendly_name @properties['workflow_friendly_name'] end |
#workflow_sid ⇒ String
Returns the list of Tasks that are being controlled by the Workflow with the specified Sid value.
534 535 536 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 534 def workflow_sid @properties['workflow_sid'] end |
#workspace_sid ⇒ String
Returns The ID of the Workspace that holds this Task.
546 547 548 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 546 def workspace_sid @properties['workspace_sid'] end |