class Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext::CredentialInstance

Public Class Methods

new(version, payload, account_sid: nil, credential_list_sid: nil, sid: nil) click to toggle source

Initialize the CredentialInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] account_sid The unique id of the Account that is responsible for

this resource.

@param [String] credential_list_sid The unique id that identifies the credential

list that includes this credential.

@param [String] sid The unique id that identifies the resource to fetch. @return [CredentialInstance] CredentialInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
262 def initialize(version, payload, account_sid: nil, credential_list_sid: nil, sid: nil)
263   super(version)
264 
265   # Marshaled Properties
266   @properties = {
267       'sid' => payload['sid'],
268       'account_sid' => payload['account_sid'],
269       'credential_list_sid' => payload['credential_list_sid'],
270       'username' => payload['username'],
271       'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
272       'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
273       'uri' => payload['uri'],
274   }
275 
276   # Context
277   @instance_context = nil
278   @params = {
279       'account_sid' => account_sid,
280       'credential_list_sid' => credential_list_sid,
281       'sid' => sid || @properties['sid'],
282   }
283 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The unique id of the Account that is responsible for this resource.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
309 def account_sid
310   @properties['account_sid']
311 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CredentialContext] CredentialContext for this CredentialInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
289 def context
290   unless @instance_context
291     @instance_context = CredentialContext.new(
292         @version,
293         @params['account_sid'],
294         @params['credential_list_sid'],
295         @params['sid'],
296     )
297   end
298   @instance_context
299 end
credential_list_sid() click to toggle source

@return [String] The unique id that identifies the credential list that includes this credential

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
315 def credential_list_sid
316   @properties['credential_list_sid']
317 end
date_created() click to toggle source

@return [Time] The date that this resource was created, given as GMT in RFC 2822 format.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
327 def date_created
328   @properties['date_created']
329 end
date_updated() click to toggle source

@return [Time] The date that this resource was last updated, given as GMT in RFC 2822 format.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
333 def date_updated
334   @properties['date_updated']
335 end
delete() click to toggle source

Delete the CredentialInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
363 def delete
364   context.delete
365 end
fetch() click to toggle source

Fetch the CredentialInstance @return [CredentialInstance] Fetched CredentialInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
346 def fetch
347   context.fetch
348 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
376 def inspect
377   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
378   "<Twilio.Api.V2010.CredentialInstance #{values}>"
379 end
sid() click to toggle source

@return [String] A 34 character string that uniquely identifies this resource.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
303 def sid
304   @properties['sid']
305 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
369 def to_s
370   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
371   "<Twilio.Api.V2010.CredentialInstance #{values}>"
372 end
update(password: :unset) click to toggle source

Update the CredentialInstance @param [String] password The password that the username will use when

authenticating SIP requests. The password must be a minimum of 12 characters,
contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`)

@return [CredentialInstance] Updated CredentialInstance

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
356 def update(password: :unset)
357   context.update(password: password, )
358 end
uri() click to toggle source

@return [String] The URI for this resource, relative to api.twilio.com

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
339 def uri
340   @properties['uri']
341 end
username() click to toggle source

@return [String] The username for this credential.

    # File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
321 def username
322   @properties['username']
323 end