Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowInstance
- Defined in:
- lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Workflow resource.
-
#assignment_callback_url ⇒ String
The URL that we call when a task managed by the Workflow is assigned to a Worker.
-
#configuration ⇒ String
A JSON string that contains the Workflow’s configuration.
-
#context ⇒ WorkflowContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#cumulative_statistics ⇒ cumulative_statistics
Access the cumulative_statistics.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the WorkflowInstance.
-
#document_content_type ⇒ String
The MIME type of the document.
-
#fallback_assignment_callback_url ⇒ String
The URL that we call when a call to the ‘assignment_callback_url` fails.
-
#fetch ⇒ WorkflowInstance
Fetch the WorkflowInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the Workflow resource.
-
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ WorkflowInstance
constructor
Initialize the WorkflowInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ Hash
The URLs of related resources.
-
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics.
-
#sid ⇒ String
The unique string that we created to identify the Workflow resource.
-
#statistics ⇒ statistics
Access the statistics.
-
#task_reservation_timeout ⇒ String
How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, configuration: :unset, task_reservation_timeout: :unset, re_evaluate_tasks: :unset) ⇒ WorkflowInstance
Update the WorkflowInstance.
-
#url ⇒ String
The absolute URL of the Workflow resource.
-
#workspace_sid ⇒ String
The SID of the Workspace that contains the Workflow.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ WorkflowInstance
Initialize the WorkflowInstance
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 356 def initialize(version, payload , workspace_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'assignment_callback_url' => payload['assignment_callback_url'], 'configuration' => payload['configuration'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'document_content_type' => payload['document_content_type'], 'fallback_assignment_callback_url' => payload['fallback_assignment_callback_url'], 'friendly_name' => payload['friendly_name'], 'sid' => payload['sid'], 'task_reservation_timeout' => payload['task_reservation_timeout'] == nil ? payload['task_reservation_timeout'] : payload['task_reservation_timeout'].to_i, 'workspace_sid' => payload['workspace_sid'], 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = { 'workspace_sid' => workspace_sid || @properties['workspace_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Workflow resource.
394 395 396 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 394 def account_sid @properties['account_sid'] end |
#assignment_callback_url ⇒ String
Returns The URL that we call when a task managed by the Workflow is assigned to a Worker. See Assignment Callback URL for more information.
400 401 402 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 400 def assignment_callback_url @properties['assignment_callback_url'] end |
#configuration ⇒ String
Returns A JSON string that contains the Workflow’s configuration. See [Configuring Workflows](www.twilio.com/docs/taskrouter/workflow-configuration) for more information.
406 407 408 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 406 def configuration @properties['configuration'] end |
#context ⇒ WorkflowContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
385 386 387 388 389 390 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 385 def context unless @instance_context @instance_context = WorkflowContext.new(@version , @params['workspace_sid'], @params['sid']) end @instance_context end |
#cumulative_statistics ⇒ cumulative_statistics
Access the cumulative_statistics
524 525 526 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 524 def cumulative_statistics context.cumulative_statistics end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
412 413 414 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 412 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
418 419 420 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 418 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the WorkflowInstance
473 474 475 476 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 473 def delete context.delete end |
#document_content_type ⇒ String
Returns The MIME type of the document.
424 425 426 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 424 def document_content_type @properties['document_content_type'] end |
#fallback_assignment_callback_url ⇒ String
Returns The URL that we call when a call to the ‘assignment_callback_url` fails.
430 431 432 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 430 def fallback_assignment_callback_url @properties['fallback_assignment_callback_url'] end |
#fetch ⇒ WorkflowInstance
Fetch the WorkflowInstance
481 482 483 484 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 481 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the Workflow resource. For example, ‘Customer Support` or `2014 Election Campaign`.
436 437 438 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 436 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
544 545 546 547 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 544 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkflowInstance #{values}>" end |
#links ⇒ Hash
Returns The URLs of related resources.
466 467 468 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 466 def links @properties['links'] end |
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics
531 532 533 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 531 def real_time_statistics context.real_time_statistics end |
#sid ⇒ String
Returns The unique string that we created to identify the Workflow resource.
442 443 444 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 442 def sid @properties['sid'] end |
#statistics ⇒ statistics
Access the statistics
517 518 519 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 517 def statistics context.statistics end |
#task_reservation_timeout ⇒ String
Returns How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to ‘86,400` (24 hours) and the default is `120`.
448 449 450 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 448 def task_reservation_timeout @properties['task_reservation_timeout'] end |
#to_s ⇒ Object
Provide a user friendly representation
537 538 539 540 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 537 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkflowInstance #{values}>" end |
#update(friendly_name: :unset, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, configuration: :unset, task_reservation_timeout: :unset, re_evaluate_tasks: :unset) ⇒ WorkflowInstance
Update the WorkflowInstance
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 495 def update( friendly_name: :unset, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, configuration: :unset, task_reservation_timeout: :unset, re_evaluate_tasks: :unset ) context.update( friendly_name: friendly_name, assignment_callback_url: assignment_callback_url, fallback_assignment_callback_url: fallback_assignment_callback_url, configuration: configuration, task_reservation_timeout: task_reservation_timeout, re_evaluate_tasks: re_evaluate_tasks, ) end |
#url ⇒ String
Returns The absolute URL of the Workflow resource.
460 461 462 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 460 def url @properties['url'] end |
#workspace_sid ⇒ String
Returns The SID of the Workspace that contains the Workflow.
454 455 456 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 454 def workspace_sid @properties['workspace_sid'] end |