Class: Dolibarr::Api::Proposals
- Inherits:
-
Object
- Object
- Dolibarr::Api::Proposals
- Defined in:
- lib/dolibarr-api/api/proposals.rb
Defined Under Namespace
Classes: Contact, Contacts, Lines, Ref, RefExt
Instance Method Summary collapse
- #close(id:, proposals_close_model:) ⇒ Object
- #create(create_proposals_model: nil) ⇒ Object
- #create_line(id:, proposals_create_line_model: nil) ⇒ Object
- #delete(id:) ⇒ Object
- #get(id:, contact_list: nil) ⇒ Object
-
#initialize(connection) ⇒ Proposals
constructor
A new instance of Proposals.
- #list(sortfield: nil, sortorder: nil, limit: nil, page: nil, thirdparty_ids: nil, sqlfilters: nil, properties: nil, pagination_data: nil, loadlinkedobjects: nil) ⇒ Object
- #setinvoiced(id:) ⇒ Object
- #settodraft(id:) ⇒ Object
- #update(id:, update_proposals_model: nil) ⇒ Object
- #validate(id:, proposals_validate_model: nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Proposals
Returns a new instance of Proposals.
5 6 7 |
# File 'lib/dolibarr-api/api/proposals.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#close(id:, proposals_close_model:) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dolibarr-api/api/proposals.rb', line 9 def close(id:, proposals_close_model:) raise ArgumentError, 'id is required' if id.nil? raise ArgumentError, 'proposals_close_model is required' if proposals_close_model.nil? @connection.call( :POST, '/proposals/{id}/close' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'], body: proposals_close_model ) end |
#create(create_proposals_model: nil) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/dolibarr-api/api/proposals.rb', line 23 def create(create_proposals_model: nil) @connection.call( :POST, '/proposals', type: nil, auth: ['api_key'], body: create_proposals_model ) end |
#create_line(id:, proposals_create_line_model: nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/dolibarr-api/api/proposals.rb', line 33 def create_line(id:, proposals_create_line_model: nil) raise ArgumentError, 'id is required' if id.nil? @connection.call( :POST, '/proposals/{id}/line' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'], body: proposals_create_line_model ) end |
#delete(id:) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/dolibarr-api/api/proposals.rb', line 46 def delete(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :DELETE, '/proposals/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'] ) end |
#get(id:, contact_list: nil) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/dolibarr-api/api/proposals.rb', line 58 def get(id:, contact_list: nil) raise ArgumentError, 'id is required' if id.nil? @connection.call( :GET, '/proposals/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'], query: { 'contact_list' => contact_list } ) end |
#list(sortfield: nil, sortorder: nil, limit: nil, page: nil, thirdparty_ids: nil, sqlfilters: nil, properties: nil, pagination_data: nil, loadlinkedobjects: nil) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/dolibarr-api/api/proposals.rb', line 71 def list(sortfield: nil, sortorder: nil, limit: nil, page: nil, thirdparty_ids: nil, sqlfilters: nil, properties: nil, pagination_data: nil, loadlinkedobjects: nil) @connection.call( :GET, '/proposals', type: nil, auth: ['api_key'], query: { 'sortfield' => sortfield, 'sortorder' => sortorder, 'limit' => limit, 'page' => page, 'thirdparty_ids' => thirdparty_ids, 'sqlfilters' => sqlfilters, 'properties' => properties, 'pagination_data' => pagination_data, 'loadlinkedobjects' => loadlinkedobjects } ) end |
#setinvoiced(id:) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/dolibarr-api/api/proposals.rb', line 81 def setinvoiced(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :POST, '/proposals/{id}/setinvoiced' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'] ) end |
#settodraft(id:) ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/dolibarr-api/api/proposals.rb', line 93 def settodraft(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :POST, '/proposals/{id}/settodraft' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'] ) end |
#update(id:, update_proposals_model: nil) ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/dolibarr-api/api/proposals.rb', line 105 def update(id:, update_proposals_model: nil) raise ArgumentError, 'id is required' if id.nil? @connection.call( :PUT, '/proposals/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'], body: update_proposals_model ) end |
#validate(id:, proposals_validate_model: nil) ⇒ Object
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/dolibarr-api/api/proposals.rb', line 118 def validate(id:, proposals_validate_model: nil) raise ArgumentError, 'id is required' if id.nil? @connection.call( :POST, '/proposals/{id}/validate' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'], body: proposals_validate_model ) end |