Class: Twilio::REST::Chat::V1::CredentialContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Chat::V1::CredentialContext
- Defined in:
- lib/twilio-ruby/rest/chat/v1/credential.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the CredentialInstance.
-
#fetch ⇒ CredentialInstance
Fetch the CredentialInstance.
-
#initialize(version, sid) ⇒ CredentialContext
constructor
Initialize the CredentialContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) ⇒ CredentialInstance
Update the CredentialInstance.
Constructor Details
#initialize(version, sid) ⇒ CredentialContext
Initialize the CredentialContext
188 189 190 191 192 193 194 |
# File 'lib/twilio-ruby/rest/chat/v1/credential.rb', line 188 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Credentials/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the CredentialInstance
244 245 246 |
# File 'lib/twilio-ruby/rest/chat/v1/credential.rb', line 244 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ CredentialInstance
Fetch the CredentialInstance
199 200 201 202 203 |
# File 'lib/twilio-ruby/rest/chat/v1/credential.rb', line 199 def fetch payload = @version.fetch('GET', @uri) CredentialInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
257 258 259 260 |
# File 'lib/twilio-ruby/rest/chat/v1/credential.rb', line 257 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Chat.V1.CredentialContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
250 251 252 253 |
# File 'lib/twilio-ruby/rest/chat/v1/credential.rb', line 250 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Chat.V1.CredentialContext #{context}>" end |
#update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) ⇒ CredentialInstance
Update the CredentialInstance
226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/twilio-ruby/rest/chat/v1/credential.rb', line 226 def update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Certificate' => certificate, 'PrivateKey' => private_key, 'Sandbox' => sandbox, 'ApiKey' => api_key, 'Secret' => secret, }) payload = @version.update('POST', @uri, data: data) CredentialInstance.new(@version, payload, sid: @solution[:sid], ) end |