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

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/iam/v1.rb,
lib/twilio-ruby/rest/iam/v1/api_key.rb,
lib/twilio-ruby/rest/iam/v1/new_api_key.rb,
lib/twilio-ruby/rest/iam/v1/get_api_keys.rb

Defined Under Namespace

Classes: ApiKeyContext, ApiKeyInstance, ApiKeyList, ApiKeyPage, GetApiKeysInstance, GetApiKeysList, GetApiKeysPage, NewApiKeyInstance, NewApiKeyList, NewApiKeyPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Iam



21
22
23
24
25
26
27
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 21

def initialize(domain)
    super
    @version = 'v1'
    @api_key = nil
    @get_api_keys = nil
    @new_api_key = nil
end

Instance Method Details

#api_key(sid = :unset) ⇒ Twilio::REST::Iam::V1::ApiKeyContext, Twilio::REST::Iam::V1::ApiKeyList

Parameters:

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

    The Twilio-provided string that uniquely identifies the Key resource to fetch.

Returns:



33
34
35
36
37
38
39
40
41
42
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 33

def api_key(sid=:unset)
    if sid.nil?
        raise ArgumentError, 'sid cannot be nil'
    end
    if sid == :unset
        @api_key ||= ApiKeyList.new self
    else
        ApiKeyContext.new(self, sid)
    end
end

#get_api_keysTwilio::REST::Iam::V1::GetApiKeysList



45
46
47
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 45

def get_api_keys
    @get_api_keys ||= GetApiKeysList.new self
end

#new_api_keyTwilio::REST::Iam::V1::NewApiKeyList



50
51
52
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 50

def new_api_key
    @new_api_key ||= NewApiKeyList.new self
end

#to_sObject

Provide a user friendly representation



55
56
57
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 55

def to_s
    '<Twilio::REST::Iam::V1>';
end