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
The SID of the Account that created the resource.
-
#callback_url ⇒ String
The URL we call when the interaction status changes.
-
#chat_instance_sid ⇒ String
The SID of the Chat Service Instance.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The ISO 8601 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The ISO 8601 date and time in GMT when the resource was last 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
Where a proxy number must be located relative to the participant identifier.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#intercept_callback_url ⇒ String
The URL we call on each interaction.
-
#links ⇒ String
The URLs of resources related to the Service.
-
#number_selection_behavior ⇒ service.NumberSelectionBehavior
The preference for Proxy Number selection for the Service instance.
-
#out_of_session_callback_url ⇒ String
The URL we call when an inbound call or SMS action occurs on a closed or non-existent Session.
-
#phone_numbers ⇒ phone_numbers
Access the phone_numbers.
-
#sessions ⇒ sessions
Access the sessions.
-
#short_codes ⇒ short_codes
Access the short_codes.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#unique_name ⇒ String
An application-defined string that uniquely identifies the 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, chat_instance_sid: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The absolute URL of the Service resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 396 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'unique_name' => payload['unique_name'], 'account_sid' => payload['account_sid'], 'chat_instance_sid' => payload['chat_instance_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 The SID of the Account that created the resource.
447 448 449 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 447 def account_sid @properties['account_sid'] end |
#callback_url ⇒ String
Returns The URL we call when the interaction status changes.
459 460 461 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 459 def callback_url @properties['callback_url'] end |
#chat_instance_sid ⇒ String
Returns The SID of the Chat Service Instance.
453 454 455 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 453 def chat_instance_sid @properties['chat_instance_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
426 427 428 429 430 431 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 426 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was created.
495 496 497 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 495 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The ISO 8601 date and time in GMT when the resource was last updated.
501 502 503 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 501 def date_updated @properties['date_updated'] end |
#default_ttl ⇒ String
Returns Default TTL for a Session, in seconds.
465 466 467 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 465 def default_ttl @properties['default_ttl'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
527 528 529 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 527 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
520 521 522 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 520 def fetch context.fetch end |
#geo_match_level ⇒ service.GeoMatchLevel
Returns Where a proxy number must be located relative to the participant identifier.
477 478 479 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 477 def geo_match_level @properties['geo_match_level'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
615 616 617 618 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 615 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ServiceInstance #{values}>" end |
#intercept_callback_url ⇒ String
Returns The URL we call on each interaction.
483 484 485 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 483 def intercept_callback_url @properties['intercept_callback_url'] end |
#links ⇒ String
Returns The URLs of resources related to the Service.
513 514 515 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 513 def links @properties['links'] end |
#number_selection_behavior ⇒ service.NumberSelectionBehavior
Returns The preference for Proxy Number selection for the Service instance.
471 472 473 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 471 def number_selection_behavior @properties['number_selection_behavior'] end |
#out_of_session_callback_url ⇒ String
Returns The URL we call when an inbound call or SMS action occurs on a closed or non-existent Session.
489 490 491 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 489 def out_of_session_callback_url @properties['out_of_session_callback_url'] end |
#phone_numbers ⇒ phone_numbers
Access the phone_numbers
595 596 597 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 595 def phone_numbers context.phone_numbers end |
#sessions ⇒ sessions
Access the sessions
588 589 590 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 588 def sessions context.sessions end |
#short_codes ⇒ short_codes
Access the short_codes
602 603 604 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 602 def short_codes context.short_codes end |
#sid ⇒ String
Returns The unique string that identifies the resource.
435 436 437 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 435 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
608 609 610 611 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 608 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
Returns An application-defined string that uniquely identifies the resource.
441 442 443 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 441 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, chat_instance_sid: :unset) ⇒ ServiceInstance
Update the ServiceInstance
572 573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 572 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, chat_instance_sid: :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, chat_instance_sid: chat_instance_sid, ) end |
#url ⇒ String
Returns The absolute URL of the Service resource.
507 508 509 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 507 def url @properties['url'] end |