class Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext::CredentialContext
Public Class Methods
Initialize the CredentialContext
@param [Version] version Version
that contains the resource @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 contains the desired credential.
@param [String] sid The unique id that identifies the resource to fetch. @return [CredentialContext] CredentialContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb 186 def initialize(version, account_sid, credential_list_sid, sid) 187 super(version) 188 189 # Path Solution 190 @solution = {account_sid: account_sid, credential_list_sid: credential_list_sid, sid: sid, } 191 @uri = "/Accounts/#{@solution[:account_sid]}/SIP/CredentialLists/#{@solution[:credential_list_sid]}/Credentials/#{@solution[:sid]}.json" 192 end
Public Instance Methods
Delete the CredentialInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb 232 def delete 233 @version.delete('DELETE', @uri) 234 end
Fetch the CredentialInstance
@return [CredentialInstance] Fetched CredentialInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb 197 def fetch 198 payload = @version.fetch('GET', @uri) 199 200 CredentialInstance.new( 201 @version, 202 payload, 203 account_sid: @solution[:account_sid], 204 credential_list_sid: @solution[:credential_list_sid], 205 sid: @solution[:sid], 206 ) 207 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb 245 def inspect 246 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 247 "#<Twilio.Api.V2010.CredentialContext #{context}>" 248 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb 238 def to_s 239 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 240 "#<Twilio.Api.V2010.CredentialContext #{context}>" 241 end
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 215 def update(password: :unset) 216 data = Twilio::Values.of({'Password' => password, }) 217 218 payload = @version.update('POST', @uri, data: data) 219 220 CredentialInstance.new( 221 @version, 222 payload, 223 account_sid: @solution[:account_sid], 224 credential_list_sid: @solution[:credential_list_sid], 225 sid: @solution[:sid], 226 ) 227 end