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

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

Instance Method Summary collapse

Constructor Details

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

Initialize the CredentialListInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this resource.

  • sid (String) (defaults to: nil)

    The credential list Sid that uniquely identifies this resource



282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 282

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

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
      'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
      'friendly_name' => payload['friendly_name'],
      'sid' => payload['sid'],
      'subresource_uris' => payload['subresource_uris'],
      'uri' => payload['uri'],
  }

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

Instance Method Details

#account_sidString

Returns The unique sid that identifies this account.

Returns:

  • (String)

    The unique sid that identifies this account



314
315
316
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 314

def 
  @properties['account_sid']
end

#contextCredentialListContext

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

Returns:



305
306
307
308
309
310
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 305

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

#credentialscredentials

Access the credentials

Returns:



380
381
382
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 380

def credentials
  context.credentials
end

#date_createdTime

Returns The date this resource was created.

Returns:

  • (Time)

    The date this resource was created



320
321
322
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 320

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this resource was last updated.

Returns:

  • (Time)

    The date this resource was last updated



326
327
328
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 326

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the CredentialListInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



373
374
375
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 373

def delete
  context.delete
end

#fetchCredentialListInstance

Fetch a CredentialListInstance

Returns:



357
358
359
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 357

def fetch
  context.fetch
end

#friendly_nameString

Returns Human readable descriptive text.

Returns:

  • (String)

    Human readable descriptive text



332
333
334
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 332

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



393
394
395
396
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 393

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

#sidString

Returns A string that uniquely identifies this credential.

Returns:

  • (String)

    A string that uniquely identifies this credential



338
339
340
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 338

def sid
  @properties['sid']
end

#subresource_urisString

Returns The list of credentials associated with this credential list.

Returns:

  • (String)

    The list of credentials associated with this credential list.



344
345
346
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 344

def subresource_uris
  @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



386
387
388
389
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 386

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

#update(friendly_name: nil) ⇒ CredentialListInstance

Update the CredentialListInstance

Parameters:

  • friendly_name (String) (defaults to: nil)

    A human readable descriptive text for a CredentialList, up to 64 characters long.

Returns:



366
367
368
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 366

def update(friendly_name: nil)
  context.update(friendly_name: friendly_name, )
end

#uriString

Returns The URI for this resource.

Returns:

  • (String)

    The URI for this resource



350
351
352
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 350

def uri
  @properties['uri']
end