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



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 291

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



323
324
325
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 323

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



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

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

#credentialscredentials

Access the credentials



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

def credentials
    context.credentials
end

#date_createdTime



329
330
331
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 329

def date_created
    @properties['date_created']
end

#date_updatedTime



335
336
337
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 335

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the CredentialListInstance



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

def delete

    context.delete
end

#fetchCredentialListInstance

Fetch the CredentialListInstance



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

def fetch

    context.fetch
end

#friendly_nameString



341
342
343
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 341

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



408
409
410
411
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 408

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

#sidString



347
348
349
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 347

def sid
    @properties['sid']
end

#subresource_urisHash



353
354
355
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 353

def subresource_uris
    @properties['subresource_uris']
end

#to_sObject

Provide a user friendly representation



401
402
403
404
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb', line 401

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



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

def update(
    friendly_name: nil
)

    context.update(
        friendly_name: friendly_name, 
    )
end

#uriString



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

def uri
    @properties['uri']
end