Module: Kongkit::Client::ApiObject
- Included in:
- Kongkit::Client
- Defined in:
- lib/kongkit/client/api_object.rb
Instance Method Summary collapse
-
#add_api(attributes) ⇒ Kongkit::Client::Resource
Add API.
-
#api(identifier) ⇒ Kongkit::Client::Resource
Retrieve API.
-
#apis(options = {}) ⇒ Kongkit::Client::Resource
List APIs.
-
#delete_api(identifier) ⇒ Boolean
Delete API.
-
#edit_api(identifier, attributes) ⇒ Kongkit::Client::Resource
Edit API.
Instance Method Details
#add_api(attributes) ⇒ Kongkit::Client::Resource
Note:
At least request_host or request_path or both should be specified.
Add API
40 41 42 |
# File 'lib/kongkit/client/api_object.rb', line 40 def add_api(attributes) post('/apis', body: attributes) end |
#api(identifier) ⇒ Kongkit::Client::Resource
Retrieve API
24 25 26 |
# File 'lib/kongkit/client/api_object.rb', line 24 def api(identifier) get(api_path(identifier)) end |
#apis(options = {}) ⇒ Kongkit::Client::Resource
List APIs
15 16 17 |
# File 'lib/kongkit/client/api_object.rb', line 15 def apis( = {}) get('/apis', query: ) end |
#delete_api(identifier) ⇒ Boolean
Delete API
66 67 68 |
# File 'lib/kongkit/client/api_object.rb', line 66 def delete_api(identifier) delete(api_path(identifier)) end |
#edit_api(identifier, attributes) ⇒ Kongkit::Client::Resource
Note:
At least request_host or request_path or both should be specified.
Edit API
57 58 59 |
# File 'lib/kongkit/client/api_object.rb', line 57 def edit_api(identifier, attributes) patch(api_path(identifier), body: attributes) end |