Class: Fakturoid::Api::RecurringGenerator
- Inherits:
-
Object
- Object
- Fakturoid::Api::RecurringGenerator
show all
- Includes:
- Base
- Defined in:
- lib/fakturoid/api/recurring_generator.rb
Constant Summary
collapse
- INDEX_PARAMS =
[:since, :updated_since, :page, :subject_id].freeze
Instance Attribute Summary
Attributes included from Base
#client
Instance Method Summary
collapse
Methods included from Base
#initialize, #perform_request
Instance Method Details
#all(params = {}) ⇒ Object
10
11
12
13
14
|
# File 'lib/fakturoid/api/recurring_generator.rb', line 10
def all(params = {})
request_params = Utils.permit_params(params, *INDEX_PARAMS) || {}
perform_request(HTTP_GET, "recurring_generators.json", request_params: request_params)
end
|
#create(payload = {}) ⇒ Object
21
22
23
|
# File 'lib/fakturoid/api/recurring_generator.rb', line 21
def create(payload = {})
perform_request(HTTP_POST, "recurring_generators.json", payload: payload)
end
|
#delete(id) ⇒ Object
30
31
32
33
|
# File 'lib/fakturoid/api/recurring_generator.rb', line 30
def delete(id)
Utils.validate_numerical_id(id)
perform_request(HTTP_DELETE, "recurring_generators/#{id}.json")
end
|
#find(id) ⇒ Object
16
17
18
19
|
# File 'lib/fakturoid/api/recurring_generator.rb', line 16
def find(id)
Utils.validate_numerical_id(id)
perform_request(HTTP_GET, "recurring_generators/#{id}.json")
end
|
#update(id, payload = {}) ⇒ Object
25
26
27
28
|
# File 'lib/fakturoid/api/recurring_generator.rb', line 25
def update(id, payload = {})
Utils.validate_numerical_id(id)
perform_request(HTTP_PATCH, "recurring_generators/#{id}.json", payload: payload)
end
|