Class: Twilio::REST::Preview::Understand::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Understand::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/preview/understand/service.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].
Instance Method Summary collapse
-
#account_sid ⇒ String
The account_sid.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#field_types ⇒ field_types
Access the field_types.
-
#friendly_name ⇒ String
The friendly_name.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#intents ⇒ intents
Access the intents.
-
#latest_model_build_sid ⇒ String
The latest_model_build_sid.
-
#links ⇒ String
The links.
-
#log_queries ⇒ Boolean
The log_queries.
-
#model_builds ⇒ model_builds
Access the model_builds.
-
#queries ⇒ queries
Access the queries.
-
#sid ⇒ String
The sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#ttl ⇒ String
The ttl.
-
#unique_name ⇒ String
The unique_name.
-
#update(friendly_name: :unset, log_queries: :unset, ttl: :unset, unique_name: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 328 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'latest_model_build_sid' => payload['latest_model_build_sid'], 'links' => payload['links'], 'log_queries' => payload['log_queries'], 'sid' => payload['sid'], 'ttl' => payload['ttl'].to_i, 'unique_name' => payload['unique_name'], 'url' => payload['url'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid']} end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
364 365 366 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 364 def account_sid @properties['account_sid'] end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
355 356 357 358 359 360 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 355 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
370 371 372 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 370 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
376 377 378 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 376 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
454 455 456 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 454 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
431 432 433 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 431 def fetch context.fetch end |
#field_types ⇒ field_types
Access the field_types
461 462 463 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 461 def field_types context.field_types end |
#friendly_name ⇒ String
Returns The friendly_name.
382 383 384 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 382 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
495 496 497 498 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 495 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Understand.ServiceInstance #{values}>" end |
#intents ⇒ intents
Access the intents
468 469 470 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 468 def intents context.intents end |
#latest_model_build_sid ⇒ String
Returns The latest_model_build_sid.
388 389 390 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 388 def latest_model_build_sid @properties['latest_model_build_sid'] end |
#links ⇒ String
Returns The links.
394 395 396 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 394 def links @properties['links'] end |
#log_queries ⇒ Boolean
Returns The log_queries.
400 401 402 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 400 def log_queries @properties['log_queries'] end |
#model_builds ⇒ model_builds
Access the model_builds
475 476 477 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 475 def model_builds context.model_builds end |
#queries ⇒ queries
Access the queries
482 483 484 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 482 def queries context.queries end |
#sid ⇒ String
Returns The sid.
406 407 408 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 406 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
488 489 490 491 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 488 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Understand.ServiceInstance #{values}>" end |
#ttl ⇒ String
Returns The ttl.
412 413 414 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 412 def ttl @properties['ttl'] end |
#unique_name ⇒ String
Returns The unique_name.
418 419 420 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 418 def unique_name @properties['unique_name'] end |
#update(friendly_name: :unset, log_queries: :unset, ttl: :unset, unique_name: :unset) ⇒ ServiceInstance
Update the ServiceInstance
442 443 444 445 446 447 448 449 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 442 def update(friendly_name: :unset, log_queries: :unset, ttl: :unset, unique_name: :unset) context.update( friendly_name: friendly_name, log_queries: log_queries, ttl: ttl, unique_name: unique_name, ) end |
#url ⇒ String
Returns The url.
424 425 426 |
# File 'lib/twilio-ruby/rest/preview/understand/service.rb', line 424 def url @properties['url'] end |