Class: Twilio::REST::Taskrouter::V1::WorkspaceContext::WorkflowContext::WorkflowRealTimeStatisticsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, workspace_sid, workflow_sid) ⇒ WorkflowRealTimeStatisticsContext

Initialize the WorkflowRealTimeStatisticsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • workspace_sid (String)

    The SID of the Workspace with the Workflow to fetch.

  • workflow_sid (String)

    Returns the list of Tasks that are being controlled by the Workflow with the specified SID value.


81
82
83
84
85
86
87
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb', line 81

def initialize(version, workspace_sid, workflow_sid)
  super(version)

  # Path Solution
  @solution = {workspace_sid: workspace_sid, workflow_sid: workflow_sid, }
  @uri = "/Workspaces/#{@solution[:workspace_sid]}/Workflows/#{@solution[:workflow_sid]}/RealTimeStatistics"
end

Instance Method Details

#fetch(task_channel: :unset) ⇒ WorkflowRealTimeStatisticsInstance

Fetch the WorkflowRealTimeStatisticsInstance

Parameters:

  • task_channel (String) (defaults to: :unset)

    Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`.

Returns:


95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb', line 95

def fetch(task_channel: :unset)
  params = Twilio::Values.of({'TaskChannel' => task_channel, })

  payload = @version.fetch('GET', @uri, params: params)

  WorkflowRealTimeStatisticsInstance.new(
      @version,
      payload,
      workspace_sid: @solution[:workspace_sid],
      workflow_sid: @solution[:workflow_sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


117
118
119
120
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb', line 117

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>"
end

#to_sObject

Provide a user friendly representation


110
111
112
113
# File 'lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb', line 110

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext #{context}>"
end