Class: Basecamp::Services::ForwardsService
- Inherits:
-
BaseService
- Object
- BaseService
- Basecamp::Services::ForwardsService
- Defined in:
- lib/basecamp/generated/services/forwards_service.rb
Overview
Service for Forwards operations
Instance Method Summary collapse
-
#create_reply(forward_id:, content:) ⇒ Hash
Create a reply to a forward.
-
#get(forward_id:) ⇒ Hash
Get a forward by ID.
-
#get_inbox(inbox_id:) ⇒ Hash
Get an inbox by ID.
-
#get_reply(forward_id:, reply_id:) ⇒ Hash
Get a forward reply by ID.
-
#list(inbox_id:, sort: nil, direction: nil) ⇒ Enumerator<Hash>
List all forwards in an inbox.
-
#list_replies(forward_id:) ⇒ Enumerator<Hash>
List all replies to a forward.
Constructor Details
This class inherits a constructor from Basecamp::Services::BaseService
Instance Method Details
#create_reply(forward_id:, content:) ⇒ Hash
Create a reply to a forward
32 33 34 35 36 |
# File 'lib/basecamp/generated/services/forwards_service.rb', line 32 def create_reply(forward_id:, content:) with_operation(service: "forwards", operation: "create_reply", is_mutation: true, resource_id: forward_id) do http_post("/inbox_forwards/#{forward_id}/replies.json", body: compact_params(content: content)).json end end |
#get(forward_id:) ⇒ Hash
Get a forward by ID
13 14 15 16 17 |
# File 'lib/basecamp/generated/services/forwards_service.rb', line 13 def get(forward_id:) with_operation(service: "forwards", operation: "get", is_mutation: false, resource_id: forward_id) do http_get("/inbox_forwards/#{forward_id}").json end end |
#get_inbox(inbox_id:) ⇒ Hash
Get an inbox by ID
51 52 53 54 55 |
# File 'lib/basecamp/generated/services/forwards_service.rb', line 51 def get_inbox(inbox_id:) with_operation(service: "forwards", operation: "get_inbox", is_mutation: false, resource_id: inbox_id) do http_get("/inboxes/#{inbox_id}").json end end |
#get_reply(forward_id:, reply_id:) ⇒ Hash
Get a forward reply by ID
42 43 44 45 46 |
# File 'lib/basecamp/generated/services/forwards_service.rb', line 42 def get_reply(forward_id:, reply_id:) with_operation(service: "forwards", operation: "get_reply", is_mutation: false, resource_id: reply_id) do http_get("/inbox_forwards/#{forward_id}/replies/#{reply_id}").json end end |
#list(inbox_id:, sort: nil, direction: nil) ⇒ Enumerator<Hash>
List all forwards in an inbox
62 63 64 65 66 67 |
# File 'lib/basecamp/generated/services/forwards_service.rb', line 62 def list(inbox_id:, sort: nil, direction: nil) wrap_paginated(service: "forwards", operation: "list", is_mutation: false, resource_id: inbox_id) do params = compact_query_params(sort: sort, direction: direction) paginate("/inboxes/#{inbox_id}/forwards.json", params: params) end end |
#list_replies(forward_id:) ⇒ Enumerator<Hash>
List all replies to a forward
22 23 24 25 26 |
# File 'lib/basecamp/generated/services/forwards_service.rb', line 22 def list_replies(forward_id:) wrap_paginated(service: "forwards", operation: "list_replies", is_mutation: false, resource_id: forward_id) do paginate("/inbox_forwards/#{forward_id}/replies.json") end end |