class Twilio::REST::IpMessaging::V2::CredentialContext

Public Class Methods

new(version, sid) click to toggle source

Initialize the CredentialContext @param [Version] version Version that contains the resource @param [String] sid The sid @return [CredentialContext] CredentialContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb
174 def initialize(version, sid)
175   super(version)
176 
177   # Path Solution
178   @solution = {sid: sid, }
179   @uri = "/Credentials/#{@solution[:sid]}"
180 end

Public Instance Methods

delete() click to toggle source

Delete the CredentialInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb
218 def delete
219    @version.delete('DELETE', @uri)
220 end
fetch() click to toggle source

Fetch the CredentialInstance @return [CredentialInstance] Fetched CredentialInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb
185 def fetch
186   payload = @version.fetch('GET', @uri)
187 
188   CredentialInstance.new(@version, payload, sid: @solution[:sid], )
189 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb
231 def inspect
232   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
233   "#<Twilio.IpMessaging.V2.CredentialContext #{context}>"
234 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb
224 def to_s
225   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
226   "#<Twilio.IpMessaging.V2.CredentialContext #{context}>"
227 end
update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) click to toggle source

Update the CredentialInstance @param [String] friendly_name The friendly_name @param [String] certificate The certificate @param [String] private_key The private_key @param [Boolean] sandbox The sandbox @param [String] api_key The api_key @param [String] secret The secret @return [CredentialInstance] Updated CredentialInstance

    # File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb
200 def update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset)
201   data = Twilio::Values.of({
202       'FriendlyName' => friendly_name,
203       'Certificate' => certificate,
204       'PrivateKey' => private_key,
205       'Sandbox' => sandbox,
206       'ApiKey' => api_key,
207       'Secret' => secret,
208   })
209 
210   payload = @version.update('POST', @uri, data: data)
211 
212   CredentialInstance.new(@version, payload, sid: @solution[:sid], )
213 end