class Twilio::REST::Voice::V1::ByocTrunkInstance

Public Class Methods

new(version, payload, sid: nil) click to toggle source

Initialize the ByocTrunkInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] sid The Twilio-provided string that uniquely identifies the BYOC

Trunk resource to fetch.

@return [ByocTrunkInstance] ByocTrunkInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
293 def initialize(version, payload, sid: nil)
294   super(version)
295 
296   # Marshaled Properties
297   @properties = {
298       'account_sid' => payload['account_sid'],
299       'sid' => payload['sid'],
300       'friendly_name' => payload['friendly_name'],
301       'voice_url' => payload['voice_url'],
302       'voice_method' => payload['voice_method'],
303       'voice_fallback_url' => payload['voice_fallback_url'],
304       'voice_fallback_method' => payload['voice_fallback_method'],
305       'status_callback_url' => payload['status_callback_url'],
306       'status_callback_method' => payload['status_callback_method'],
307       'cnam_lookup_enabled' => payload['cnam_lookup_enabled'],
308       'connection_policy_sid' => payload['connection_policy_sid'],
309       'from_domain_sid' => payload['from_domain_sid'],
310       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
311       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
312       'url' => payload['url'],
313   }
314 
315   # Context
316   @instance_context = nil
317   @params = {'sid' => sid || @properties['sid'], }
318 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the resource

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
333 def account_sid
334   @properties['account_sid']
335 end
cnam_lookup_enabled() click to toggle source

@return [Boolean] Whether Caller ID Name (CNAM) lookup is enabled for the trunk

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
387 def cnam_lookup_enabled
388   @properties['cnam_lookup_enabled']
389 end
connection_policy_sid() click to toggle source

@return [String] Origination Connection Policy (to your Carrier)

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
393 def connection_policy_sid
394   @properties['connection_policy_sid']
395 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [ByocTrunkContext] ByocTrunkContext for this ByocTrunkInstance

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
324 def context
325   unless @instance_context
326     @instance_context = ByocTrunkContext.new(@version, @params['sid'], )
327   end
328   @instance_context
329 end
date_created() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was created

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
405 def date_created
406   @properties['date_created']
407 end
date_updated() click to toggle source

@return [Time] The RFC 2822 date and time in GMT that the resource was last updated

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
411 def date_updated
412   @properties['date_updated']
413 end
delete() click to toggle source

Delete the ByocTrunkInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
475 def delete
476   context.delete
477 end
fetch() click to toggle source

Fetch the ByocTrunkInstance @return [ByocTrunkInstance] Fetched ByocTrunkInstance

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
424 def fetch
425   context.fetch
426 end
friendly_name() click to toggle source

@return [String] The string that you assigned to describe the resource

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
345 def friendly_name
346   @properties['friendly_name']
347 end
from_domain_sid() click to toggle source

@return [String] The SID of the SIP Domain that should be used in the `From` header of originating calls

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
399 def from_domain_sid
400   @properties['from_domain_sid']
401 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
488 def inspect
489   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
490   "<Twilio.Voice.V1.ByocTrunkInstance #{values}>"
491 end
sid() click to toggle source

@return [String] The unique string that identifies the resource

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
339 def sid
340   @properties['sid']
341 end
status_callback_method() click to toggle source

@return [String] The HTTP method we use to call status_callback_url

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
381 def status_callback_method
382   @properties['status_callback_method']
383 end
status_callback_url() click to toggle source

@return [String] The URL that we call with status updates

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
375 def status_callback_url
376   @properties['status_callback_url']
377 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
481 def to_s
482   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
483   "<Twilio.Voice.V1.ByocTrunkInstance #{values}>"
484 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) click to toggle source

Update the ByocTrunkInstance @param [String] friendly_name A descriptive string that you create to describe

the resource. It is not unique and can be up to 255 characters long.

@param [String] voice_url The URL we should call when the BYOC Trunk receives a

call.

@param [String] voice_method The HTTP method we should use to call `voice_url` @param [String] voice_fallback_url The URL that we should call when an error

occurs while retrieving or executing the TwiML requested by `voice_url`.

@param [String] voice_fallback_method The HTTP method we should use to call

`voice_fallback_url`. Can be: `GET` or `POST`.

@param [String] status_callback_url The URL that we should call to pass status

parameters (such as call ended) to your application.

@param [String] status_callback_method The HTTP method we should use to call

`status_callback_url`. Can be: `GET` or `POST`.

@param [Boolean] cnam_lookup_enabled 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}[https://www.twilio.com/docs/sip-trunking#CNAM] for more information.

@param [String] connection_policy_sid The SID of the Connection Policy that

Twilio will use when routing traffic to your communications infrastructure.

@param [String] from_domain_sid 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}[https://www.twilio.com/docs/voice/api/sending-sip] to ensure
proper routing. If not configured, the from domain will default to
"sip.twilio.com".

@return [ByocTrunkInstance] Updated ByocTrunkInstance

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
457 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)
458   context.update(
459       friendly_name: friendly_name,
460       voice_url: voice_url,
461       voice_method: voice_method,
462       voice_fallback_url: voice_fallback_url,
463       voice_fallback_method: voice_fallback_method,
464       status_callback_url: status_callback_url,
465       status_callback_method: status_callback_method,
466       cnam_lookup_enabled: cnam_lookup_enabled,
467       connection_policy_sid: connection_policy_sid,
468       from_domain_sid: from_domain_sid,
469   )
470 end
url() click to toggle source

@return [String] The absolute URL of the resource

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
417 def url
418   @properties['url']
419 end
voice_fallback_method() click to toggle source

@return [String] The HTTP method used with voice_fallback_url

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
369 def voice_fallback_method
370   @properties['voice_fallback_method']
371 end
voice_fallback_url() click to toggle source

@return [String] The URL we call when an error occurs while executing TwiML

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
363 def voice_fallback_url
364   @properties['voice_fallback_url']
365 end
voice_method() click to toggle source

@return [String] The HTTP method to use with voice_url

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
357 def voice_method
358   @properties['voice_method']
359 end
voice_url() click to toggle source

@return [String] The URL we call when receiving a call

    # File lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
351 def voice_url
352   @properties['voice_url']
353 end