Class: Dolibarr::Api::Thirdparties::Notifications
- Inherits:
-
Object
- Object
- Dolibarr::Api::Thirdparties::Notifications
- Defined in:
- lib/dolibarr-api/api/thirdparties/notifications.rb
Instance Method Summary collapse
- #create(id:, thirdparties_create_company_notification_model: nil) ⇒ Object
- #delete(id:, notification_id:) ⇒ Object
-
#initialize(connection) ⇒ Notifications
constructor
A new instance of Notifications.
- #list(id:) ⇒ Object
- #update(id:, notification_id:, thirdparties_update_company_notification_model: nil) ⇒ Object
Constructor Details
#initialize(connection) ⇒ Notifications
Returns a new instance of Notifications.
5 6 7 |
# File 'lib/dolibarr-api/api/thirdparties/notifications.rb', line 5 def initialize(connection) @connection = connection end |
Instance Method Details
#create(id:, thirdparties_create_company_notification_model: nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/dolibarr-api/api/thirdparties/notifications.rb', line 9 def create(id:, thirdparties_create_company_notification_model: nil) raise ArgumentError, 'id is required' if id.nil? @connection.call( :POST, '/thirdparties/{id}/notifications' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'], body: thirdparties_create_company_notification_model ) end |
#delete(id:, notification_id:) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/dolibarr-api/api/thirdparties/notifications.rb', line 22 def delete(id:, notification_id:) raise ArgumentError, 'id is required' if id.nil? raise ArgumentError, 'notification_id is required' if notification_id.nil? @connection.call( :DELETE, '/thirdparties/{id}/notifications/{notification_id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)) .gsub('{notification_id}', ERB::Util.url_encode(notification_id.to_s)), type: nil, auth: ['api_key'] ) end |
#list(id:) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/dolibarr-api/api/thirdparties/notifications.rb', line 36 def list(id:) raise ArgumentError, 'id is required' if id.nil? @connection.call( :GET, '/thirdparties/{id}/notifications' .gsub('{id}', ERB::Util.url_encode(id.to_s)), type: nil, auth: ['api_key'] ) end |
#update(id:, notification_id:, thirdparties_update_company_notification_model: nil) ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/dolibarr-api/api/thirdparties/notifications.rb', line 48 def update(id:, notification_id:, thirdparties_update_company_notification_model: nil) raise ArgumentError, 'id is required' if id.nil? raise ArgumentError, 'notification_id is required' if notification_id.nil? @connection.call( :PUT, '/thirdparties/{id}/notifications/{notification_id}' .gsub('{id}', ERB::Util.url_encode(id.to_s)) .gsub('{notification_id}', ERB::Util.url_encode(notification_id.to_s)), type: nil, auth: ['api_key'], body: thirdparties_update_company_notification_model ) end |