Class: Twilio::REST::Voice::V1::ByocTrunkInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Voice::V1::ByocTrunkInstance
- Defined in:
- lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the BYOC Trunk resource.
-
#cnam_lookup_enabled ⇒ Boolean
Whether Caller ID Name (CNAM) lookup is enabled for the trunk.
-
#connection_policy_sid ⇒ String
The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
-
#context ⇒ ByocTrunkContext
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 ByocTrunkInstance.
-
#fetch ⇒ ByocTrunkInstance
Fetch the ByocTrunkInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#from_domain_sid ⇒ String
The SID of the SIP Domain that should be used in the ‘From` header of originating calls sent to your SIP infrastructure.
-
#initialize(version, payload, sid: nil) ⇒ ByocTrunkInstance
constructor
Initialize the ByocTrunkInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The unique string that that we created to identify the BYOC Trunk resource.
-
#status_callback_method ⇒ String
The HTTP method we use to call ‘status_callback_url`.
-
#status_callback_url ⇒ String
The URL that we call to pass status parameters (such as call ended) to your application.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset) ⇒ ByocTrunkInstance
Update the ByocTrunkInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#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 while retrieving or executing the TwiML requested from ‘voice_url`.
-
#voice_method ⇒ String
The HTTP method we use to call ‘voice_url`.
-
#voice_url ⇒ String
The URL we call using the ‘voice_method` when the BYOC Trunk receives a call.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ByocTrunkInstance
Initialize the ByocTrunkInstance
637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 637 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'sid' => payload['sid'], 'friendly_name' => payload['friendly_name'], 'voice_url' => payload['voice_url'], 'voice_method' => payload['voice_method'], 'voice_fallback_url' => payload['voice_fallback_url'], 'voice_fallback_method' => payload['voice_fallback_method'], 'status_callback_url' => payload['status_callback_url'], 'status_callback_method' => payload['status_callback_method'], 'cnam_lookup_enabled' => payload['cnam_lookup_enabled'], 'connection_policy_sid' => payload['connection_policy_sid'], 'from_domain_sid' => payload['from_domain_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = { '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 BYOC Trunk resource.
678 679 680 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 678 def account_sid @properties['account_sid'] end |
#cnam_lookup_enabled ⇒ Boolean
Returns Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](www.twilio.com/docs/sip-trunking#CNAM) for more information.
732 733 734 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 732 def cnam_lookup_enabled @properties['cnam_lookup_enabled'] end |
#connection_policy_sid ⇒ String
Returns The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure.
738 739 740 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 738 def connection_policy_sid @properties['connection_policy_sid'] end |
#context ⇒ ByocTrunkContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
669 670 671 672 673 674 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 669 def context unless @instance_context @instance_context = ByocTrunkContext.new(@version , @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.
750 751 752 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 750 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.
756 757 758 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 756 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the ByocTrunkInstance
769 770 771 772 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 769 def delete context.delete end |
#fetch ⇒ ByocTrunkInstance
Fetch the ByocTrunkInstance
777 778 779 780 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 777 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
690 691 692 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 690 def friendly_name @properties['friendly_name'] end |
#from_domain_sid ⇒ String
Returns The SID of the SIP Domain that should be used in the ‘From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to "call back" an incoming call, configure this with a [SIP Domain](www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to "sip.twilio.com".
744 745 746 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 744 def from_domain_sid @properties['from_domain_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
831 832 833 834 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 831 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V1.ByocTrunkInstance #{values}>" end |
#sid ⇒ String
Returns The unique string that that we created to identify the BYOC Trunk resource.
684 685 686 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 684 def sid @properties['sid'] end |
#status_callback_method ⇒ String
Returns The HTTP method we use to call ‘status_callback_url`. Either `GET` or `POST`.
726 727 728 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 726 def status_callback_method @properties['status_callback_method'] end |
#status_callback_url ⇒ String
Returns The URL that we call to pass status parameters (such as call ended) to your application.
720 721 722 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 720 def status_callback_url @properties['status_callback_url'] end |
#to_s ⇒ Object
Provide a user friendly representation
824 825 826 827 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 824 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Voice.V1.ByocTrunkInstance #{values}>" end |
#update(friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset) ⇒ ByocTrunkInstance
Update the ByocTrunkInstance
795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 795 def update( friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset ) context.update( friendly_name: friendly_name, voice_url: voice_url, voice_method: voice_method, voice_fallback_url: voice_fallback_url, voice_fallback_method: voice_fallback_method, status_callback_url: status_callback_url, status_callback_method: status_callback_method, cnam_lookup_enabled: cnam_lookup_enabled, connection_policy_sid: connection_policy_sid, from_domain_sid: from_domain_sid, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
762 763 764 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 762 def url @properties['url'] end |
#voice_fallback_method ⇒ String
Returns The HTTP method we use to call ‘voice_fallback_url`. Can be: `GET` or `POST`.
714 715 716 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 714 def voice_fallback_method @properties['voice_fallback_method'] end |
#voice_fallback_url ⇒ String
Returns The URL that we call when an error occurs while retrieving or executing the TwiML requested from ‘voice_url`.
708 709 710 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 708 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`.
702 703 704 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 702 def voice_method @properties['voice_method'] end |
#voice_url ⇒ String
Returns The URL we call using the ‘voice_method` when the BYOC Trunk receives a call.
696 697 698 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 696 def voice_url @properties['voice_url'] end |