Class: Twilio::REST::Api::V2010::AccountContext::ApplicationInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::ApplicationInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/application.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Application resource.
-
#api_version ⇒ String
The API version used to start a new TwiML session.
-
#context ⇒ ApplicationContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the ApplicationInstance.
-
#fetch ⇒ ApplicationInstance
Fetch the ApplicationInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ ApplicationInstance
constructor
Initialize the ApplicationInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#message_status_callback ⇒ String
The URL we call using a POST method to send message status information to your application.
-
#public_application_connect_enabled ⇒ Boolean
Whether to allow other Twilio accounts to dial this applicaton using Dial verb.
-
#sid ⇒ String
The unique string that that we created to identify the Application resource.
-
#sms_fallback_method ⇒ String
The HTTP method we use to call
sms_fallback_url. -
#sms_fallback_url ⇒ String
The URL that we call when an error occurs while retrieving or executing the TwiML from
sms_url. -
#sms_method ⇒ String
The HTTP method we use to call
sms_url. -
#sms_status_callback ⇒ String
The URL we call using a POST method to send status information to your application about SMS messages that refer to the application.
-
#sms_url ⇒ String
The URL we call when the phone number receives an incoming SMS message.
-
#status_callback ⇒ String
The URL we call using the
status_callback_methodto send status information to your application. -
#status_callback_method ⇒ String
The HTTP method we use to call
status_callback. -
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset) ⇒ ApplicationInstance
Update the ApplicationInstance.
-
#uri ⇒ String
The URI of the resource, relative to
https://api.twilio.com. -
#voice_caller_id_lookup ⇒ Boolean
Whether we look up the caller’s caller-ID name from the CNAM database (additional charges apply).
-
#voice_fallback_method ⇒ String
The HTTP method we use to call
voice_fallback_url. -
#voice_fallback_url ⇒ String
The URL that we call when an error occurs retrieving or executing the TwiML requested by
url. -
#voice_method ⇒ String
The HTTP method we use to call
voice_url. -
#voice_url ⇒ String
The URL we call when the phone number assigned to this application receives a call.
Constructor Details
#initialize(version, payload, account_sid: nil, sid: nil) ⇒ ApplicationInstance
Initialize the ApplicationInstance
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 718 def initialize(version, payload , account_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'api_version' => payload['api_version'], 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'message_status_callback' => payload['message_status_callback'], 'sid' => payload['sid'], 'sms_fallback_method' => payload['sms_fallback_method'], 'sms_fallback_url' => payload['sms_fallback_url'], 'sms_method' => payload['sms_method'], 'sms_status_callback' => payload['sms_status_callback'], 'sms_url' => payload['sms_url'], 'status_callback' => payload['status_callback'], 'status_callback_method' => payload['status_callback_method'], 'uri' => payload['uri'], 'voice_caller_id_lookup' => payload['voice_caller_id_lookup'], 'voice_fallback_method' => payload['voice_fallback_method'], 'voice_fallback_url' => payload['voice_fallback_url'], 'voice_method' => payload['voice_method'], 'voice_url' => payload['voice_url'], 'public_application_connect_enabled' => payload['public_application_connect_enabled'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Application resource.
765 766 767 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 765 def account_sid @properties['account_sid'] end |
#api_version ⇒ String
Returns The API version used to start a new TwiML session.
771 772 773 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 771 def api_version @properties['api_version'] end |
#context ⇒ ApplicationContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
756 757 758 759 760 761 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 756 def context unless @instance_context @instance_context = ApplicationContext.new(@version , @params['account_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
777 778 779 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 777 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
783 784 785 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 783 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ApplicationInstance
892 893 894 895 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 892 def delete context.delete end |
#fetch ⇒ ApplicationInstance
Fetch the ApplicationInstance
900 901 902 903 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 900 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
789 790 791 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 789 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
972 973 974 975 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 972 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.ApplicationInstance #{values}>" end |
#message_status_callback ⇒ String
Returns The URL we call using a POST method to send message status information to your application.
795 796 797 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 795 def @properties['message_status_callback'] end |
#public_application_connect_enabled ⇒ Boolean
Returns Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: true or false.
885 886 887 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 885 def public_application_connect_enabled @properties['public_application_connect_enabled'] end |
#sid ⇒ String
Returns The unique string that that we created to identify the Application resource.
801 802 803 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 801 def sid @properties['sid'] end |
#sms_fallback_method ⇒ String
Returns The HTTP method we use to call sms_fallback_url. Can be: GET or POST.
807 808 809 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 807 def sms_fallback_method @properties['sms_fallback_method'] end |
#sms_fallback_url ⇒ String
Returns The URL that we call when an error occurs while retrieving or executing the TwiML from sms_url.
813 814 815 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 813 def sms_fallback_url @properties['sms_fallback_url'] end |
#sms_method ⇒ String
Returns The HTTP method we use to call sms_url. Can be: GET or POST.
819 820 821 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 819 def sms_method @properties['sms_method'] end |
#sms_status_callback ⇒ String
Returns The URL we call using a POST method to send status information to your application about SMS messages that refer to the application.
825 826 827 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 825 def sms_status_callback @properties['sms_status_callback'] end |
#sms_url ⇒ String
Returns The URL we call when the phone number receives an incoming SMS message.
831 832 833 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 831 def sms_url @properties['sms_url'] end |
#status_callback ⇒ String
Returns The URL we call using the status_callback_method to send status information to your application.
837 838 839 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 837 def status_callback @properties['status_callback'] end |
#status_callback_method ⇒ String
Returns The HTTP method we use to call status_callback. Can be: GET or POST.
843 844 845 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 843 def status_callback_method @properties['status_callback_method'] end |
#to_s ⇒ Object
Provide a user friendly representation
965 966 967 968 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 965 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.ApplicationInstance #{values}>" end |
#update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset) ⇒ ApplicationInstance
Update the ApplicationInstance
924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 924 def update( friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback: :unset, status_callback_method: :unset, voice_caller_id_lookup: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, message_status_callback: :unset, public_application_connect_enabled: :unset ) context.update( friendly_name: friendly_name, api_version: api_version, voice_url: voice_url, voice_method: voice_method, voice_fallback_url: voice_fallback_url, voice_fallback_method: voice_fallback_method, status_callback: status_callback, status_callback_method: status_callback_method, voice_caller_id_lookup: voice_caller_id_lookup, sms_url: sms_url, sms_method: sms_method, sms_fallback_url: sms_fallback_url, sms_fallback_method: sms_fallback_method, sms_status_callback: sms_status_callback, message_status_callback: , public_application_connect_enabled: public_application_connect_enabled, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to https://api.twilio.com.
849 850 851 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 849 def uri @properties['uri'] end |
#voice_caller_id_lookup ⇒ Boolean
Returns Whether we look up the caller’s caller-ID name from the CNAM database (additional charges apply). Can be: true or false.
855 856 857 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 855 def voice_caller_id_lookup @properties['voice_caller_id_lookup'] end |
#voice_fallback_method ⇒ String
Returns The HTTP method we use to call voice_fallback_url. Can be: GET or POST.
861 862 863 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 861 def voice_fallback_method @properties['voice_fallback_method'] end |
#voice_fallback_url ⇒ String
Returns The URL that we call when an error occurs retrieving or executing the TwiML requested by url.
867 868 869 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 867 def voice_fallback_url @properties['voice_fallback_url'] end |
#voice_method ⇒ String
Returns The HTTP method we use to call voice_url. Can be: GET or POST.
873 874 875 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 873 def voice_method @properties['voice_method'] end |
#voice_url ⇒ String
Returns The URL we call when the phone number assigned to this application receives a call.
879 880 881 |
# File 'lib/twilio-ruby/rest/api/v2010/account/application.rb', line 879 def voice_url @properties['voice_url'] end |