Class: Fizzy::Services::StepsService
- Inherits:
-
BaseService
- Object
- BaseService
- Fizzy::Services::StepsService
- Defined in:
- lib/fizzy/generated/services/steps_service.rb
Overview
Service for Steps operations
Instance Method Summary collapse
-
#create(account_id:, card_number:, content:, completed: nil) ⇒ Hash
create operation.
-
#delete(account_id:, card_number:, step_id:) ⇒ void
delete operation.
-
#get(account_id:, card_number:, step_id:) ⇒ Hash
get operation.
-
#list(account_id:, card_number:) ⇒ Hash
list operation.
-
#update(account_id:, card_number:, step_id:, content: nil, completed: nil) ⇒ Hash
update operation.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Fizzy::Services::BaseService
Instance Method Details
#create(account_id:, card_number:, content:, completed: nil) ⇒ Hash
create operation
26 27 28 29 30 |
# File 'lib/fizzy/generated/services/steps_service.rb', line 26 def create(account_id:, card_number:, content:, completed: nil) with_operation(service: "steps", operation: "CreateStep", is_mutation: true, resource_id: card_number) do http_post("/#{account_id}/cards/#{card_number}/steps.json", body: compact_params(content: content, completed: completed)).json end end |
#delete(account_id:, card_number:, step_id:) ⇒ void
This method returns an undefined value.
delete operation
61 62 63 64 65 66 |
# File 'lib/fizzy/generated/services/steps_service.rb', line 61 def delete(account_id:, card_number:, step_id:) with_operation(service: "steps", operation: "DeleteStep", is_mutation: true, resource_id: step_id) do http_delete("/#{account_id}/cards/#{card_number}/steps/#{step_id}") nil end end |
#get(account_id:, card_number:, step_id:) ⇒ Hash
get operation
37 38 39 40 41 |
# File 'lib/fizzy/generated/services/steps_service.rb', line 37 def get(account_id:, card_number:, step_id:) with_operation(service: "steps", operation: "GetStep", is_mutation: false, resource_id: step_id) do http_get("/#{account_id}/cards/#{card_number}/steps/#{step_id}").json end end |
#list(account_id:, card_number:) ⇒ Hash
list operation
14 15 16 17 18 |
# File 'lib/fizzy/generated/services/steps_service.rb', line 14 def list(account_id:, card_number:) with_operation(service: "steps", operation: "ListSteps", is_mutation: false, resource_id: card_number) do http_get("/#{account_id}/cards/#{card_number}/steps.json").json end end |
#update(account_id:, card_number:, step_id:, content: nil, completed: nil) ⇒ Hash
update operation
50 51 52 53 54 |
# File 'lib/fizzy/generated/services/steps_service.rb', line 50 def update(account_id:, card_number:, step_id:, content: nil, completed: nil) with_operation(service: "steps", operation: "UpdateStep", is_mutation: true, resource_id: step_id) do http_patch("/#{account_id}/cards/#{card_number}/steps/#{step_id}", body: compact_params(content: content, completed: completed)).json end end |