Class: Twilio::REST::Proxy::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Proxy::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/proxy/v1/service.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
Account Sid.
-
#callback_url ⇒ String
URL Twilio will send callbacks to.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Service was created.
-
#date_updated ⇒ Time
The date this Service was updated.
-
#default_ttl ⇒ String
Default TTL for a Session, in seconds.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#geo_match_level ⇒ service.GeoMatchLevel
Whether to find proxy numbers in the same areacode.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#intercept_callback_url ⇒ String
A URL for Twilio call before each Interaction.
-
#links ⇒ String
Nested resource URLs.
-
#number_selection_behavior ⇒ service.NumberSelectionBehavior
What behavior to use when choosing a proxy number.
-
#out_of_session_callback_url ⇒ String
A URL for Twilio call when a new Interaction has no Session.
-
#phone_numbers ⇒ phone_numbers
Access the phone_numbers.
-
#sessions ⇒ sessions
Access the sessions.
-
#short_codes ⇒ short_codes
Access the short_codes.
-
#sid ⇒ String
A string that uniquely identifies this Service.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
A human readable description of this resource.
-
#update(unique_name: :unset, default_ttl: :unset, callback_url: :unset, geo_match_level: :unset, number_selection_behavior: :unset, intercept_callback_url: :unset, out_of_session_callback_url: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 331 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'account_sid' => payload['account_sid'], 'callback_url' => payload['callback_url'], 'default_ttl' => payload['default_ttl'].to_i, 'number_selection_behavior' => payload['number_selection_behavior'], 'geo_match_level' => payload['geo_match_level'], 'intercept_callback_url' => payload['intercept_callback_url'], 'out_of_session_callback_url' => payload['out_of_session_callback_url'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
381 382 383 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 381 def account_sid @properties['account_sid'] end |
#callback_url ⇒ String
Returns URL Twilio will send callbacks to.
387 388 389 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 387 def callback_url @properties['callback_url'] 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
360 361 362 363 364 365 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 360 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Service was created.
423 424 425 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 423 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Service was updated.
429 430 431 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 429 def date_updated @properties['date_updated'] end |
#default_ttl ⇒ String
Returns Default TTL for a Session, in seconds.
393 394 395 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 393 def default_ttl @properties['default_ttl'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
455 456 457 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 455 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
448 449 450 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 448 def fetch context.fetch end |
#geo_match_level ⇒ service.GeoMatchLevel
Returns Whether to find proxy numbers in the same areacode.
405 406 407 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 405 def geo_match_level @properties['geo_match_level'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
516 517 518 519 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 516 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ServiceInstance #{values}>" end |
#intercept_callback_url ⇒ String
Returns A URL for Twilio call before each Interaction.
411 412 413 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 411 def intercept_callback_url @properties['intercept_callback_url'] end |
#links ⇒ String
Returns Nested resource URLs.
441 442 443 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 441 def links @properties['links'] end |
#number_selection_behavior ⇒ service.NumberSelectionBehavior
Returns What behavior to use when choosing a proxy number.
399 400 401 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 399 def number_selection_behavior @properties['number_selection_behavior'] end |
#out_of_session_callback_url ⇒ String
Returns A URL for Twilio call when a new Interaction has no Session.
417 418 419 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 417 def out_of_session_callback_url @properties['out_of_session_callback_url'] end |
#phone_numbers ⇒ phone_numbers
Access the phone_numbers
496 497 498 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 496 def phone_numbers context.phone_numbers end |
#sessions ⇒ sessions
Access the sessions
489 490 491 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 489 def sessions context.sessions end |
#short_codes ⇒ short_codes
Access the short_codes
503 504 505 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 503 def short_codes context.short_codes end |
#sid ⇒ String
Returns A string that uniquely identifies this Service.
369 370 371 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 369 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
509 510 511 512 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 509 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns A human readable description of this resource.
375 376 377 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 375 def unique_name @properties['unique_name'] end |
#update(unique_name: :unset, default_ttl: :unset, callback_url: :unset, geo_match_level: :unset, number_selection_behavior: :unset, intercept_callback_url: :unset, out_of_session_callback_url: :unset) ⇒ ServiceInstance
Update the ServiceInstance
474 475 476 477 478 479 480 481 482 483 484 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 474 def update(unique_name: :unset, default_ttl: :unset, callback_url: :unset, geo_match_level: :unset, number_selection_behavior: :unset, intercept_callback_url: :unset, out_of_session_callback_url: :unset) context.update( unique_name: unique_name, default_ttl: default_ttl, callback_url: callback_url, geo_match_level: geo_match_level, number_selection_behavior: number_selection_behavior, intercept_callback_url: intercept_callback_url, out_of_session_callback_url: out_of_session_callback_url, ) end |
#url ⇒ String
Returns The URL of this resource.
435 436 437 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 435 def url @properties['url'] end |