Class: Twilio::REST::Assistants::V1::AssistantContext::AssistantsToolInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Assistants::V1::AssistantContext::AssistantsToolInstance
- Defined in:
- lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Tool resource.
-
#context ⇒ AssistantsToolContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#create ⇒ AssistantsToolInstance
Create the AssistantsToolInstance.
-
#date_created ⇒ Time
The date and time in GMT when the Tool was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date and time in GMT when the Tool was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the AssistantsToolInstance.
-
#description ⇒ String
The description of the tool.
-
#enabled ⇒ Boolean
True if the tool is enabled.
-
#id ⇒ String
The tool ID.
-
#initialize(version, payload, assistant_id: nil, id: nil) ⇒ AssistantsToolInstance
constructor
Initialize the AssistantsToolInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#meta ⇒ Hash
The metadata related to method, url, input_schema to used with the Tool.
-
#name ⇒ String
The name of the tool.
-
#requires_auth ⇒ Boolean
The authentication requirement for the tool.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#type ⇒ String
The type of the tool.
-
#url ⇒ String
The url of the tool resource.
Constructor Details
#initialize(version, payload, assistant_id: nil, id: nil) ⇒ AssistantsToolInstance
Initialize the AssistantsToolInstance
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 225 def initialize(version, payload , assistant_id: nil, id: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'description' => payload['description'], 'enabled' => payload['enabled'], 'id' => payload['id'], 'meta' => payload['meta'], 'name' => payload['name'], 'requires_auth' => payload['requires_auth'], 'type' => payload['type'], 'url' => payload['url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'assistant_id' => assistant_id || @properties['assistant_id'] ,'id' => id || @properties['id'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Tool resource.
261 262 263 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 261 def account_sid @properties['account_sid'] end |
#context ⇒ AssistantsToolContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 252 def context unless @instance_context @instance_context = AssistantsToolContext.new(@version , @params['assistant_id'], @params['id']) end @instance_context end |
#create ⇒ AssistantsToolInstance
Create the AssistantsToolInstance
328 329 330 331 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 328 def create context.create end |
#date_created ⇒ Time
Returns The date and time in GMT when the Tool was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
315 316 317 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 315 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the Tool was last updated specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
321 322 323 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 321 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the AssistantsToolInstance
336 337 338 339 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 336 def delete context.delete end |
#description ⇒ String
Returns The description of the tool.
267 268 269 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 267 def description @properties['description'] end |
#enabled ⇒ Boolean
Returns True if the tool is enabled.
273 274 275 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 273 def enabled @properties['enabled'] end |
#id ⇒ String
Returns The tool ID.
279 280 281 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 279 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
350 351 352 353 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 350 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.AssistantsToolInstance #{values}>" end |
#meta ⇒ Hash
Returns The metadata related to method, url, input_schema to used with the Tool.
285 286 287 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 285 def @properties['meta'] end |
#name ⇒ String
Returns The name of the tool.
291 292 293 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 291 def name @properties['name'] end |
#requires_auth ⇒ Boolean
Returns The authentication requirement for the tool.
297 298 299 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 297 def requires_auth @properties['requires_auth'] end |
#to_s ⇒ Object
Provide a user friendly representation
343 344 345 346 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 343 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Assistants.V1.AssistantsToolInstance #{values}>" end |
#type ⇒ String
Returns The type of the tool. (‘WEBHOOK’).
303 304 305 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 303 def type @properties['type'] end |
#url ⇒ String
Returns The url of the tool resource.
309 310 311 |
# File 'lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb', line 309 def url @properties['url'] end |