Class: Twilio::REST::Intelligence::V2::ServiceInstance
- Inherits:
-
Twilio::REST::InstanceResource
- Object
- Twilio::REST::InstanceResource
- Twilio::REST::Intelligence::V2::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/intelligence/v2/service.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account the Service belongs to.
-
#auto_redaction ⇒ Boolean
Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.
-
#auto_transcribe ⇒ Boolean
Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#data_logging ⇒ Boolean
Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models.
-
#date_created ⇒ Time
The date that this Service was created, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that this Service was updated, given in ISO 8601 format.
-
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
-
#friendly_name ⇒ String
A human readable description of this resource, up to 64 characters.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#language_code ⇒ String
The default language code of the audio.
-
#media_redaction ⇒ Boolean
Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Service.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.
-
#update(auto_transcribe: :unset, data_logging: :unset, friendly_name: :unset, language_code: :unset, unique_name: :unset, auto_redaction: :unset, media_redaction: :unset, webhook_url: :unset, webhook_http_method: :unset, if_match: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The URL of this resource.
-
#version ⇒ String
The version number of this Service.
- #webhook_http_method ⇒ HttpMethod
-
#webhook_url ⇒ String
The URL Twilio will request when executing the Webhook.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 308 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'auto_redaction' => payload['auto_redaction'], 'media_redaction' => payload['media_redaction'], 'auto_transcribe' => payload['auto_transcribe'], 'data_logging' => payload['data_logging'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'language_code' => payload['language_code'], 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'url' => payload['url'], 'webhook_url' => payload['webhook_url'], 'webhook_http_method' => payload['webhook_http_method'], 'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i, } # Context @instance_context = nil @params = { 'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account the Service belongs to.
348 349 350 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 348 def account_sid @properties['account_sid'] end |
#auto_redaction ⇒ Boolean
Returns Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service.
354 355 356 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 354 def auto_redaction @properties['auto_redaction'] end |
#auto_transcribe ⇒ Boolean
Returns Instructs the Speech Recognition service to automatically transcribe all recordings made on the account.
366 367 368 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 366 def auto_transcribe @properties['auto_transcribe'] 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
339 340 341 342 343 344 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 339 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#data_logging ⇒ Boolean
Returns Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models.
372 373 374 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 372 def data_logging @properties['data_logging'] end |
#date_created ⇒ Time
Returns The date that this Service was created, given in ISO 8601 format.
378 379 380 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 378 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Service was updated, given in ISO 8601 format.
384 385 386 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 384 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
439 440 441 442 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 439 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
447 448 449 450 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 447 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable description of this resource, up to 64 characters.
390 391 392 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 390 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
501 502 503 504 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 501 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.ServiceInstance #{values}>" end |
#language_code ⇒ String
Returns The default language code of the audio.
396 397 398 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 396 def language_code @properties['language_code'] end |
#media_redaction ⇒ Boolean
Returns Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise.
360 361 362 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 360 def media_redaction @properties['media_redaction'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Service.
402 403 404 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 402 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
494 495 496 497 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 494 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Intelligence.V2.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID.
408 409 410 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 408 def unique_name @properties['unique_name'] end |
#update(auto_transcribe: :unset, data_logging: :unset, friendly_name: :unset, language_code: :unset, unique_name: :unset, auto_redaction: :unset, media_redaction: :unset, webhook_url: :unset, webhook_http_method: :unset, if_match: :unset) ⇒ ServiceInstance
Update the ServiceInstance
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 465 def update( auto_transcribe: :unset, data_logging: :unset, friendly_name: :unset, language_code: :unset, unique_name: :unset, auto_redaction: :unset, media_redaction: :unset, webhook_url: :unset, webhook_http_method: :unset, if_match: :unset ) context.update( auto_transcribe: auto_transcribe, data_logging: data_logging, friendly_name: friendly_name, language_code: language_code, unique_name: unique_name, auto_redaction: auto_redaction, media_redaction: media_redaction, webhook_url: webhook_url, webhook_http_method: webhook_http_method, if_match: if_match, ) end |
#url ⇒ String
Returns The URL of this resource.
414 415 416 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 414 def url @properties['url'] end |
#version ⇒ String
Returns The version number of this Service.
432 433 434 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 432 def version @properties['version'] end |
#webhook_http_method ⇒ HttpMethod
426 427 428 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 426 def webhook_http_method @properties['webhook_http_method'] end |
#webhook_url ⇒ String
Returns The URL Twilio will request when executing the Webhook.
420 421 422 |
# File 'lib/twilio-ruby/rest/intelligence/v2/service.rb', line 420 def webhook_url @properties['webhook_url'] end |