Class: Twilio::REST::Iam::V1::NewApiKeyList

Inherits:
ListResource show all
Defined in:
lib/twilio-ruby/rest/iam/v1/new_api_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ NewApiKeyList

Initialize the NewApiKeyList

Parameters:

  • Version that contains the resource



26
27
28
29
30
31
32
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 26

def initialize(version)
    super(version)
    # Path Solution
    @solution = {  }
    @uri = "/Keys"
    
end

Instance Method Details

#create(account_sid: nil, friendly_name: :unset, key_type: :unset, policy: :unset) ⇒ NewApiKeyInstance

Create the NewApiKeyInstance

Parameters:

Returns:

  • Created NewApiKeyInstance



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 40

def create(
    account_sid: nil, 
    friendly_name: :unset, 
    key_type: :unset, 
    policy: :unset
)

    data = Twilio::Values.of({
        'AccountSid' => ,
        'FriendlyName' => friendly_name,
        'KeyType' => key_type,
        'Policy' => Twilio.serialize_object(policy),
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    NewApiKeyInstance.new(
        @version,
        payload,
    )
end

#to_sObject

Provide a user friendly representation



71
72
73
# File 'lib/twilio-ruby/rest/iam/v1/new_api_key.rb', line 71

def to_s
    '#<Twilio.Iam.V1.NewApiKeyList>'
end