Class: Twilio::REST::Api::V2010::AccountContext::SipList::DomainInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, account_sid: nil, sid: nil) ⇒ DomainInstance

Initialize the DomainInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    The SID of the Account that created this Domain resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



387
388
389
390
391
392
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/api/v2010/account/sip/domain.rb', line 387

def initialize(version, payload , account_sid: nil, sid: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'account_sid' => payload['account_sid'],
        'api_version' => payload['api_version'],
        'auth_type' => payload['auth_type'],
        'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
        'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
        'domain_name' => payload['domain_name'],
        'friendly_name' => payload['friendly_name'],
        'sid' => payload['sid'],
        'uri' => payload['uri'],
        'voice_fallback_method' => payload['voice_fallback_method'],
        'voice_fallback_url' => payload['voice_fallback_url'],
        'voice_method' => payload['voice_method'],
        'voice_status_callback_method' => payload['voice_status_callback_method'],
        'voice_status_callback_url' => payload['voice_status_callback_url'],
        'voice_url' => payload['voice_url'],
        'subresource_uris' => payload['subresource_uris'],
        'sip_registration' => payload['sip_registration'],
        'emergency_calling_enabled' => payload['emergency_calling_enabled'],
        'secure' => payload['secure'],
        'byoc_trunk_sid' => payload['byoc_trunk_sid'],
        'emergency_caller_sid' => payload['emergency_caller_sid'],
    }

    # Context
    @instance_context = nil
    @params = { 'account_sid' =>   ,'sid' => sid  || @properties['sid']  , }
end

Instance Method Details

#account_sidString

Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the SipDomain resource.

Returns:



433
434
435
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 433

def 
    @properties['account_sid']
end

#api_versionString

Returns The API version used to process the call.

Returns:

  • (String)

    The API version used to process the call.



439
440
441
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 439

def api_version
    @properties['api_version']
end

#authauth

Access the auth

Returns:



625
626
627
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 625

def auth
    context.auth
end

#auth_typeString

Returns The types of authentication you have mapped to your domain. Can be: ‘IP_ACL` and `CREDENTIAL_LIST`. If you have both defined for your domain, both will be returned in a comma delimited string. If `auth_type` is not defined, the domain will not be able to receive any traffic.

Returns:

  • (String)

    The types of authentication you have mapped to your domain. Can be: ‘IP_ACL` and `CREDENTIAL_LIST`. If you have both defined for your domain, both will be returned in a comma delimited string. If `auth_type` is not defined, the domain will not be able to receive any traffic.



445
446
447
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 445

def auth_type
    @properties['auth_type']
end

#byoc_trunk_sidString

Returns The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

Returns:

  • (String)

    The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.



547
548
549
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 547

def byoc_trunk_sid
    @properties['byoc_trunk_sid']
end

#contextDomainContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



424
425
426
427
428
429
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 424

def context
    unless @instance_context
        @instance_context = DomainContext.new(@version , @params['account_sid'], @params['sid'])
    end
    @instance_context
end

#credential_list_mappingscredential_list_mappings

Access the credential_list_mappings

Returns:



639
640
641
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 639

def credential_list_mappings
    context.credential_list_mappings
end

#date_createdTime

Returns The date and time in GMT that the resource was created specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



451
452
453
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 451

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date and time in GMT that the resource was last updated specified in [RFC 2822](www.ietf.org/rfc/rfc2822.txt) format.

Returns:



457
458
459
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 457

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the DomainInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



560
561
562
563
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 560

def delete

    context.delete
end

#domain_nameString

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 ‘sip.twilio.com`.

Returns:

  • (String)

    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`.



463
464
465
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 463

def domain_name
    @properties['domain_name']
end

#emergency_caller_sidString

Returns 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.

Returns:

  • (String)

    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.



553
554
555
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 553

def emergency_caller_sid
    @properties['emergency_caller_sid']
end

#emergency_calling_enabledBoolean

Returns Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.

Returns:

  • (Boolean)

    Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.



535
536
537
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 535

def emergency_calling_enabled
    @properties['emergency_calling_enabled']
end

#fetchDomainInstance

Fetch the DomainInstance

Returns:



568
569
570
571
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 568

def fetch

    context.fetch
end

#friendly_nameString

Returns The string that you assigned to describe the resource.

Returns:

  • (String)

    The string that you assigned to describe the resource.



469
470
471
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 469

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



652
653
654
655
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 652

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.DomainInstance #{values}>"
end

#ip_access_control_list_mappingsip_access_control_list_mappings

Access the ip_access_control_list_mappings

Returns:



632
633
634
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 632

def ip_access_control_list_mappings
    context.ip_access_control_list_mappings
end

#secureBoolean

Returns 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.

Returns:

  • (Boolean)

    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.



541
542
543
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 541

def secure
    @properties['secure']
end

#sidString

Returns The unique string that that we created to identify the SipDomain resource.

Returns:

  • (String)

    The unique string that that we created to identify the SipDomain resource.



475
476
477
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 475

def sid
    @properties['sid']
end

#sip_registrationBoolean

Returns Whether to allow SIP Endpoints to register with the domain to receive calls.

Returns:

  • (Boolean)

    Whether to allow SIP Endpoints to register with the domain to receive calls.



529
530
531
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 529

def sip_registration
    @properties['sip_registration']
end

#subresource_urisHash

Returns A list of mapping resources associated with the SIP Domain resource identified by their relative URIs.

Returns:

  • (Hash)

    A list of mapping resources associated with the SIP Domain resource identified by their relative URIs.



523
524
525
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 523

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



645
646
647
648
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 645

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Api.V2010.DomainInstance #{values}>"
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) ⇒ DomainInstance

Update the DomainInstance

Parameters:

  • friendly_name (String) (defaults to: :unset)

    A descriptive string that you created to describe the resource. It can be up to 64 characters long.

  • voice_fallback_method (String) (defaults to: :unset)

    The HTTP method we should use to call ‘voice_fallback_url`. Can be: `GET` or `POST`.

  • voice_fallback_url (String) (defaults to: :unset)

    The URL that we should call when an error occurs while retrieving or executing the TwiML requested by ‘voice_url`.

  • voice_method (String) (defaults to: :unset)

    The HTTP method we should use to call ‘voice_url`

  • voice_status_callback_method (String) (defaults to: :unset)

    The HTTP method we should use to call ‘voice_status_callback_url`. Can be: `GET` or `POST`.

  • voice_status_callback_url (String) (defaults to: :unset)

    The URL that we should call to pass status parameters (such as call ended) to your application.

  • voice_url (String) (defaults to: :unset)

    The URL we should call when the domain receives a call.

  • sip_registration (Boolean) (defaults to: :unset)

    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.

  • domain_name (String) (defaults to: :unset)

    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`.

  • emergency_calling_enabled (Boolean) (defaults to: :unset)

    Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses.

  • secure (Boolean) (defaults to: :unset)

    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.

  • byoc_trunk_sid (String) (defaults to: :unset)

    The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with.

  • emergency_caller_sid (String) (defaults to: :unset)

    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.

Returns:



589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 589

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
)

    context.update(
        friendly_name: friendly_name, 
        voice_fallback_method: voice_fallback_method, 
        voice_fallback_url: voice_fallback_url, 
        voice_method: voice_method, 
        voice_status_callback_method: voice_status_callback_method, 
        voice_status_callback_url: voice_status_callback_url, 
        voice_url: voice_url, 
        sip_registration: sip_registration, 
        domain_name: domain_name, 
        emergency_calling_enabled: emergency_calling_enabled, 
        secure: secure, 
        byoc_trunk_sid: byoc_trunk_sid, 
        emergency_caller_sid: emergency_caller_sid, 
    )
end

#uriString

Returns The URI of the resource, relative to ‘api.twilio.com`.

Returns:

  • (String)

    The URI of the resource, relative to ‘api.twilio.com`.



481
482
483
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 481

def uri
    @properties['uri']
end

#voice_fallback_methodString

Returns The HTTP method we use to call ‘voice_fallback_url`. Can be: `GET` or `POST`.

Returns:

  • (String)

    The HTTP method we use to call ‘voice_fallback_url`. Can be: `GET` or `POST`.



487
488
489
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 487

def voice_fallback_method
    @properties['voice_fallback_method']
end

#voice_fallback_urlString

Returns The URL that we call when an error occurs while retrieving or executing the TwiML requested from ‘voice_url`.

Returns:

  • (String)

    The URL that we call when an error occurs while retrieving or executing the TwiML requested from ‘voice_url`.



493
494
495
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 493

def voice_fallback_url
    @properties['voice_fallback_url']
end

#voice_methodString

Returns The HTTP method we use to call ‘voice_url`. Can be: `GET` or `POST`.

Returns:

  • (String)

    The HTTP method we use to call ‘voice_url`. Can be: `GET` or `POST`.



499
500
501
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 499

def voice_method
    @properties['voice_method']
end

#voice_status_callback_methodString

Returns The HTTP method we use to call ‘voice_status_callback_url`. Either `GET` or `POST`.

Returns:

  • (String)

    The HTTP method we use to call ‘voice_status_callback_url`. Either `GET` or `POST`.



505
506
507
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 505

def voice_status_callback_method
    @properties['voice_status_callback_method']
end

#voice_status_callback_urlString

Returns The URL that we call to pass status parameters (such as call ended) to your application.

Returns:

  • (String)

    The URL that we call to pass status parameters (such as call ended) to your application.



511
512
513
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 511

def voice_status_callback_url
    @properties['voice_status_callback_url']
end

#voice_urlString

Returns The URL we call using the ‘voice_method` when the domain receives a call.

Returns:

  • (String)

    The URL we call using the ‘voice_method` when the domain receives a call.



517
518
519
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 517

def voice_url
    @properties['voice_url']
end