Class: Dolibarr::Api::Paiements
- Inherits:
-
Object
- Object
- Dolibarr::Api::Paiements
- Defined in:
- lib/dolibarr-api/api/paiements.rb
Instance Method Summary collapse
- #delete(id:) ⇒ Object
- #get(id:) ⇒ Object
-
#initialize(connection) ⇒ Paiements
constructor
A new instance of Paiements.
- #list(sortfield: nil, sortorder: nil, limit: nil, page: nil, sqlfilters: nil, properties: nil) ⇒ Object
- #update(id:, update_paiements_model: nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Paiements
Returns a new instance of Paiements.
5 6 7 |
# File 'lib/dolibarr-api/api/paiements.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#delete(id:) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/dolibarr-api/api/paiements.rb', line 9 def delete(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :DELETE, '/paiements/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'] ) end |
#get(id:) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dolibarr-api/api/paiements.rb', line 21 def get(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :GET, '/paiements/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'] ) end |
#list(sortfield: nil, sortorder: nil, limit: nil, page: nil, sqlfilters: nil, properties: nil) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/dolibarr-api/api/paiements.rb', line 33 def list(sortfield: nil, sortorder: nil, limit: nil, page: nil, sqlfilters: nil, properties: nil) @connection.call( :GET, '/paiements', type: nil, auth: ['api_key'], query: { 'sortfield' => sortfield, 'sortorder' => sortorder, 'limit' => limit, 'page' => page, 'sqlfilters' => sqlfilters, 'properties' => properties } ) end |
#update(id:, update_paiements_model: nil) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/dolibarr-api/api/paiements.rb', line 43 def update(id:, update_paiements_model: nil) raise ArgumentError, 'id is required' if id.nil? @connection.call( :PUT, '/paiements/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'], body: update_paiements_model ) end |