class Twilio::REST::Preview::Understand::AssistantContext::TaskContext::TaskStatisticsInstance

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 help@twilio.com.

Public Class Methods

new(version, payload, assistant_sid: nil, task_sid: nil) click to toggle source

Initialize the TaskStatisticsInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] assistant_sid The unique ID of the parent Assistant. @param [String] task_sid The unique ID of the Task associated with this Field. @return [TaskStatisticsInstance] TaskStatisticsInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
130 def initialize(version, payload, assistant_sid: nil, task_sid: nil)
131   super(version)
132 
133   # Marshaled Properties
134   @properties = {
135       'account_sid' => payload['account_sid'],
136       'assistant_sid' => payload['assistant_sid'],
137       'task_sid' => payload['task_sid'],
138       'samples_count' => payload['samples_count'].to_i,
139       'fields_count' => payload['fields_count'].to_i,
140       'url' => payload['url'],
141   }
142 
143   # Context
144   @instance_context = nil
145   @params = {'assistant_sid' => assistant_sid, 'task_sid' => task_sid, }
146 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The unique ID of the Account that created this Field.

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
165 def account_sid
166   @properties['account_sid']
167 end
assistant_sid() click to toggle source

@return [String] The unique ID of the parent Assistant.

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
171 def assistant_sid
172   @properties['assistant_sid']
173 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [TaskStatisticsContext] TaskStatisticsContext for this TaskStatisticsInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
152 def context
153   unless @instance_context
154     @instance_context = TaskStatisticsContext.new(
155         @version,
156         @params['assistant_sid'],
157         @params['task_sid'],
158     )
159   end
160   @instance_context
161 end
fetch() click to toggle source

Fetch the TaskStatisticsInstance @return [TaskStatisticsInstance] Fetched TaskStatisticsInstance

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
202 def fetch
203   context.fetch
204 end
fields_count() click to toggle source

@return [String] The total number of Fields associated with this Task.

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
189 def fields_count
190   @properties['fields_count']
191 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
215 def inspect
216   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
217   "<Twilio.Preview.Understand.TaskStatisticsInstance #{values}>"
218 end
samples_count() click to toggle source

@return [String] The total number of Samples associated with this Task.

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
183 def samples_count
184   @properties['samples_count']
185 end
task_sid() click to toggle source

@return [String] The unique ID of the Task associated with this Field.

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
177 def task_sid
178   @properties['task_sid']
179 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
208 def to_s
209   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
210   "<Twilio.Preview.Understand.TaskStatisticsInstance #{values}>"
211 end
url() click to toggle source

@return [String] The url

    # File lib/twilio-ruby/rest/preview/understand/assistant/task/task_statistics.rb
195 def url
196   @properties['url']
197 end