class Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext
Public Class Methods
Initialize the CredentialListContext
@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] sid The credential list Sid that uniquely identifies this
resource
@return [CredentialListContext] CredentialListContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb 168 def initialize(version, account_sid, sid) 169 super(version) 170 171 # Path Solution 172 @solution = {account_sid: account_sid, sid: sid, } 173 @uri = "/Accounts/#{@solution[:account_sid]}/SIP/CredentialLists/#{@solution[:sid]}.json" 174 175 # Dependents 176 @credentials = nil 177 end
Public Instance Methods
Access the credentials @return [CredentialList] @return [CredentialContext] if sid was passed.
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb 222 def credentials(sid=:unset) 223 raise ArgumentError, 'sid cannot be nil' if sid.nil? 224 225 if sid != :unset 226 return CredentialContext.new(@version, @solution[:account_sid], @solution[:sid], sid, ) 227 end 228 229 unless @credentials 230 @credentials = CredentialList.new( 231 @version, 232 account_sid: @solution[:account_sid], 233 credential_list_sid: @solution[:sid], 234 ) 235 end 236 237 @credentials 238 end
Delete the CredentialListInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb 214 def delete 215 @version.delete('DELETE', @uri) 216 end
Fetch the CredentialListInstance
@return [CredentialListInstance] Fetched CredentialListInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb 182 def fetch 183 payload = @version.fetch('GET', @uri) 184 185 CredentialListInstance.new( 186 @version, 187 payload, 188 account_sid: @solution[:account_sid], 189 sid: @solution[:sid], 190 ) 191 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb 249 def inspect 250 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 251 "#<Twilio.Api.V2010.CredentialListContext #{context}>" 252 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb 242 def to_s 243 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 244 "#<Twilio.Api.V2010.CredentialListContext #{context}>" 245 end
Update the CredentialListInstance
@param [String] friendly_name A human readable descriptive text for a
CredentialList, up to 64 characters long.
@return [CredentialListInstance] Updated CredentialListInstance
# File lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb 198 def update(friendly_name: nil) 199 data = Twilio::Values.of({'FriendlyName' => friendly_name, }) 200 201 payload = @version.update('POST', @uri, data: data) 202 203 CredentialListInstance.new( 204 @version, 205 payload, 206 account_sid: @solution[:account_sid], 207 sid: @solution[:sid], 208 ) 209 end