class Twilio::REST::Api::V2010::AccountContext::SipList::DomainContext

Public Class Methods

new(version, account_sid, sid) click to toggle source

Initialize the DomainContext @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the
SipDomain resource to fetch.

@param [String] sid The Twilio-provided string that uniquely identifies the

SipDomain resource to fetch.

@return [DomainContext] DomainContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
211 def initialize(version, account_sid, sid)
212   super(version)
213 
214   # Path Solution
215   @solution = {account_sid: account_sid, sid: sid, }
216   @uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:sid]}.json"
217 
218   # Dependents
219   @ip_access_control_list_mappings = nil
220   @credential_list_mappings = nil
221   @auth = nil
222 end

Public Instance Methods

auth() click to toggle source

Access the auth @return [AuthTypesList] @return [AuthTypesContext]

    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
348 def auth
349   unless @auth
350     @auth = AuthTypesList.new(
351         @version,
352         account_sid: @solution[:account_sid],
353         domain_sid: @solution[:sid],
354     )
355   end
356 
357   @auth
358 end
credential_list_mappings(sid=:unset) click to toggle source

Access the credential_list_mappings @return [CredentialListMappingList] @return [CredentialListMappingContext] if sid was passed.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
326 def credential_list_mappings(sid=:unset)
327   raise ArgumentError, 'sid cannot be nil' if sid.nil?
328 
329   if sid != :unset
330     return CredentialListMappingContext.new(@version, @solution[:account_sid], @solution[:sid], sid, )
331   end
332 
333   unless @credential_list_mappings
334     @credential_list_mappings = CredentialListMappingList.new(
335         @version,
336         account_sid: @solution[:account_sid],
337         domain_sid: @solution[:sid],
338     )
339   end
340 
341   @credential_list_mappings
342 end
delete() click to toggle source

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

    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
291 def delete
292    @version.delete('DELETE', @uri)
293 end
fetch() click to toggle source

Fetch the DomainInstance @return [DomainInstance] Fetched DomainInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
227 def fetch
228   payload = @version.fetch('GET', @uri)
229 
230   DomainInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
231 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
369 def inspect
370   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
371   "#<Twilio.Api.V2010.DomainContext #{context}>"
372 end
ip_access_control_list_mappings(sid=:unset) click to toggle source

Access the ip_access_control_list_mappings @return [IpAccessControlListMappingList] @return [IpAccessControlListMappingContext] if sid was passed.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
299 def ip_access_control_list_mappings(sid=:unset)
300   raise ArgumentError, 'sid cannot be nil' if sid.nil?
301 
302   if sid != :unset
303     return IpAccessControlListMappingContext.new(
304         @version,
305         @solution[:account_sid],
306         @solution[:sid],
307         sid,
308     )
309   end
310 
311   unless @ip_access_control_list_mappings
312     @ip_access_control_list_mappings = IpAccessControlListMappingList.new(
313         @version,
314         account_sid: @solution[:account_sid],
315         domain_sid: @solution[:sid],
316     )
317   end
318 
319   @ip_access_control_list_mappings
320 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb
362 def to_s
363   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
364   "#<Twilio.Api.V2010.DomainContext #{context}>"
365 end
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) click to toggle source

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
266 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)
267   data = Twilio::Values.of({
268       'FriendlyName' => friendly_name,
269       'VoiceFallbackMethod' => voice_fallback_method,
270       'VoiceFallbackUrl' => voice_fallback_url,
271       'VoiceMethod' => voice_method,
272       'VoiceStatusCallbackMethod' => voice_status_callback_method,
273       'VoiceStatusCallbackUrl' => voice_status_callback_url,
274       'VoiceUrl' => voice_url,
275       'SipRegistration' => sip_registration,
276       'DomainName' => domain_name,
277       'EmergencyCallingEnabled' => emergency_calling_enabled,
278       'Secure' => secure,
279       'ByocTrunkSid' => byoc_trunk_sid,
280       'EmergencyCallerSid' => emergency_caller_sid,
281   })
282 
283   payload = @version.update('POST', @uri, data: data)
284 
285   DomainInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
286 end