Class: Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext::CredentialContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::SipList::CredentialListContext::CredentialContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CredentialInstance.
-
#fetch ⇒ CredentialInstance
Fetch the CredentialInstance.
-
#initialize(version, account_sid, credential_list_sid, sid) ⇒ CredentialContext
constructor
Initialize the CredentialContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(password: :unset) ⇒ CredentialInstance
Update the CredentialInstance.
Constructor Details
#initialize(version, account_sid, credential_list_sid, sid) ⇒ CredentialContext
Initialize the CredentialContext
172 173 174 175 176 177 178 179 180 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 172 def initialize(version, account_sid, credential_list_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, credential_list_sid: credential_list_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/SIP/CredentialLists/#{@solution[:credential_list_sid]}/Credentials/#{@solution[:sid]}.json" end |
Instance Method Details
#delete ⇒ Boolean
Delete the CredentialInstance
184 185 186 187 188 189 190 191 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 184 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ CredentialInstance
Fetch the CredentialInstance
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 196 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) CredentialInstance.new( @version, payload, account_sid: @solution[:account_sid], credential_list_sid: @solution[:credential_list_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 252 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.CredentialContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
245 246 247 248 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 245 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.CredentialContext #{context}>" end |
#update(password: :unset) ⇒ CredentialInstance
Update the CredentialInstance
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb', line 218 def update( password: :unset ) data = Twilio::Values.of({ 'Password' => password, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) CredentialInstance.new( @version, payload, account_sid: @solution[:account_sid], credential_list_sid: @solution[:credential_list_sid], sid: @solution[:sid], ) end |