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 ID of the account that owns this Workflow.
-
#assignment_callback_url ⇒ String
The URL that will be called whenever a task managed by this Workflow is assigned to a Worker.
-
#configuration ⇒ String
JSON document configuring the rules for this Workflow.
-
#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 this workflow was created.
-
#date_updated ⇒ Time
The date this workflow was last updated.
-
#delete ⇒ Boolean
Deletes the WorkflowInstance.
-
#document_content_type ⇒ String
The document_content_type.
-
#fallback_assignment_callback_url ⇒ String
If the request to the AssignmentCallbackUrl fails, the assignment callback will be made to this URL.
-
#fetch ⇒ WorkflowInstance
Fetch a WorkflowInstance.
-
#friendly_name ⇒ String
Human readable description of this Workflow.
-
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ WorkflowInstance
constructor
Initialize the WorkflowInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics.
-
#sid ⇒ String
The unique ID of the Workflow.
-
#statistics ⇒ statistics
Access the statistics.
-
#task_reservation_timeout ⇒ String
Determines how long TaskRouter will wait for a confirmation response from your application after assigning 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) ⇒ WorkflowInstance
Update the WorkflowInstance.
-
#url ⇒ String
The url.
-
#workspace_sid ⇒ String
The ID of the Workspace that contains this Workflow.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ WorkflowInstance
Initialize the WorkflowInstance
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 321 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'].to_i, '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 Workflow.
359 360 361 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 359 def account_sid @properties['account_sid'] end |
#assignment_callback_url ⇒ String
Returns The URL that will be called whenever a task managed by this Workflow is assigned to a Worker.
365 366 367 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 365 def assignment_callback_url @properties['assignment_callback_url'] end |
#configuration ⇒ String
Returns JSON document configuring the rules for this Workflow.
371 372 373 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 371 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
350 351 352 353 354 355 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 350 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
494 495 496 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 494 def cumulative_statistics context.cumulative_statistics end |
#date_created ⇒ Time
Returns The date this workflow was created.
377 378 379 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 377 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this workflow was last updated.
383 384 385 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 383 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the WorkflowInstance
473 474 475 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 473 def delete context.delete end |
#document_content_type ⇒ String
Returns The document_content_type.
389 390 391 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 389 def document_content_type @properties['document_content_type'] end |
#fallback_assignment_callback_url ⇒ String
Returns If the request to the AssignmentCallbackUrl fails, the assignment callback will be made to this URL.
395 396 397 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 395 def fallback_assignment_callback_url @properties['fallback_assignment_callback_url'] end |
#fetch ⇒ WorkflowInstance
Fetch a WorkflowInstance
438 439 440 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 438 def fetch context.fetch end |
#friendly_name ⇒ String
Returns Human readable description of this Workflow.
401 402 403 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 401 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
507 508 509 510 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 507 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkflowInstance #{values}>" end |
#links ⇒ String
Returns The links.
431 432 433 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 431 def links @properties['links'] end |
#real_time_statistics ⇒ real_time_statistics
Access the real_time_statistics
487 488 489 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 487 def real_time_statistics context.real_time_statistics end |
#sid ⇒ String
Returns The unique ID of the Workflow.
407 408 409 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 407 def sid @properties['sid'] end |
#statistics ⇒ statistics
Access the statistics
480 481 482 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 480 def statistics context.statistics end |
#task_reservation_timeout ⇒ String
Returns Determines how long TaskRouter will wait for a confirmation response from your application after assigning a Task to a worker.
413 414 415 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 413 def task_reservation_timeout @properties['task_reservation_timeout'] end |
#to_s ⇒ Object
Provide a user friendly representation
500 501 502 503 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 500 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) ⇒ WorkflowInstance
Update the WorkflowInstance
460 461 462 463 464 465 466 467 468 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 460 def update(friendly_name: :unset, assignment_callback_url: :unset, fallback_assignment_callback_url: :unset, configuration: :unset, task_reservation_timeout: :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, ) end |
#url ⇒ String
Returns The url.
425 426 427 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 425 def url @properties['url'] end |
#workspace_sid ⇒ String
Returns The ID of the Workspace that contains this Workflow.
419 420 421 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 419 def workspace_sid @properties['workspace_sid'] end |