Class: Twilio::REST::Trunking::V1::TrunkContext::TerminatingSipDomainInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, trunk_sid: nil, sid: nil) ⇒ TerminatingSipDomainInstance

Initialize the TerminatingSipDomainInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • trunk_sid (String) (defaults to: nil)

    The SID of the Trunk to which we should route calls that arrive at the domain. If a ‘trunk_sid` is present, we ignore all of the voice URLs present and terminate calls through the specified trunk.

  • sid (String) (defaults to: nil)

    The unique string that we created to identify the TerminatingSipDomain resource to fetch.



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 237

def initialize(version, payload, trunk_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_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'domain_name' => payload['domain_name'],
      'friendly_name' => payload['friendly_name'],
      'sid' => payload['sid'],
      'url' => payload['url'],
      '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'],
      'sip_registration' => payload['sip_registration'],
      'trunk_sid' => payload['trunk_sid'],
      'links' => payload['links'],
  }

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

Instance Method Details

#account_sidString

Returns The SID of the Account that created the resource.

Returns:

  • (String)

    The SID of the Account that created the resource



280
281
282
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 280

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



286
287
288
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 286

def api_version
  @properties['api_version']
end

#auth_typeString

Returns The types of authentication mapped to the domain.

Returns:

  • (String)

    The types of authentication mapped to the domain



292
293
294
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 292

def auth_type
  @properties['auth_type']
end

#contextTerminatingSipDomainContext

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

Returns:



271
272
273
274
275
276
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 271

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

#date_createdTime

Returns The RFC 2822 date and time in GMT when the resource was created.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT when the resource was created



298
299
300
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 298

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The RFC 2822 date and time in GMT when the resource was last updated.

Returns:

  • (Time)

    The RFC 2822 date and time in GMT when the resource was last updated



304
305
306
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 304

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the TerminatingSipDomainInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



396
397
398
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 396

def delete
  context.delete
end

#domain_nameString

Returns The unique address you reserve on Twilio to which you route your SIP traffic.

Returns:

  • (String)

    The unique address you reserve on Twilio to which you route your SIP traffic



310
311
312
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 310

def domain_name
  @properties['domain_name']
end

#fetchTerminatingSipDomainInstance

Fetch a TerminatingSipDomainInstance

Returns:



389
390
391
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 389

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



316
317
318
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 316

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



409
410
411
412
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 409

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

Returns The URLs of related resources.

Returns:

  • (String)

    The URLs of related resources



382
383
384
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 382

def links
  @properties['links']
end

#sidString

Returns The unique string that identifies the resource.

Returns:

  • (String)

    The unique string that identifies the resource



322
323
324
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 322

def sid
  @properties['sid']
end

#sip_registrationBoolean

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

Returns:

  • (Boolean)

    Whether SIP Endpoints can register with the domain to receive calls



370
371
372
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 370

def sip_registration
  @properties['sip_registration']
end

#to_sObject

Provide a user friendly representation



402
403
404
405
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 402

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Trunking.V1.TerminatingSipDomainInstance #{values}>"
end

#trunk_sidString

Returns The SID of the Trunk to which we should route calls.

Returns:

  • (String)

    The SID of the Trunk to which we should route calls



376
377
378
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 376

def trunk_sid
  @properties['trunk_sid']
end

#urlString

Returns The absolute URL of the resource.

Returns:

  • (String)

    The absolute URL of the resource



328
329
330
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 328

def url
  @properties['url']
end

#voice_fallback_methodString

Returns The HTTP method used with voice_fallback_url.

Returns:

  • (String)

    The HTTP method used with voice_fallback_url



334
335
336
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 334

def voice_fallback_method
  @properties['voice_fallback_method']
end

#voice_fallback_urlString

Returns The URL that we call when an error occurs in executing TwiML.

Returns:

  • (String)

    The URL that we call when an error occurs in executing TwiML



340
341
342
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 340

def voice_fallback_url
  @properties['voice_fallback_url']
end

#voice_methodString

Returns The HTTP method used with voice_url.

Returns:

  • (String)

    The HTTP method used with voice_url



346
347
348
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 346

def voice_method
  @properties['voice_method']
end

#voice_status_callback_methodString

Returns The HTTP method that we use to call the voice_status_callback_url.

Returns:

  • (String)

    The HTTP method that we use to call the voice_status_callback_url



352
353
354
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 352

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 to your application.

Returns:

  • (String)

    The URL that we call to pass status parameters to your application



358
359
360
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 358

def voice_status_callback_url
  @properties['voice_status_callback_url']
end

#voice_urlString

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

Returns:

  • (String)

    The URL we call when the domain receives a call



364
365
366
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/terminating_sip_domain.rb', line 364

def voice_url
  @properties['voice_url']
end