Class: Dolibarr::Api::Emailtemplates
- Inherits:
-
Object
- Object
- Dolibarr::Api::Emailtemplates
- Defined in:
- lib/dolibarr-api/api/emailtemplates.rb
Defined Under Namespace
Classes: Label
Instance Method Summary collapse
- #create(create_emailtemplates_model: nil) ⇒ Object
-
#initialize(connection) ⇒ Emailtemplates
constructor
A new instance of Emailtemplates.
- #list(sortfield: nil, sortorder: nil, limit: nil, page: nil, fk_user: nil, sqlfilters: nil, properties: nil, pagination_data: nil) ⇒ Object
- #remove_by_id(id:) ⇒ Object
- #retrieve_by_id(id:) ⇒ Object
- #update_by_id(id:, emailtemplates_update_by_id_model: nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Emailtemplates
Returns a new instance of Emailtemplates.
5 6 7 |
# File 'lib/dolibarr-api/api/emailtemplates.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#create(create_emailtemplates_model: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/dolibarr-api/api/emailtemplates.rb', line 9 def create(create_emailtemplates_model: nil) @connection.call( :POST, '/emailtemplates', type: nil, auth: ['api_key'], body: create_emailtemplates_model ) end |
#list(sortfield: nil, sortorder: nil, limit: nil, page: nil, fk_user: nil, sqlfilters: nil, properties: nil, pagination_data: nil) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/dolibarr-api/api/emailtemplates.rb', line 19 def list(sortfield: nil, sortorder: nil, limit: nil, page: nil, fk_user: nil, sqlfilters: nil, properties: nil, pagination_data: nil) @connection.call( :GET, '/emailtemplates', type: nil, auth: ['api_key'], query: { 'sortfield' => sortfield, 'sortorder' => sortorder, 'limit' => limit, 'page' => page, 'fk_user' => fk_user, 'sqlfilters' => sqlfilters, 'properties' => properties, 'pagination_data' => pagination_data } ) end |
#remove_by_id(id:) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/dolibarr-api/api/emailtemplates.rb', line 29 def remove_by_id(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :DELETE, '/emailtemplates/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'] ) end |
#retrieve_by_id(id:) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/dolibarr-api/api/emailtemplates.rb', line 41 def retrieve_by_id(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :GET, '/emailtemplates/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'] ) end |
#update_by_id(id:, emailtemplates_update_by_id_model: nil) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/dolibarr-api/api/emailtemplates.rb', line 53 def update_by_id(id:, emailtemplates_update_by_id_model: nil) raise ArgumentError, 'id is required' if id.nil? @connection.call( :PUT, '/emailtemplates/{id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: Dolibarr::Api::Models::Obj, auth: ['api_key'], body: emailtemplates_update_by_id_model ) end |