class Twilio::REST::Api::V2010::AccountContext::KeyContext

Public Class Methods

new(version, account_sid, sid) click to toggle source

Initialize the KeyContext @param [Version] version Version that contains the resource @param [String] account_sid The SID of the

{Account}[https://www.twilio.com/docs/iam/api/account] that created the Key
resource to fetch.

@param [String] sid The Twilio-provided string that uniquely identifies the Key

resource to fetch.

@return [KeyContext] KeyContext

Calls superclass method Twilio::REST::InstanceContext::new
    # File lib/twilio-ruby/rest/api/v2010/account/key.rb
155 def initialize(version, account_sid, sid)
156   super(version)
157 
158   # Path Solution
159   @solution = {account_sid: account_sid, sid: sid, }
160   @uri = "/Accounts/#{@solution[:account_sid]}/Keys/#{@solution[:sid]}.json"
161 end

Public Instance Methods

delete() click to toggle source

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

    # File lib/twilio-ruby/rest/api/v2010/account/key.rb
188 def delete
189    @version.delete('DELETE', @uri)
190 end
fetch() click to toggle source

Fetch the KeyInstance @return [KeyInstance] Fetched KeyInstance

    # File lib/twilio-ruby/rest/api/v2010/account/key.rb
166 def fetch
167   payload = @version.fetch('GET', @uri)
168 
169   KeyInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
170 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/key.rb
201 def inspect
202   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
203   "#<Twilio.Api.V2010.KeyContext #{context}>"
204 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/api/v2010/account/key.rb
194 def to_s
195   context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
196   "#<Twilio.Api.V2010.KeyContext #{context}>"
197 end
update(friendly_name: :unset) click to toggle source

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

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

@return [KeyInstance] Updated KeyInstance

    # File lib/twilio-ruby/rest/api/v2010/account/key.rb
177 def update(friendly_name: :unset)
178   data = Twilio::Values.of({'FriendlyName' => friendly_name, })
179 
180   payload = @version.update('POST', @uri, data: data)
181 
182   KeyInstance.new(@version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], )
183 end