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 SID of the Account that created the resource.
-
#addons ⇒ String
An object that contains the addon data for all installed addons.
-
#age ⇒ String
The number of seconds since the Task was created.
-
#assignment_status ⇒ task.Status
The current status of the Task’s assignment.
-
#attributes ⇒ String
The JSON string with custom attributes of the work.
-
#context ⇒ TaskContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Delete the TaskInstance.
-
#fetch ⇒ TaskInstance
Fetch the 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 URLs of related resources.
-
#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 string that identifies the resource.
-
#task_channel_sid ⇒ String
The SID of the TaskChannel.
-
#task_channel_unique_name ⇒ String
The unique name of the TaskChannel.
-
#task_queue_entered_date ⇒ Time
The ISO 8601 date and time in GMT when the Task entered the TaskQueue.
-
#task_queue_friendly_name ⇒ String
The friendly name of the TaskQueue.
-
#task_queue_sid ⇒ String
The SID of the TaskQueue.
-
#timeout ⇒ String
The amount of time in seconds that the Task can live before being assigned.
-
#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 absolute URL of the Task resource.
-
#workflow_friendly_name ⇒ String
The friendly name of the Workflow that is controlling the Task.
-
#workflow_sid ⇒ String
The SID of the Workflow that is controlling the Task.
-
#workspace_sid ⇒ String
The SID of the Workspace that contains the Task.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ TaskInstance
Initialize the TaskInstance
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 407 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']), 'task_queue_entered_date' => Twilio.deserialize_iso8601_datetime(payload['task_queue_entered_date']), '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 SID of the Account that created the resource.
453 454 455 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 453 def account_sid @properties['account_sid'] end |
#addons ⇒ String
Returns An object that contains the addon data for all installed addons.
477 478 479 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 477 def addons @properties['addons'] end |
#age ⇒ String
Returns The number of seconds since the Task was created.
459 460 461 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 459 def age @properties['age'] end |
#assignment_status ⇒ task.Status
Returns The current status of the Task’s assignment.
465 466 467 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 465 def assignment_status @properties['assignment_status'] end |
#attributes ⇒ String
Returns The JSON string with custom attributes of the work.
471 472 473 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 471 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
444 445 446 447 448 449 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 444 def context unless @instance_context @instance_context = TaskContext.new(@version, @params['workspace_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
483 484 485 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 483 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
489 490 491 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 489 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the TaskInstance
615 616 617 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 615 def delete context.delete end |
#fetch ⇒ TaskInstance
Fetch the TaskInstance
580 581 582 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 580 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
635 636 637 638 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 635 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.TaskInstance #{values}>" end |
#links ⇒ String
Returns The URLs of related resources.
573 574 575 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 573 def links @properties['links'] end |
#priority ⇒ String
Returns Retrieve the list of all Tasks in the Workspace with the specified priority.
501 502 503 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 501 def priority @properties['priority'] end |
#reason ⇒ String
Returns The reason the Task was canceled or completed.
507 508 509 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 507 def reason @properties['reason'] end |
#reservations ⇒ reservations
Access the reservations
622 623 624 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 622 def reservations context.reservations end |
#sid ⇒ String
Returns The unique string that identifies the resource.
513 514 515 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 513 def sid @properties['sid'] end |
#task_channel_sid ⇒ String
Returns The SID of the TaskChannel.
531 532 533 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 531 def task_channel_sid @properties['task_channel_sid'] end |
#task_channel_unique_name ⇒ String
Returns The unique name of the TaskChannel.
537 538 539 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 537 def task_channel_unique_name @properties['task_channel_unique_name'] end |
#task_queue_entered_date ⇒ Time
Returns The ISO 8601 date and time in GMT when the Task entered the TaskQueue.
495 496 497 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 495 def task_queue_entered_date @properties['task_queue_entered_date'] end |
#task_queue_friendly_name ⇒ String
Returns The friendly name of the TaskQueue.
525 526 527 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 525 def task_queue_friendly_name @properties['task_queue_friendly_name'] end |
#task_queue_sid ⇒ String
Returns The SID of the TaskQueue.
519 520 521 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 519 def task_queue_sid @properties['task_queue_sid'] end |
#timeout ⇒ String
Returns The amount of time in seconds that the Task can live before being assigned.
543 544 545 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 543 def timeout @properties['timeout'] end |
#to_s ⇒ Object
Provide a user friendly representation
628 629 630 631 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 628 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
602 603 604 605 606 607 608 609 610 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 602 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 absolute URL of the Task resource.
567 568 569 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 567 def url @properties['url'] end |
#workflow_friendly_name ⇒ String
Returns The friendly name of the Workflow that is controlling the Task.
555 556 557 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 555 def workflow_friendly_name @properties['workflow_friendly_name'] end |
#workflow_sid ⇒ String
Returns The SID of the Workflow that is controlling the Task.
549 550 551 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 549 def workflow_sid @properties['workflow_sid'] end |
#workspace_sid ⇒ String
Returns The SID of the Workspace that contains the Task.
561 562 563 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb', line 561 def workspace_sid @properties['workspace_sid'] end |