class Twilio::REST::Trunking::V1::TrunkInstance
Public Class Methods
Initialize the TrunkInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The unique string that we created to identify the Trunk
resource to fetch.
@return [TrunkInstance] TrunkInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 379 def initialize(version, payload, sid: nil) 380 super(version) 381 382 # Marshaled Properties 383 @properties = { 384 'account_sid' => payload['account_sid'], 385 'domain_name' => payload['domain_name'], 386 'disaster_recovery_method' => payload['disaster_recovery_method'], 387 'disaster_recovery_url' => payload['disaster_recovery_url'], 388 'friendly_name' => payload['friendly_name'], 389 'secure' => payload['secure'], 390 'recording' => payload['recording'], 391 'transfer_mode' => payload['transfer_mode'], 392 'cnam_lookup_enabled' => payload['cnam_lookup_enabled'], 393 'auth_type' => payload['auth_type'], 394 'auth_type_set' => payload['auth_type_set'], 395 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 396 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 397 'sid' => payload['sid'], 398 'url' => payload['url'], 399 'links' => payload['links'], 400 } 401 402 # Context 403 @instance_context = nil 404 @params = {'sid' => sid || @properties['sid'], } 405 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 420 def account_sid 421 @properties['account_sid'] 422 end
@return [String] The types of authentication mapped to the domain
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 474 def auth_type 475 @properties['auth_type'] 476 end
@return [Array] Reserved
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 480 def auth_type_set 481 @properties['auth_type_set'] 482 end
@return [Boolean] Whether Caller ID Name (CNAM) lookup is enabled for the trunk
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 468 def cnam_lookup_enabled 469 @properties['cnam_lookup_enabled'] 470 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [TrunkContext] TrunkContext
for this TrunkInstance
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 411 def context 412 unless @instance_context 413 @instance_context = TrunkContext.new(@version, @params['sid'], ) 414 end 415 @instance_context 416 end
Access the credentials_lists
@return [credentials_lists] credentials_lists
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 582 def credentials_lists 583 context.credentials_lists 584 end
@return [Time] The RFC 2822 date and time in GMT when the resource was created
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 486 def date_created 487 @properties['date_created'] 488 end
@return [Time] The RFC 2822 date and time in GMT when the resource was last updated
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 492 def date_updated 493 @properties['date_updated'] 494 end
Delete the TrunkInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 524 def delete 525 context.delete 526 end
@return [String] The HTTP
method we use to call the disaster_recovery_url
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 432 def disaster_recovery_method 433 @properties['disaster_recovery_method'] 434 end
@return [String] The HTTP
URL that we call if an error occurs while sending SIP traffic towards your configured Origination URL
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 438 def disaster_recovery_url 439 @properties['disaster_recovery_url'] 440 end
@return [String] The unique address you reserve on Twilio
to which you route your SIP traffic
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 426 def domain_name 427 @properties['domain_name'] 428 end
Fetch the TrunkInstance
@return [TrunkInstance] Fetched TrunkInstance
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 517 def fetch 518 context.fetch 519 end
@return [String] The string that you assigned to describe the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 444 def friendly_name 445 @properties['friendly_name'] 446 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 616 def inspect 617 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 618 "<Twilio.Trunking.V1.TrunkInstance #{values}>" 619 end
Access the ip_access_control_lists
@return [ip_access_control_lists] ip_access_control_lists
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 589 def ip_access_control_lists 590 context.ip_access_control_lists 591 end
@return [String] The URLs of related resources
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 510 def links 511 @properties['links'] 512 end
Access the origination_urls
@return [origination_urls] origination_urls
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 575 def origination_urls 576 context.origination_urls 577 end
Access the phone_numbers
@return [phone_numbers] phone_numbers
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 596 def phone_numbers 597 context.phone_numbers 598 end
@return [Hash] The recording settings for the trunk
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 456 def recording 457 @properties['recording'] 458 end
Access the recordings @return [recordings] recordings
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 603 def recordings 604 context.recordings 605 end
@return [Boolean] Whether Secure Trunking
is enabled for the trunk
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 450 def secure 451 @properties['secure'] 452 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 498 def sid 499 @properties['sid'] 500 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 609 def to_s 610 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 611 "<Twilio.Trunking.V1.TrunkInstance #{values}>" 612 end
@return [trunk.TransferSetting] The call transfer settings for the trunk
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 462 def transfer_mode 463 @properties['transfer_mode'] 464 end
Update the TrunkInstance
@param [String] friendly_name
A descriptive string that you create to describe
the resource. It can be up to 64 characters long.
@param [String] domain_name
The unique address you reserve on Twilio
to which
you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See {Termination Settings}[https://www.twilio.com/docs/sip-trunking#termination] for more information.
@param [String] disaster_recovery_url
The URL we should call using the
`disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See {Disaster Recovery}[https://www.twilio.com/docs/sip-trunking#disaster-recovery] for more information.
@param [String] disaster_recovery_method
The HTTP
method we should use to call
the `disaster_recovery_url`. Can be: `GET` or `POST`.
@param [trunk.TransferSetting] transfer_mode
The call transfer settings for the
trunk. Can be: `enable-all`, `sip-only` and `disable-all`. See {Transfer}[https://www.twilio.com/docs/sip-trunking/call-transfer] for more information.
@param [Boolean] secure Whether Secure Trunking
is enabled for the trunk. If
enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See {Secure Trunking}[https://www.twilio.com/docs/sip-trunking#securetrunking] for more information.
@param [Boolean] cnam_lookup_enabled
Whether Caller ID Name (CNAM) lookup should
be enabled for the trunk. If enabled, all inbound calls to the SIP 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.
@return [TrunkInstance] Updated TrunkInstance
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 560 def update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, transfer_mode: :unset, secure: :unset, cnam_lookup_enabled: :unset) 561 context.update( 562 friendly_name: friendly_name, 563 domain_name: domain_name, 564 disaster_recovery_url: disaster_recovery_url, 565 disaster_recovery_method: disaster_recovery_method, 566 transfer_mode: transfer_mode, 567 secure: secure, 568 cnam_lookup_enabled: cnam_lookup_enabled, 569 ) 570 end
@return [String] The absolute URL of the resource
# File lib/twilio-ruby/rest/trunking/v1/trunk.rb 504 def url 505 @properties['url'] 506 end