Class: Twilio::REST::Autopilot::V1::AssistantContext::TaskContext::TaskStatisticsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected]

Instance Method Summary collapse

Constructor Details

#initialize(version, assistant_sid, task_sid) ⇒ TaskStatisticsContext

Initialize the TaskStatisticsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)

    The SID of the Assistant that is the parent of the resource to fetch.

  • task_sid (String)

    The SID of the Task that is associated with the resource to fetch.


91
92
93
94
95
96
97
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 91

def initialize(version, assistant_sid, task_sid)
  super(version)

  # Path Solution
  @solution = {assistant_sid: assistant_sid, task_sid: task_sid, }
  @uri = "/Assistants/#{@solution[:assistant_sid]}/Tasks/#{@solution[:task_sid]}/Statistics"
end

Instance Method Details

#fetchTaskStatisticsInstance

Fetch the TaskStatisticsInstance

Returns:


102
103
104
105
106
107
108
109
110
111
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 102

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

  TaskStatisticsInstance.new(
      @version,
      payload,
      assistant_sid: @solution[:assistant_sid],
      task_sid: @solution[:task_sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


122
123
124
125
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 122

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

#to_sObject

Provide a user friendly representation


115
116
117
118
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 115

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