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 account_sid.
-
#assignment_callback_url ⇒ String
The assignment_callback_url.
-
#configuration ⇒ String
The configuration.
-
#context ⇒ WorkflowContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#delete ⇒ Boolean
Deletes the WorkflowInstance.
-
#document_content_type ⇒ String
The document_content_type.
-
#fallback_assignment_callback_url ⇒ String
The fallback_assignment_callback_url.
-
#fetch ⇒ WorkflowInstance
Fetch a WorkflowInstance.
-
#friendly_name ⇒ String
The friendly_name.
-
#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.
-
#sid ⇒ String
The sid.
-
#statistics ⇒ statistics
Access the statistics.
-
#task_reservation_timeout ⇒ String
The task_reservation_timeout.
-
#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.
-
#workflow_cumulative_statistics ⇒ workflow_cumulative_statistics
Access the workflow_cumulative_statistics.
-
#workflow_real_time_statistics ⇒ workflow_real_time_statistics
Access the workflow_real_time_statistics.
-
#workspace_sid ⇒ String
The workspace_sid.
Constructor Details
#initialize(version, payload, workspace_sid: nil, sid: nil) ⇒ WorkflowInstance
Initialize the WorkflowInstance
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 329 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 account_sid.
374 375 376 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 374 def account_sid @properties['account_sid'] end |
#assignment_callback_url ⇒ String
Returns The assignment_callback_url.
380 381 382 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 380 def assignment_callback_url @properties['assignment_callback_url'] end |
#configuration ⇒ String
Returns The configuration.
386 387 388 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 386 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
361 362 363 364 365 366 367 368 369 370 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 361 def context unless @instance_context @instance_context = WorkflowContext.new( @version, @params['workspace_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
392 393 394 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 392 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
398 399 400 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 398 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the WorkflowInstance
479 480 481 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 479 def delete context.delete end |
#document_content_type ⇒ String
Returns The document_content_type.
404 405 406 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 404 def document_content_type @properties['document_content_type'] end |
#fallback_assignment_callback_url ⇒ String
Returns The fallback_assignment_callback_url.
410 411 412 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 410 def fallback_assignment_callback_url @properties['fallback_assignment_callback_url'] end |
#fetch ⇒ WorkflowInstance
Fetch a WorkflowInstance
453 454 455 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 453 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The friendly_name.
416 417 418 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 416 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
513 514 515 516 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 513 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Taskrouter.V1.WorkflowInstance #{values}>" end |
#links ⇒ String
Returns The links.
446 447 448 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 446 def links @properties['links'] end |
#sid ⇒ String
Returns The sid.
422 423 424 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 422 def sid @properties['sid'] end |
#statistics ⇒ statistics
Access the statistics
486 487 488 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 486 def statistics context.statistics end |
#task_reservation_timeout ⇒ String
Returns The task_reservation_timeout.
428 429 430 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 428 def task_reservation_timeout @properties['task_reservation_timeout'] end |
#to_s ⇒ Object
Provide a user friendly representation
506 507 508 509 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 506 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
466 467 468 469 470 471 472 473 474 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 466 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.
440 441 442 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 440 def url @properties['url'] end |
#workflow_cumulative_statistics ⇒ workflow_cumulative_statistics
Access the workflow_cumulative_statistics
500 501 502 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 500 def workflow_cumulative_statistics context.workflow_cumulative_statistics end |
#workflow_real_time_statistics ⇒ workflow_real_time_statistics
Access the workflow_real_time_statistics
493 494 495 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 493 def workflow_real_time_statistics context.workflow_real_time_statistics end |
#workspace_sid ⇒ String
Returns The workspace_sid.
434 435 436 |
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb', line 434 def workspace_sid @properties['workspace_sid'] end |