Class: Twilio::REST::Autopilot::V1::AssistantContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Autopilot::V1::AssistantContext
- Defined in:
- lib/twilio-ruby/rest/autopilot/v1/assistant.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/task.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/query.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/webhook.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/defaults.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/dialogue.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/field_type.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/task/field.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/model_build.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/style_sheet.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/task/sample.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_actions.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/task/task_statistics.rb,
lib/twilio-ruby/rest/autopilot/v1/assistant/field_type/field_value.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].
Defined Under Namespace
Classes: DefaultsContext, DefaultsInstance, DefaultsList, DefaultsPage, DialogueContext, DialogueInstance, DialogueList, DialoguePage, FieldTypeContext, FieldTypeInstance, FieldTypeList, FieldTypePage, ModelBuildContext, ModelBuildInstance, ModelBuildList, ModelBuildPage, QueryContext, QueryInstance, QueryList, QueryPage, StyleSheetContext, StyleSheetInstance, StyleSheetList, StyleSheetPage, TaskContext, TaskInstance, TaskList, TaskPage, WebhookContext, WebhookInstance, WebhookList, WebhookPage
Instance Method Summary collapse
-
#defaults ⇒ DefaultsList, DefaultsContext
Access the defaults.
-
#delete ⇒ Boolean
Delete the AssistantInstance.
-
#dialogues(sid = :unset) ⇒ DialogueList, DialogueContext
Access the dialogues.
-
#fetch ⇒ AssistantInstance
Fetch the AssistantInstance.
-
#field_types(sid = :unset) ⇒ FieldTypeList, FieldTypeContext
Access the field_types.
-
#initialize(version, sid) ⇒ AssistantContext
constructor
Initialize the AssistantContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#model_builds(sid = :unset) ⇒ ModelBuildList, ModelBuildContext
Access the model_builds.
-
#queries(sid = :unset) ⇒ QueryList, QueryContext
Access the queries.
-
#style_sheet ⇒ StyleSheetList, StyleSheetContext
Access the style_sheet.
-
#tasks(sid = :unset) ⇒ TaskList, TaskContext
Access the tasks.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, style_sheet: :unset, defaults: :unset, development_stage: :unset) ⇒ AssistantInstance
Update the AssistantInstance.
-
#webhooks(sid = :unset) ⇒ WebhookList, WebhookContext
Access the webhooks.
Constructor Details
#initialize(version, sid) ⇒ AssistantContext
Initialize the AssistantContext
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 171 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Assistants/#{@solution[:sid]}" # Dependents @tasks = nil @defaults = nil @webhooks = nil @dialogues = nil @model_builds = nil @field_types = nil @style_sheet = nil @queries = nil end |
Instance Method Details
#defaults ⇒ DefaultsList, DefaultsContext
Access the defaults
273 274 275 276 277 278 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 273 def defaults DefaultsContext.new( @version, @solution[:sid] ) end |
#delete ⇒ Boolean
Delete the AssistantInstance
191 192 193 194 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 191 def delete @version.delete('DELETE', @uri) end |
#dialogues(sid = :unset) ⇒ DialogueList, DialogueContext
Access the dialogues
302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 302 def dialogues(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return DialogueContext.new(@version, @solution[:sid],sid ) end unless @dialogues @dialogues = DialogueList.new( @version, assistant_sid: @solution[:sid], ) end @dialogues end |
#fetch ⇒ AssistantInstance
Fetch the AssistantInstance
199 200 201 202 203 204 205 206 207 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 199 def fetch payload = @version.fetch('GET', @uri) AssistantInstance.new( @version, payload, sid: @solution[:sid], ) end |
#field_types(sid = :unset) ⇒ FieldTypeList, FieldTypeContext
Access the field_types
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 340 def field_types(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return FieldTypeContext.new(@version, @solution[:sid],sid ) end unless @field_types @field_types = FieldTypeList.new( @version, assistant_sid: @solution[:sid], ) end @field_types end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
394 395 396 397 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 394 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Autopilot.V1.AssistantContext #{context}>" end |
#model_builds(sid = :unset) ⇒ ModelBuildList, ModelBuildContext
Access the model_builds
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 321 def model_builds(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return ModelBuildContext.new(@version, @solution[:sid],sid ) end unless @model_builds @model_builds = ModelBuildList.new( @version, assistant_sid: @solution[:sid], ) end @model_builds end |
#queries(sid = :unset) ⇒ QueryList, QueryContext
Access the queries
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 369 def queries(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return QueryContext.new(@version, @solution[:sid],sid ) end unless @queries @queries = QueryList.new( @version, assistant_sid: @solution[:sid], ) end @queries end |
#style_sheet ⇒ StyleSheetList, StyleSheetContext
Access the style_sheet
359 360 361 362 363 364 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 359 def style_sheet StyleSheetContext.new( @version, @solution[:sid] ) end |
#tasks(sid = :unset) ⇒ TaskList, TaskContext
Access the tasks
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 254 def tasks(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return TaskContext.new(@version, @solution[:sid],sid ) end unless @tasks @tasks = TaskList.new( @version, assistant_sid: @solution[:sid], ) end @tasks end |
#to_s ⇒ Object
Provide a user friendly representation
387 388 389 390 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 387 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Autopilot.V1.AssistantContext #{context}>" end |
#update(friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, style_sheet: :unset, defaults: :unset, development_stage: :unset) ⇒ AssistantInstance
Update the AssistantInstance
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 220 def update( friendly_name: :unset, log_queries: :unset, unique_name: :unset, callback_url: :unset, callback_events: :unset, style_sheet: :unset, defaults: :unset, development_stage: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'LogQueries' => log_queries, 'UniqueName' => unique_name, 'CallbackUrl' => callback_url, 'CallbackEvents' => callback_events, 'StyleSheet' => Twilio.serialize_object(style_sheet), 'Defaults' => Twilio.serialize_object(defaults), 'DevelopmentStage' => development_stage, }) payload = @version.update('POST', @uri, data: data) AssistantInstance.new( @version, payload, sid: @solution[:sid], ) end |
#webhooks(sid = :unset) ⇒ WebhookList, WebhookContext
Access the webhooks
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/twilio-ruby/rest/autopilot/v1/assistant.rb', line 283 def webhooks(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return WebhookContext.new(@version, @solution[:sid],sid ) end unless @webhooks @webhooks = WebhookList.new( @version, assistant_sid: @solution[:sid], ) end @webhooks end |