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 that created the resource.
-
#auth_type ⇒ String
The types of authentication mapped to the domain.
-
#auth_type_set ⇒ 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 RFC 2822 date and time in GMT when the resource was created.
-
#date_updated ⇒ Time
The RFC 2822 date and time in GMT when the resource was last updated.
-
#delete ⇒ Boolean
Deletes the TrunkInstance.
-
#disaster_recovery_method ⇒ String
The HTTP method we use to call the disaster_recovery_url.
-
#disaster_recovery_url ⇒ String
The HTTP URL that we call if an error occurs while sending SIP traffic towards your configured Origination URL.
-
#domain_name ⇒ String
The unique address you reserve on Twilio to which you route your SIP traffic.
-
#fetch ⇒ TrunkInstance
Fetch a 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 ⇒ String
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.
-
#secure ⇒ Boolean
Whether Secure Trunking is enabled for the trunk.
-
#sid ⇒ String
The unique string that identifies the resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset, cnam_lookup_enabled: :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 |
# 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'], '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 that created the resource.
433 434 435 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 433 def account_sid @properties['account_sid'] end |
#auth_type ⇒ String
Returns The types of authentication mapped to the domain.
481 482 483 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 481 def auth_type @properties['auth_type'] end |
#auth_type_set ⇒ String
Returns Reserved.
487 488 489 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 487 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.
475 476 477 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 475 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
424 425 426 427 428 429 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 424 def context unless @instance_context @instance_context = TrunkContext.new(@version, @params['sid'], ) end @instance_context end |
#credentials_lists ⇒ credentials_lists
Access the credentials_lists
591 592 593 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 591 def credentials_lists context.credentials_lists end |
#date_created ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was created.
493 494 495 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 493 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The RFC 2822 date and time in GMT when the resource was last updated.
499 500 501 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 499 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the TrunkInstance
531 532 533 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 531 def delete context.delete end |
#disaster_recovery_method ⇒ String
Returns The HTTP method we use to call the disaster_recovery_url.
445 446 447 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 445 def disaster_recovery_method @properties['disaster_recovery_method'] end |
#disaster_recovery_url ⇒ String
Returns The HTTP URL that we call if an error occurs while sending SIP traffic towards your configured Origination URL.
451 452 453 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 451 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.
439 440 441 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 439 def domain_name @properties['domain_name'] end |
#fetch ⇒ TrunkInstance
Fetch a TrunkInstance
524 525 526 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 524 def fetch context.fetch end |
#friendly_name ⇒ String
Returns The string that you assigned to describe the resource.
457 458 459 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 457 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
618 619 620 621 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 618 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
598 599 600 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 598 def ip_access_control_lists context.ip_access_control_lists end |
#links ⇒ String
Returns The URLs of related resources.
517 518 519 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 517 def links @properties['links'] end |
#origination_urls ⇒ origination_urls
Access the origination_urls
584 585 586 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 584 def origination_urls context.origination_urls end |
#phone_numbers ⇒ phone_numbers
Access the phone_numbers
605 606 607 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 605 def phone_numbers context.phone_numbers end |
#recording ⇒ Hash
Returns The recording settings for the trunk.
469 470 471 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 469 def recording @properties['recording'] end |
#secure ⇒ Boolean
Returns Whether Secure Trunking is enabled for the trunk.
463 464 465 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 463 def secure @properties['secure'] end |
#sid ⇒ String
Returns The unique string that identifies the resource.
505 506 507 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 505 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
611 612 613 614 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 611 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Trunking.V1.TrunkInstance #{values}>" end |
#update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset, cnam_lookup_enabled: :unset) ⇒ TrunkInstance
Update the TrunkInstance
569 570 571 572 573 574 575 576 577 578 579 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 569 def update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset, cnam_lookup_enabled: :unset) context.update( friendly_name: friendly_name, domain_name: domain_name, disaster_recovery_url: disaster_recovery_url, disaster_recovery_method: disaster_recovery_method, recording: recording, secure: secure, cnam_lookup_enabled: cnam_lookup_enabled, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
511 512 513 |
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 511 def url @properties['url'] end |