Class: Morpheus::InvoicesInterface
- Inherits:
-
APIClient
- Object
- APIClient
- Morpheus::InvoicesInterface
- Defined in:
- lib/morpheus/api/invoices_interface.rb
Instance Method Summary collapse
- #base_path ⇒ Object
- #get(id, params = {}) ⇒ Object
- #list(params = {}) ⇒ Object
- #refresh(params = {}, payload = {}) ⇒ Object
- #update(id, payload) ⇒ Object
Instance Method Details
#base_path ⇒ Object
5 6 7 |
# File 'lib/morpheus/api/invoices_interface.rb', line 5 def base_path "/api/invoices" end |
#get(id, params = {}) ⇒ Object
13 14 15 16 |
# File 'lib/morpheus/api/invoices_interface.rb', line 13 def get(id, params={}) raise "#{self.class}.get() passed a blank id!" if id.to_s == '' execute(method: :get, url: "#{base_path}/#{id}", headers: {params: params}) end |
#list(params = {}) ⇒ Object
9 10 11 |
# File 'lib/morpheus/api/invoices_interface.rb', line 9 def list(params={}) execute(method: :get, url: "#{base_path}", headers: {params: params}) end |
#refresh(params = {}, payload = {}) ⇒ Object
23 24 25 26 |
# File 'lib/morpheus/api/invoices_interface.rb', line 23 def refresh(params={}, payload={}) headers = {:params => params, 'Content-Type' => 'application/json'} execute(method: :post, url: "#{base_path}/refresh", headers: headers, payload: payload.to_json) end |
#update(id, payload) ⇒ Object
18 19 20 21 |
# File 'lib/morpheus/api/invoices_interface.rb', line 18 def update(id, payload) validate_id!(id) execute(url: "#{base_path}/#{id}", payload: payload.to_json, method: :put) end |