Class: Twilio::REST::Autopilot::V1::AssistantContext::TaskContext::TaskStatisticsInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Autopilot::V1::AssistantContext::TaskContext::TaskStatisticsInstance
- Defined in:
- lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the TaskStatistics resource.
-
#assistant_sid ⇒ String
The SID of the [Assistant](www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource.
-
#context ⇒ TaskStatisticsContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ TaskStatisticsInstance
Fetch the TaskStatisticsInstance.
-
#fields_count ⇒ String
The total number of [Fields](www.twilio.com/docs/autopilot/api/task-field) associated with the Task.
-
#initialize(version, payload, assistant_sid: nil, task_sid: nil) ⇒ TaskStatisticsInstance
constructor
Initialize the TaskStatisticsInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#samples_count ⇒ String
The total number of [Samples](www.twilio.com/docs/autopilot/api/task-sample) associated with the Task.
-
#task_sid ⇒ String
The SID of the [Task](www.twilio.com/docs/autopilot/api/task) for which the statistics were collected.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the TaskStatistics resource.
Constructor Details
#initialize(version, payload, assistant_sid: nil, task_sid: nil) ⇒ TaskStatisticsInstance
Initialize the TaskStatisticsInstance
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 131 def initialize(version, payload , assistant_sid: nil, task_sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'assistant_sid' => payload['assistant_sid'], 'task_sid' => payload['task_sid'], 'samples_count' => payload['samples_count'] == nil ? payload['samples_count'] : payload['samples_count'].to_i, 'fields_count' => payload['fields_count'] == nil ? payload['fields_count'] : payload['fields_count'].to_i, 'url' => payload['url'], } # Context @instance_context = nil @params = { 'assistant_sid' => assistant_sid || @properties['assistant_sid'] ,'task_sid' => task_sid || @properties['task_sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the TaskStatistics resource.
162 163 164 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 162 def account_sid @properties['account_sid'] end |
#assistant_sid ⇒ String
Returns The SID of the [Assistant](www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource.
168 169 170 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 168 def assistant_sid @properties['assistant_sid'] end |
#context ⇒ TaskStatisticsContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
153 154 155 156 157 158 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 153 def context unless @instance_context @instance_context = TaskStatisticsContext.new(@version , @params['assistant_sid'], @params['task_sid']) end @instance_context end |
#fetch ⇒ TaskStatisticsInstance
Fetch the TaskStatisticsInstance
199 200 201 202 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 199 def fetch context.fetch end |
#fields_count ⇒ String
Returns The total number of [Fields](www.twilio.com/docs/autopilot/api/task-field) associated with the Task.
186 187 188 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 186 def fields_count @properties['fields_count'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
213 214 215 216 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 213 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Autopilot.V1.TaskStatisticsInstance #{values}>" end |
#samples_count ⇒ String
Returns The total number of [Samples](www.twilio.com/docs/autopilot/api/task-sample) associated with the Task.
180 181 182 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 180 def samples_count @properties['samples_count'] end |
#task_sid ⇒ String
Returns The SID of the [Task](www.twilio.com/docs/autopilot/api/task) for which the statistics were collected.
174 175 176 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 174 def task_sid @properties['task_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
206 207 208 209 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 206 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Autopilot.V1.TaskStatisticsInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the TaskStatistics resource.
192 193 194 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb', line 192 def url @properties['url'] end |