Class: Twilio::REST::Voice::V1::ByocTrunkInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ByocTrunkInstance

Initialize the ByocTrunkInstance



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 293

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'sid' => payload['sid'],
      'friendly_name' => payload['friendly_name'],
      'voice_url' => payload['voice_url'],
      'voice_method' => payload['voice_method'],
      'voice_fallback_url' => payload['voice_fallback_url'],
      'voice_fallback_method' => payload['voice_fallback_method'],
      'status_callback_url' => payload['status_callback_url'],
      'status_callback_method' => payload['status_callback_method'],
      'cnam_lookup_enabled' => payload['cnam_lookup_enabled'],
      'connection_policy_sid' => payload['connection_policy_sid'],
      'from_domain_sid' => payload['from_domain_sid'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'url' => payload['url'],
  }

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

Instance Method Details

#account_sidString



333
334
335
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 333

def 
  @properties['account_sid']
end

#cnam_lookup_enabledBoolean



387
388
389
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 387

def cnam_lookup_enabled
  @properties['cnam_lookup_enabled']
end

#connection_policy_sidString



393
394
395
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 393

def connection_policy_sid
  @properties['connection_policy_sid']
end

#contextByocTrunkContext

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



324
325
326
327
328
329
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 324

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

#date_createdTime



405
406
407
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 405

def date_created
  @properties['date_created']
end

#date_updatedTime



411
412
413
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 411

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the ByocTrunkInstance



475
476
477
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 475

def delete
  context.delete
end

#fetchByocTrunkInstance

Fetch the ByocTrunkInstance



424
425
426
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 424

def fetch
  context.fetch
end

#friendly_nameString



345
346
347
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 345

def friendly_name
  @properties['friendly_name']
end

#from_domain_sidString



399
400
401
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 399

def from_domain_sid
  @properties['from_domain_sid']
end

#inspectObject

Provide a detailed, user friendly representation



488
489
490
491
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 488

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

#sidString



339
340
341
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 339

def sid
  @properties['sid']
end

#status_callback_methodString



381
382
383
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 381

def status_callback_method
  @properties['status_callback_method']
end

#status_callback_urlString



375
376
377
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 375

def status_callback_url
  @properties['status_callback_url']
end

#to_sObject

Provide a user friendly representation



481
482
483
484
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 481

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

#update(friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset) ⇒ ByocTrunkInstance

Update the ByocTrunkInstance



457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 457

def update(friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset)
  context.update(
      friendly_name: friendly_name,
      voice_url: voice_url,
      voice_method: voice_method,
      voice_fallback_url: voice_fallback_url,
      voice_fallback_method: voice_fallback_method,
      status_callback_url: status_callback_url,
      status_callback_method: status_callback_method,
      cnam_lookup_enabled: cnam_lookup_enabled,
      connection_policy_sid: connection_policy_sid,
      from_domain_sid: from_domain_sid,
  )
end

#urlString



417
418
419
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 417

def url
  @properties['url']
end

#voice_fallback_methodString



369
370
371
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 369

def voice_fallback_method
  @properties['voice_fallback_method']
end

#voice_fallback_urlString



363
364
365
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 363

def voice_fallback_url
  @properties['voice_fallback_url']
end

#voice_methodString



357
358
359
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 357

def voice_method
  @properties['voice_method']
end

#voice_urlString



351
352
353
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 351

def voice_url
  @properties['voice_url']
end