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/token.rb,
lib/twilio-ruby/rest/iam/v1/api_key.rb,
lib/twilio-ruby/rest/iam/v1/o_auth_app.rb,
lib/twilio-ruby/rest/iam/v1/new_api_key.rb,
lib/twilio-ruby/rest/iam/v1/get_api_keys.rb,
lib/twilio-ruby/rest/iam/v1/role_permission.rb

Defined Under Namespace

Classes: ApiKeyContext, ApiKeyInstance, ApiKeyInstanceMetadata, ApiKeyList, ApiKeyListResponse, ApiKeyPage, ApiKeyPageMetadata, GetApiKeysInstance, GetApiKeysList, GetApiKeysListResponse, GetApiKeysPage, GetApiKeysPageMetadata, NewApiKeyInstance, NewApiKeyList, NewApiKeyListResponse, NewApiKeyPage, NewApiKeyPageMetadata, OAuthAppContext, OAuthAppInstance, OAuthAppInstanceMetadata, OAuthAppList, OAuthAppListResponse, OAuthAppPage, OAuthAppPageMetadata, RolePermissionInstance, RolePermissionList, RolePermissionListResponse, RolePermissionPage, RolePermissionPageMetadata, TokenInstance, TokenList, TokenListResponse, TokenPage, TokenPageMetadata

Instance Attribute Summary

Attributes inherited from Version

#domain, #version

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #create_with_metadata, #delete, #delete_with_metadata, #exception, #fetch, #fetch_with_metadata, #page, #patch, #read_limits, #relative_uri, #request, #stream, #stream_with_metadata, #update, #update_with_metadata

Constructor Details

#initialize(domain) ⇒ V1

Initialize the V1 version of Iam



21
22
23
24
25
26
27
28
29
30
# 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
    @o_auth_apps = nil
    @role_permission = nil
    @token = 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:



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 36

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



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

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

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



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

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

#o_auth_apps(sid = :unset) ⇒ Twilio::REST::Iam::V1::OAuthAppContext, Twilio::REST::Iam::V1::OAuthAppList

Parameters:

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

    Unique ID (sid) of the OAuth app

Returns:



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 61

def o_auth_apps(sid=:unset)
    if sid.nil?
        raise ArgumentError, 'sid cannot be nil'
    end

    if sid == :unset
        @o_auth_apps ||= OAuthAppList.new self
    else
        OAuthAppContext.new(self, sid)
    end
end

#role_permission(role_sid = :unset) ⇒ Twilio::REST::Iam::V1::RolePermissionList

Parameters:

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

    The SID of the Role for which Permissions will be fetched.

Returns:



75
76
77
78
79
80
81
82
83
84
85
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 75

def role_permission(role_sid=:unset)
    if role_sid.nil?
        raise ArgumentError, 'role_sid cannot be nil'
    end

    if role_sid == :unset
        @role_permission ||= RolePermissionList.new self
    else
        RolePermissionList.new(self, role_sid: role_sid)
    end
end

#to_sObject

Provide a user friendly representation



93
94
95
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 93

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

#tokenTwilio::REST::Iam::V1::TokenList



88
89
90
# File 'lib/twilio-ruby/rest/iam/v1.rb', line 88

def token
    @token ||= TokenList.new self
end