Class: Twilio::REST::Trunking::V1::TrunkInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Trunking::V1::TrunkInstance
- Defined in:
- lib/twilio-ruby/rest/trunking/v1/trunk.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Trunk resource.
-
#auth_type ⇒ String
The types of authentication mapped to the domain.
-
#auth_type_set ⇒ Array<String>
Reserved.
-
#cnam_lookup_enabled ⇒ Boolean
Whether Caller ID Name (CNAM) lookup is enabled for the trunk.
-
#context ⇒ TrunkContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#credentials_lists ⇒ credentials_lists
Access the credentials_lists.
-
#date_created ⇒ Time
The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#date_updated ⇒ Time
The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
-
#delete ⇒ Boolean
Delete the TrunkInstance.
-
#disaster_recovery_method ⇒ String
The HTTP method we use to call the ‘disaster_recovery_url`.
-
#disaster_recovery_url ⇒ String
The URL we call using the ‘disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL.
-
#domain_name ⇒ String
The unique address you reserve on Twilio to which you route your SIP traffic.
-
#fetch ⇒ TrunkInstance
Fetch the TrunkInstance.
-
#friendly_name ⇒ String
The string that you assigned to describe the resource.
-
#initialize(version, payload, sid: nil) ⇒ TrunkInstance
constructor
Initialize the TrunkInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#ip_access_control_lists ⇒ ip_access_control_lists
Access the ip_access_control_lists.
-
#links ⇒ Hash
The URLs of related resources.
-
#origination_urls ⇒ origination_urls
Access the origination_urls.
-
#phone_numbers ⇒ phone_numbers
Access the phone_numbers.
-
#recording ⇒ Hash
The recording settings for the trunk.
-
#recordings ⇒ recordings
Access the recordings.
-
#secure ⇒ Boolean
Whether Secure Trunking is enabled for the trunk.
-
#sid ⇒ String
The unique string that we created to identify the Trunk resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
- #transfer_caller_id ⇒ TransferCallerId
- #transfer_mode ⇒ TransferSetting
-
#update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, transfer_mode: :unset, secure: :unset, cnam_lookup_enabled: :unset, transfer_caller_id: :unset) ⇒ TrunkInstance
Update the TrunkInstance.
-
#url ⇒ String
The absolute URL of the resource.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ TrunkInstance
Initialize the TrunkInstance
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 393 def initialize(version, payload , sid: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'domain_name' => payload['domain_name'], 'disaster_recovery_method' => payload['disaster_recovery_method'], 'disaster_recovery_url' => payload['disaster_recovery_url'], 'friendly_name' => payload['friendly_name'], 'secure' => payload['secure'], 'recording' => payload['recording'], 'transfer_mode' => payload['transfer_mode'], 'transfer_caller_id' => payload['transfer_caller_id'], 'cnam_lookup_enabled' => payload['cnam_lookup_enabled'], 'auth_type' => payload['auth_type'], 'auth_type_set' => payload['auth_type_set'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'sid' => payload['sid'], 'url' => payload['url'], 'links' => payload['links'], } # 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 Trunk resource.
435 436 437 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 435 def account_sid @properties['account_sid'] end |
#auth_type ⇒ String
Returns The types of authentication mapped to the domain. Can be: ‘IP_ACL` and `CREDENTIAL_LIST`. If both are mapped, the values are returned in a comma delimited list. If empty, the domain will not receive any traffic.
495 496 497 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 495 def auth_type @properties['auth_type'] end |
#auth_type_set ⇒ Array<String>
Returns Reserved.
501 502 503 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 501 def auth_type_set @properties['auth_type_set'] end |
#cnam_lookup_enabled ⇒ Boolean
Returns Whether Caller ID Name (CNAM) lookup is 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](www.twilio.com/docs/sip-trunking#CNAM) for more information.
489 490 491 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 489 def cnam_lookup_enabled @properties['cnam_lookup_enabled'] end |
#context ⇒ TrunkContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
426 427 428 429 430 431 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 426 def context unless @instance_context @instance_context = TrunkContext.new(@version , @params['sid']) end @instance_context end |
#credentials_lists ⇒ credentials_lists
Access the credentials_lists
595 596 597 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 595 def credentials_lists context.credentials_lists end |
#date_created ⇒ Time
Returns The date and time in GMT when the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
507 508 509 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 507 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date and time in GMT when the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.
513 514 515 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 513 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the TrunkInstance
538 539 540 541 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 538 def delete context.delete end |
#disaster_recovery_method ⇒ String
Returns The HTTP method we use to call the ‘disaster_recovery_url`. Can be: `GET` or `POST`.
447 448 449 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 447 def disaster_recovery_method @properties['disaster_recovery_method'] end |
#disaster_recovery_url ⇒ String
Returns The URL we call using the ‘disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from this URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](www.twilio.com/docs/sip-trunking#disaster-recovery) for more information.
453 454 455 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 453 def disaster_recovery_url @properties['disaster_recovery_url'] end |
#domain_name ⇒ String
Returns 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](www.twilio.com/docs/sip-trunking#termination) for more information.
441 442 443 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 441 def domain_name @properties['domain_name'] end |
#fetch ⇒ TrunkInstance
Fetch the TrunkInstance
546 547 548 549 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 546 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
459 460 461 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 459 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
629 630 631 632 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 629 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trunking.V1.TrunkInstance #{values}>" end |
#ip_access_control_lists ⇒ ip_access_control_lists
Access the ip_access_control_lists
602 603 604 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 602 def ip_access_control_lists context.ip_access_control_lists end |
#links ⇒ Hash
Returns The URLs of related resources.
531 532 533 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 531 def links @properties['links'] end |
#origination_urls ⇒ origination_urls
Access the origination_urls
616 617 618 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 616 def origination_urls context.origination_urls end |
#phone_numbers ⇒ phone_numbers
Access the phone_numbers
609 610 611 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 609 def phone_numbers context.phone_numbers end |
#recording ⇒ Hash
Returns The recording settings for the trunk. Can be: ‘do-not-record`, `record-from-ringing`, `record-from-answer`. If set to `record-from-ringing` or `record-from-answer`, all calls going through the trunk will be recorded. The only way to change recording parameters is on a sub-resource of a Trunk after it has been created. e.g.‘/Trunks//Recording -XPOST -d’Mode=record-from-answer’‘. See [Recording](www.twilio.com/docs/sip-trunking#recording) for more information.
471 472 473 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 471 def recording @properties['recording'] end |
#recordings ⇒ recordings
Access the recordings
588 589 590 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 588 def recordings context.recordings end |
#secure ⇒ Boolean
Returns 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](www.twilio.com/docs/sip-trunking#securetrunking) for more information.
465 466 467 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 465 def secure @properties['secure'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Trunk resource.
519 520 521 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 519 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
622 623 624 625 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 622 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trunking.V1.TrunkInstance #{values}>" end |
#transfer_caller_id ⇒ TransferCallerId
483 484 485 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 483 def transfer_caller_id @properties['transfer_caller_id'] end |
#transfer_mode ⇒ TransferSetting
477 478 479 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 477 def transfer_mode @properties['transfer_mode'] end |
#update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, transfer_mode: :unset, secure: :unset, cnam_lookup_enabled: :unset, transfer_caller_id: :unset) ⇒ TrunkInstance
Update the TrunkInstance
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 562 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, transfer_caller_id: :unset ) context.update( friendly_name: friendly_name, domain_name: domain_name, disaster_recovery_url: disaster_recovery_url, disaster_recovery_method: disaster_recovery_method, transfer_mode: transfer_mode, secure: secure, cnam_lookup_enabled: cnam_lookup_enabled, transfer_caller_id: transfer_caller_id, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
525 526 527 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 525 def url @properties['url'] end |