class Twilio::REST::Api::V2010::AccountContext::SipList::DomainInstance
Public Class Methods
Initialize the DomainInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] account_sid
A 34 character string that uniquely identifies this
resource.
@param [String] sid The Twilio-provided string that uniquely identifies the
SipDomain resource to fetch.
@return [DomainInstance] DomainInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 385 def initialize(version, payload, account_sid: nil, sid: nil) 386 super(version) 387 388 # Marshaled Properties 389 @properties = { 390 'account_sid' => payload['account_sid'], 391 'api_version' => payload['api_version'], 392 'auth_type' => payload['auth_type'], 393 'date_created' => Twilio.deserialize_rfc2822(payload['date_created']), 394 'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']), 395 'domain_name' => payload['domain_name'], 396 'friendly_name' => payload['friendly_name'], 397 'sid' => payload['sid'], 398 'uri' => payload['uri'], 399 'voice_fallback_method' => payload['voice_fallback_method'], 400 'voice_fallback_url' => payload['voice_fallback_url'], 401 'voice_method' => payload['voice_method'], 402 'voice_status_callback_method' => payload['voice_status_callback_method'], 403 'voice_status_callback_url' => payload['voice_status_callback_url'], 404 'voice_url' => payload['voice_url'], 405 'subresource_uris' => payload['subresource_uris'], 406 'sip_registration' => payload['sip_registration'], 407 'emergency_calling_enabled' => payload['emergency_calling_enabled'], 408 'secure' => payload['secure'], 409 'byoc_trunk_sid' => payload['byoc_trunk_sid'], 410 'emergency_caller_sid' => payload['emergency_caller_sid'], 411 } 412 413 # Context 414 @instance_context = nil 415 @params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], } 416 end
Public Instance Methods
@return [String] The SID of the Account that created the resource
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 431 def account_sid 432 @properties['account_sid'] 433 end
@return [String] The API version used to process the call
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 437 def api_version 438 @properties['api_version'] 439 end
Access the auth @return [auth] auth
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 637 def auth 638 context.auth 639 end
@return [String] The types of authentication mapped to the domain
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 443 def auth_type 444 @properties['auth_type'] 445 end
@return [String] The SID of the BYOC Trunk resource.
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 545 def byoc_trunk_sid 546 @properties['byoc_trunk_sid'] 547 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 [DomainContext] DomainContext
for this DomainInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 422 def context 423 unless @instance_context 424 @instance_context = DomainContext.new(@version, @params['account_sid'], @params['sid'], ) 425 end 426 @instance_context 427 end
Access the credential_list_mappings
@return [credential_list_mappings] credential_list_mappings
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 630 def credential_list_mappings 631 context.credential_list_mappings 632 end
@return [Time] The RFC 2822 date and time in GMT that the resource was created
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 449 def date_created 450 @properties['date_created'] 451 end
@return [Time] The RFC 2822 date and time in GMT that the resource was last updated
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 455 def date_updated 456 @properties['date_updated'] 457 end
Delete the DomainInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 616 def delete 617 context.delete 618 end
@return [String] The unique address on Twilio
to route SIP traffic
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 461 def domain_name 462 @properties['domain_name'] 463 end
@return [String] Whether an emergency caller sid is configured for the domain.
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 551 def emergency_caller_sid 552 @properties['emergency_caller_sid'] 553 end
@return [Boolean] Whether emergency calling is enabled for the domain.
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 533 def emergency_calling_enabled 534 @properties['emergency_calling_enabled'] 535 end
Fetch the DomainInstance
@return [DomainInstance] Fetched DomainInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 558 def fetch 559 context.fetch 560 end
@return [String] The string that you assigned to describe the resource
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 467 def friendly_name 468 @properties['friendly_name'] 469 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 650 def inspect 651 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 652 "<Twilio.Api.V2010.DomainInstance #{values}>" 653 end
Access the ip_access_control_list_mappings
@return [ip_access_control_list_mappings] ip_access_control_list_mappings
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 623 def ip_access_control_list_mappings 624 context.ip_access_control_list_mappings 625 end
@return [Boolean] Whether secure SIP is enabled for the domain
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 539 def secure 540 @properties['secure'] 541 end
@return [String] The unique string that identifies the resource
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 473 def sid 474 @properties['sid'] 475 end
@return [Boolean] Whether SIP registration is allowed
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 527 def sip_registration 528 @properties['sip_registration'] 529 end
@return [String] A list mapping resources associated with the SIP Domain
resource
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 521 def subresource_uris 522 @properties['subresource_uris'] 523 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 643 def to_s 644 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 645 "<Twilio.Api.V2010.DomainInstance #{values}>" 646 end
Update the DomainInstance
@param [String] friendly_name
A descriptive string that you created to describe
the resource. It can be up to 64 characters long.
@param [String] voice_fallback_method
The HTTP
method we should use to call
`voice_fallback_url`. Can be: `GET` or `POST`.
@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_method
The HTTP
method we should use to call `voice_url` @param [String] voice_status_callback_method
The HTTP
method we should use to
call `voice_status_callback_url`. Can be: `GET` or `POST`.
@param [String] voice_status_callback_url
The URL that we should call to pass
status parameters (such as call ended) to your application.
@param [String] voice_url
The URL we should call when the domain receives a
call.
@param [Boolean] sip_registration
Whether to allow SIP Endpoints to register
with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not.
@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 `sip.twilio.com`.
@param [Boolean] emergency_calling_enabled
Whether emergency calling is enabled
for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.
@param [Boolean] secure Whether secure SIP is enabled for the domain. If
enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain.
@param [String] byoc_trunk_sid
The SID of the BYOC Trunk(Bring Your Own Carrier)
resource that the Sip Domain will be associated with.
@param [String] emergency_caller_sid
Whether an emergency caller sid is
configured for the domain. If present, this phone number will be used as the callback for the emergency call.
@return [DomainInstance] Updated DomainInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 595 def update(friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset, byoc_trunk_sid: :unset, emergency_caller_sid: :unset) 596 context.update( 597 friendly_name: friendly_name, 598 voice_fallback_method: voice_fallback_method, 599 voice_fallback_url: voice_fallback_url, 600 voice_method: voice_method, 601 voice_status_callback_method: voice_status_callback_method, 602 voice_status_callback_url: voice_status_callback_url, 603 voice_url: voice_url, 604 sip_registration: sip_registration, 605 domain_name: domain_name, 606 emergency_calling_enabled: emergency_calling_enabled, 607 secure: secure, 608 byoc_trunk_sid: byoc_trunk_sid, 609 emergency_caller_sid: emergency_caller_sid, 610 ) 611 end
@return [String] The URI of the resource, relative to `api.twilio.com`
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 479 def uri 480 @properties['uri'] 481 end
@return [String] The HTTP
method used with voice_fallback_url
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 485 def voice_fallback_method 486 @properties['voice_fallback_method'] 487 end
@return [String] The URL we call when an error occurs while executing TwiML
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 491 def voice_fallback_url 492 @properties['voice_fallback_url'] 493 end
@return [String] The HTTP
method we use to call voice_status_callback_url
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 503 def voice_status_callback_method 504 @properties['voice_status_callback_method'] 505 end
@return [String] The URL that we call with status updates
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 509 def voice_status_callback_url 510 @properties['voice_status_callback_url'] 511 end
@return [String] The URL we call when receiving a call
# File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb 515 def voice_url 516 @properties['voice_url'] 517 end