Class: Twilio::REST::Preview::Understand::AssistantContext::IntentContext::IntentStatisticsContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_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, intent_sid) ⇒ IntentStatisticsContext

Initialize the IntentStatisticsContext

Parameters:

  • version (Version)

    Version that contains the resource

  • assistant_sid (String)

    The assistant_sid

  • intent_sid (String)

    The intent_sid



84
85
86
87
88
89
90
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_statistics.rb', line 84

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

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

Instance Method Details

#fetchIntentStatisticsInstance

Fetch a IntentStatisticsInstance

Returns:



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/twilio-ruby/rest/preview/understand/assistant/intent/intent_statistics.rb', line 95

def fetch
  params = Twilio::Values.of({})

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

  IntentStatisticsInstance.new(
      @version,
      payload,
      assistant_sid: @solution[:assistant_sid],
      intent_sid: @solution[:intent_sid],
  )
end

#to_sObject

Provide a user friendly representation



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

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