Class: Morpheus::ApprovalsInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::ApprovalsInterface
- Defined in:
- lib/morpheus/api/approvals_interface.rb
Instance Method Summary collapse
- #base_path ⇒ Object
- #get(id, params = {}) ⇒ Object
- #get_item(id, params = {}) ⇒ Object
- #list(params = {}) ⇒ Object
- #update_item(id, action) ⇒ Object
Instance Method Details
#base_path ⇒ Object
5 6 7 |
# File 'lib/morpheus/api/approvals_interface.rb', line 5 def base_path "/api/approvals" end |
#get(id, params = {}) ⇒ Object
15 16 17 18 19 |
# File 'lib/morpheus/api/approvals_interface.rb', line 15 def get(id, params={}) url = "#{base_path}/#{id}" headers = { params: {}, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#get_item(id, params = {}) ⇒ Object
21 22 23 24 25 |
# File 'lib/morpheus/api/approvals_interface.rb', line 21 def get_item(id, params={}) url = "#{@base_url}/api/approval-items/#{id}" headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#list(params = {}) ⇒ Object
9 10 11 12 13 |
# File 'lib/morpheus/api/approvals_interface.rb', line 9 def list(params={}) url = base_path headers = { params: params, authorization: "Bearer #{@access_token}" } execute(method: :get, url: url, headers: headers) end |
#update_item(id, action) ⇒ Object
27 28 29 30 31 |
# File 'lib/morpheus/api/approvals_interface.rb', line 27 def update_item(id, action) url = "#{@base_url}/api/approval-items/#{id}/#{action}" headers = { :authorization => "Bearer #{@access_token}", 'Content-Type' => 'application/json' } execute(method: :put, url: url, headers: headers) end |