Class: Twilio::REST::IpMessaging::V1::CredentialContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::IpMessaging::V1::CredentialContext
- Defined in:
- lib/twilio-ruby/rest/ip_messaging/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
174 175 176 177 178 179 180 |
# File 'lib/twilio-ruby/rest/ip_messaging/v1/credential.rb', line 174 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Credentials/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the CredentialInstance
218 219 220 |
# File 'lib/twilio-ruby/rest/ip_messaging/v1/credential.rb', line 218 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ CredentialInstance
Fetch the CredentialInstance
185 186 187 188 189 |
# File 'lib/twilio-ruby/rest/ip_messaging/v1/credential.rb', line 185 def fetch payload = @version.fetch('GET', @uri) CredentialInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
231 232 233 234 |
# File 'lib/twilio-ruby/rest/ip_messaging/v1/credential.rb', line 231 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.IpMessaging.V1.CredentialContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
224 225 226 227 |
# File 'lib/twilio-ruby/rest/ip_messaging/v1/credential.rb', line 224 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.IpMessaging.V1.CredentialContext #{context}>" end |
#update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) ⇒ CredentialInstance
Update the CredentialInstance
200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/ip_messaging/v1/credential.rb', line 200 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 |