class Twilio::REST::Api::V2010::AccountContext::NewKeyList

Public Class Methods

new(version, account_sid: nil) click to toggle source

Initialize the NewKeyList @param [Version] version Version that contains the resource @param [String] account_sid A 34 character string that uniquely identifies this

resource.

@return [NewKeyList] NewKeyList

Calls superclass method Twilio::REST::ListResource::new
   # File lib/twilio-ruby/rest/api/v2010/account/new_key.rb
21 def initialize(version, account_sid: nil)
22   super(version)
23 
24   # Path Solution
25   @solution = {account_sid: account_sid}
26   @uri = "/Accounts/#{@solution[:account_sid]}/Keys.json"
27 end

Public Instance Methods

create(friendly_name: :unset) click to toggle source

Create the NewKeyInstance @param [String] friendly_name A descriptive string that you create to describe

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

@return [NewKeyInstance] Created NewKeyInstance

   # File lib/twilio-ruby/rest/api/v2010/account/new_key.rb
34 def create(friendly_name: :unset)
35   data = Twilio::Values.of({'FriendlyName' => friendly_name, })
36 
37   payload = @version.create('POST', @uri, data: data)
38 
39   NewKeyInstance.new(@version, payload, account_sid: @solution[:account_sid], )
40 end
to_s() click to toggle source

Provide a user friendly representation

   # File lib/twilio-ruby/rest/api/v2010/account/new_key.rb
44 def to_s
45   '#<Twilio.Api.V2010.NewKeyList>'
46 end