Class: SendGridWebApi::ApiKeyModules::Management
Constant Summary
collapse
- APIKEY_URL =
"api_keys"
Instance Attribute Summary
Attributes inherited from Base
#api_key
Instance Method Summary
collapse
#base_url
#management
Methods inherited from Base
#builder_options, #initialize, #make_request_url, #query_api, #query_delete_api, #query_patch_api, #query_post_api, #query_post_json_api, #session, #to_query
Instance Method Details
#create(options = {}) ⇒ Object
14
15
16
|
# File 'lib/api_key/management.rb', line 14
def create options = {}
query_post_json_api(APIKEY_URL, (options))
end
|
#delete(apikey_id, options = {}) ⇒ Object
18
19
20
|
# File 'lib/api_key/management.rb', line 18
def delete apikey_id, options = {}
query_delete_api(APIKEY_URL+"/#{apikey_id}", (options))
end
|
#get(options = {}) ⇒ Object
5
6
7
8
9
10
11
12
|
# File 'lib/api_key/management.rb', line 5
def get options = {}
management_get_url = APIKEY_URL
if options.key?(:apikey_id)
management_get_url += "/#{options[:apikey_id]}"
options.delete(:apikey_id)
end
query_api(management_get_url, (options))
end
|
#update(apikey_id, options = {}) ⇒ Object
22
23
24
|
# File 'lib/api_key/management.rb', line 22
def update apikey_id, options = {}
query_patch_api(APIKEY_URL+"/#{apikey_id}", (options))
end
|