Class: Twilio::REST::Api::V2010::AccountContext::NewKeyList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/new_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid: nil) ⇒ NewKeyList

Initialize the NewKeyList

Parameters:

  • version (Version)

    Version that contains the resource



27
28
29
30
31
32
33
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 27

def initialize(version, account_sid: nil)
    super(version)
    # Path Solution
    @solution = { account_sid:  }
    @uri = "/Accounts/#{@solution[:account_sid]}/Keys.json"
    
end

Instance Method Details

#create(friendly_name: :unset) ⇒ NewKeyInstance

Create the NewKeyInstance

Parameters:

  • friendly_name (String) (defaults to: :unset)

    A descriptive string that you create to describe the resource. It can be up to 64 characters long.

Returns:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 38

def create(
    friendly_name: :unset
)

    data = Twilio::Values.of({
        'FriendlyName' => friendly_name,
    })

    payload = @version.create('POST', @uri, data: data)
    NewKeyInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
    )
end

#to_sObject

Provide a user friendly representation



58
59
60
# File 'lib/twilio-ruby/rest/api/v2010/account/new_key.rb', line 58

def to_s
    '#<Twilio.Api.V2010.NewKeyList>'
end