class Twilio::REST::Autopilot::V1::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
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 SID of the
{Assistant}[https://www.twilio.com/docs/autopilot/api/assistant] that is the parent of the Task associated with the resource.
@param [String] task_sid
The SID of the
{Task}[https://www.twilio.com/docs/autopilot/api/task] for which the statistics were collected.
@return [TaskStatisticsInstance] TaskStatisticsInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 142 def initialize(version, payload, assistant_sid: nil, task_sid: nil) 143 super(version) 144 145 # Marshaled Properties 146 @properties = { 147 'account_sid' => payload['account_sid'], 148 'assistant_sid' => payload['assistant_sid'], 149 'task_sid' => payload['task_sid'], 150 'samples_count' => payload['samples_count'].to_i, 151 'fields_count' => payload['fields_count'].to_i, 152 'url' => payload['url'], 153 } 154 155 # Context 156 @instance_context = nil 157 @params = {'assistant_sid' => assistant_sid, 'task_sid' => task_sid, } 158 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 177 def account_sid 178 @properties['account_sid'] 179 end
@return [String] The SID of the Assistant that is the parent of the Task associated with the resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 183 def assistant_sid 184 @properties['assistant_sid'] 185 end
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/autopilot/v1/assistant/task/task_statistics.rb 164 def context 165 unless @instance_context 166 @instance_context = TaskStatisticsContext.new( 167 @version, 168 @params['assistant_sid'], 169 @params['task_sid'], 170 ) 171 end 172 @instance_context 173 end
Fetch the TaskStatisticsInstance
@return [TaskStatisticsInstance] Fetched TaskStatisticsInstance
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 214 def fetch 215 context.fetch 216 end
@return [String] The total number of Fields associated with the Task
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 201 def fields_count 202 @properties['fields_count'] 203 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 227 def inspect 228 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 229 "<Twilio.Autopilot.V1.TaskStatisticsInstance #{values}>" 230 end
@return [String] The total number of Samples associated with the Task
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 195 def samples_count 196 @properties['samples_count'] 197 end
@return [String] The SID of the Task for which the statistics were collected
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 189 def task_sid 190 @properties['task_sid'] 191 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 220 def to_s 221 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 222 "<Twilio.Autopilot.V1.TaskStatisticsInstance #{values}>" 223 end
@return [String] The absolute URL of the TaskStatistics resource
# File lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb 207 def url 208 @properties['url'] 209 end