Class: Fizzy::Services::CommentsService
- Inherits:
-
BaseService
- Object
- BaseService
- Fizzy::Services::CommentsService
- Defined in:
- lib/fizzy/generated/services/comments_service.rb
Overview
Service for Comments operations
Instance Method Summary collapse
-
#create(account_id:, card_number:, body:, created_at: nil) ⇒ Hash
create operation.
-
#delete(account_id:, card_number:, comment_id:) ⇒ void
delete operation.
-
#get(account_id:, card_number:, comment_id:) ⇒ Hash
get operation.
-
#list(account_id:, card_number:) ⇒ Enumerator<Hash>
list operation.
-
#update(account_id:, card_number:, comment_id:, body:) ⇒ 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:, body:, created_at: nil) ⇒ Hash
create operation
26 27 28 29 30 |
# File 'lib/fizzy/generated/services/comments_service.rb', line 26 def create(account_id:, card_number:, body:, created_at: nil) with_operation(service: "comments", operation: "CreateComment", is_mutation: true, resource_id: card_number) do http_post("/#{account_id}/cards/#{card_number}/comments.json", body: compact_params(body: body, created_at: created_at)).json end end |
#delete(account_id:, card_number:, comment_id:) ⇒ void
This method returns an undefined value.
delete operation
60 61 62 63 64 65 |
# File 'lib/fizzy/generated/services/comments_service.rb', line 60 def delete(account_id:, card_number:, comment_id:) with_operation(service: "comments", operation: "DeleteComment", is_mutation: true, resource_id: comment_id) do http_delete("/#{account_id}/cards/#{card_number}/comments/#{comment_id}") nil end end |
#get(account_id:, card_number:, comment_id:) ⇒ Hash
get operation
37 38 39 40 41 |
# File 'lib/fizzy/generated/services/comments_service.rb', line 37 def get(account_id:, card_number:, comment_id:) with_operation(service: "comments", operation: "GetComment", is_mutation: false, resource_id: comment_id) do http_get("/#{account_id}/cards/#{card_number}/comments/#{comment_id}").json end end |
#list(account_id:, card_number:) ⇒ Enumerator<Hash>
list operation
14 15 16 17 18 |
# File 'lib/fizzy/generated/services/comments_service.rb', line 14 def list(account_id:, card_number:) wrap_paginated(service: "comments", operation: "ListComments", is_mutation: false, resource_id: card_number) do paginate("/#{account_id}/cards/#{card_number}/comments.json") end end |
#update(account_id:, card_number:, comment_id:, body:) ⇒ Hash
update operation
49 50 51 52 53 |
# File 'lib/fizzy/generated/services/comments_service.rb', line 49 def update(account_id:, card_number:, comment_id:, body:) with_operation(service: "comments", operation: "UpdateComment", is_mutation: true, resource_id: comment_id) do http_patch("/#{account_id}/cards/#{card_number}/comments/#{comment_id}", body: compact_params(body: body)).json end end |