Class: Twilio::REST::Preview::Understand::AssistantContext::TaskContext::TaskStatisticsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/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 unique ID of the parent Assistant.

  • task_sid (String)

    The unique ID of the Task associated with this Field.


83
84
85
86
87
88
89
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb', line 83

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:


94
95
96
97
98
99
100
101
102
103
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb', line 94

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


114
115
116
117
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb', line 114

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

#to_sObject

Provide a user friendly representation


107
108
109
110
# File 'lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb', line 107

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