class Twilio::REST::Accounts::V1::CredentialList::PublicKeyContext

Public Class Methods

new(version, sid) click to toggle source

Initialize the PublicKeyContext @param [Version] version Version that contains the resource @param [String] sid The Twilio-provided string that uniquely identifies the

PublicKey resource to fetch.

@return [PublicKeyContext] PublicKeyContext

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

Public Instance Methods

delete() click to toggle source

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

    # File lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb
206 def delete
207    @version.delete('DELETE', @uri)
208 end
fetch() click to toggle source

Fetch the PublicKeyInstance @return [PublicKeyInstance] Fetched PublicKeyInstance

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

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb
219 def inspect
220   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
221   "#<Twilio.Accounts.V1.PublicKeyContext #{context}>"
222 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb
212 def to_s
213   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
214   "#<Twilio.Accounts.V1.PublicKeyContext #{context}>"
215 end
update(friendly_name: :unset) click to toggle source

Update the PublicKeyInstance @param [String] friendly_name A descriptive string that you create to describe

the resource. It can be up to 64 characters long.

@return [PublicKeyInstance] Updated PublicKeyInstance

    # File lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb
195 def update(friendly_name: :unset)
196   data = Twilio::Values.of({'FriendlyName' => friendly_name, })
197 
198   payload = @version.update('POST', @uri, data: data)
199 
200   PublicKeyInstance.new(@version, payload, sid: @solution[:sid], )
201 end