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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Service resource.
-
#callback_url ⇒ String
The URL we call when the interaction status changes.
-
#chat_instance_sid ⇒ String
The SID of the Chat Service Instance managed by Proxy Service.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The [ISO 8601](en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The [ISO 8601](en.wikipedia.org/wiki/ISO_8601) date and time in GMT when the resource was last updated.
-
#default_ttl ⇒ String
The default
ttlvalue for Sessions created in the Service. -
#delete ⇒ Boolean
Delete the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance.
- #geo_match_level ⇒ GeoMatchLevel
-
#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 ⇒ Hash
The URLs of resources related to the Service.
- #number_selection_behavior ⇒ NumberSelectionBehavior
-
#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.
-
#sid ⇒ String
The unique string that we created to identify the Service 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
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 645 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'] == nil ? payload['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
697 698 699 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 697 def account_sid @properties['account_sid'] end |
#callback_url ⇒ String
709 710 711 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 709 def callback_url @properties['callback_url'] end |
#chat_instance_sid ⇒ String
703 704 705 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 703 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
676 677 678 679 680 681 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 676 def context unless @instance_context @instance_context = ServiceContext.new(@version , @params['sid']) end @instance_context end |
#date_created ⇒ Time
745 746 747 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 745 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
751 752 753 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 751 def date_updated @properties['date_updated'] end |
#default_ttl ⇒ String
715 716 717 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 715 def default_ttl @properties['default_ttl'] end |
#delete ⇒ Boolean
Delete the ServiceInstance
770 771 772 773 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 770 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch the ServiceInstance
778 779 780 781 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 778 def fetch context.fetch end |
#geo_match_level ⇒ GeoMatchLevel
727 728 729 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 727 def geo_match_level @properties['geo_match_level'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
840 841 842 843 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 840 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ServiceInstance #{values}>" end |
#intercept_callback_url ⇒ String
733 734 735 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 733 def intercept_callback_url @properties['intercept_callback_url'] end |
#links ⇒ Hash
763 764 765 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 763 def links @properties['links'] end |
#number_selection_behavior ⇒ NumberSelectionBehavior
721 722 723 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 721 def number_selection_behavior @properties['number_selection_behavior'] end |
#out_of_session_callback_url ⇒ String
739 740 741 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 739 def out_of_session_callback_url @properties['out_of_session_callback_url'] end |
#phone_numbers ⇒ phone_numbers
Access the phone_numbers
827 828 829 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 827 def phone_numbers context.phone_numbers end |
#sessions ⇒ sessions
Access the sessions
820 821 822 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 820 def sessions context.sessions end |
#sid ⇒ String
685 686 687 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 685 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
833 834 835 836 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 833 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Proxy.V1.ServiceInstance #{values}>" end |
#unique_name ⇒ String
691 692 693 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 691 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
794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 794 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
757 758 759 |
# File 'lib/twilio-ruby/rest/proxy/v1/service.rb', line 757 def url @properties['url'] end |