Class: Twilio::REST::Trunking::V1::TrunkInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the TrunkInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The sid



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 328

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

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'domain_name' => payload['domain_name'],
      'disaster_recovery_method' => payload['disaster_recovery_method'],
      'disaster_recovery_url' => payload['disaster_recovery_url'],
      'friendly_name' => payload['friendly_name'],
      'secure' => payload['secure'],
      'recording' => payload['recording'],
      'auth_type' => payload['auth_type'],
      'auth_type_set' => payload['auth_type_set'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'sid' => payload['sid'],
      'url' => payload['url'],
      'links' => payload['links'],
  }

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

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid



367
368
369
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 367

def 
  @properties['account_sid']
end

#auth_typeString

Returns The auth_type.

Returns:

  • (String)

    The auth_type



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

def auth_type
  @properties['auth_type']
end

#auth_type_setString

Returns The auth_type_set.

Returns:

  • (String)

    The auth_type_set



415
416
417
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 415

def auth_type_set
  @properties['auth_type_set']
end

#contextTrunkContext

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

Returns:



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

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

#credentials_listscredentials_lists

Access the credentials_lists

Returns:



493
494
495
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 493

def credentials_lists
  context.credentials_lists
end

#date_createdTime

Returns The date_created.

Returns:

  • (Time)

    The date_created



421
422
423
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 421

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date_updated.

Returns:

  • (Time)

    The date_updated



427
428
429
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 427

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the TrunkInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



459
460
461
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 459

def delete
  context.delete
end

#disaster_recovery_methodString

Returns The disaster_recovery_method.

Returns:

  • (String)

    The disaster_recovery_method



379
380
381
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 379

def disaster_recovery_method
  @properties['disaster_recovery_method']
end

#disaster_recovery_urlString

Returns The disaster_recovery_url.

Returns:

  • (String)

    The disaster_recovery_url



385
386
387
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 385

def disaster_recovery_url
  @properties['disaster_recovery_url']
end

#domain_nameString

Returns The domain_name.

Returns:

  • (String)

    The domain_name



373
374
375
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 373

def domain_name
  @properties['domain_name']
end

#fetchTrunkInstance

Fetch a TrunkInstance

Returns:



452
453
454
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 452

def fetch
  context.fetch
end

#friendly_nameString

Returns The friendly_name.

Returns:

  • (String)

    The friendly_name



391
392
393
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 391

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



520
521
522
523
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 520

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

#ip_access_control_listsip_access_control_lists

Access the ip_access_control_lists

Returns:



500
501
502
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 500

def ip_access_control_lists
  context.ip_access_control_lists
end

Returns The links.

Returns:

  • (String)

    The links



445
446
447
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 445

def links
  @properties['links']
end

#origination_urlsorigination_urls

Access the origination_urls

Returns:



486
487
488
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 486

def origination_urls
  context.origination_urls
end

#phone_numbersphone_numbers

Access the phone_numbers

Returns:



507
508
509
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 507

def phone_numbers
  context.phone_numbers
end

#recordingHash

Returns The recording.

Returns:

  • (Hash)

    The recording



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

def recording
  @properties['recording']
end

#secureBoolean

Returns The secure.

Returns:

  • (Boolean)

    The secure



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

def secure
  @properties['secure']
end

#sidString

Returns The sid.

Returns:

  • (String)

    The sid



433
434
435
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 433

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



513
514
515
516
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 513

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

#update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset) ⇒ TrunkInstance

Update the TrunkInstance

Parameters:

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

    The friendly_name

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

    The domain_name

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

    The disaster_recovery_url

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

    The disaster_recovery_method

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

    The recording

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

    The secure

Returns:



472
473
474
475
476
477
478
479
480
481
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 472

def update(friendly_name: :unset, domain_name: :unset, disaster_recovery_url: :unset, disaster_recovery_method: :unset, recording: :unset, secure: :unset)
  context.update(
      friendly_name: friendly_name,
      domain_name: domain_name,
      disaster_recovery_url: disaster_recovery_url,
      disaster_recovery_method: disaster_recovery_method,
      recording: recording,
      secure: secure,
  )
end

#urlString

Returns The url.

Returns:

  • (String)

    The url



439
440
441
# File 'lib/twilio-ruby/rest/trunking/v1/trunk.rb', line 439

def url
  @properties['url']
end