Class: Basecamp::Services::BookmarksService
- Inherits:
-
BaseService
- Object
- BaseService
- Basecamp::Services::BookmarksService
- Defined in:
- lib/basecamp/generated/services/bookmarks_service.rb
Overview
Service for Bookmarks operations
Instance Method Summary collapse
-
#create_bookmark(recording_id:) ⇒ Hash
Bookmark a recording for the current user.
-
#delete_bookmark(recording_id:) ⇒ void
Remove the current user's bookmark from a recording (returns 204 No Content).
-
#get_bookmark(recording_id:) ⇒ Hash
Report whether the current user has bookmarked the recording.
-
#list_my_bookmarks(page: nil, max_items: nil) ⇒ ListEnumerator<Hash>
List the current user's bookmarks, most recently bookmarked first (paginated).
Constructor Details
This class inherits a constructor from Basecamp::Services::BaseService
Instance Method Details
#create_bookmark(recording_id:) ⇒ Hash
Bookmark a recording for the current user.
33 34 35 36 37 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 33 def create_bookmark(recording_id:) with_operation(service: "bookmarks", operation: "create_bookmark", is_mutation: true, resource_id: recording_id) do http_post("/recordings/#{recording_id}/bookmark.json").json end end |
#delete_bookmark(recording_id:) ⇒ void
This method returns an undefined value.
Remove the current user's bookmark from a recording (returns 204 No Content).
42 43 44 45 46 47 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 42 def delete_bookmark(recording_id:) with_operation(service: "bookmarks", operation: "delete_bookmark", is_mutation: true, resource_id: recording_id) do http_delete("/recordings/#{recording_id}/bookmark.json") nil end end |
#get_bookmark(recording_id:) ⇒ Hash
Report whether the current user has bookmarked the recording.
24 25 26 27 28 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 24 def get_bookmark(recording_id:) with_operation(service: "bookmarks", operation: "get_bookmark", is_mutation: false, resource_id: recording_id) do http_get("/recordings/#{recording_id}/bookmark.json", operation: "GetBookmark").json end end |
#list_my_bookmarks(page: nil, max_items: nil) ⇒ ListEnumerator<Hash>
List the current user's bookmarks, most recently bookmarked first (paginated).
14 15 16 17 18 19 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 14 def list_my_bookmarks(page: nil, max_items: nil) wrap_paginated(service: "bookmarks", operation: "list_my_bookmarks", is_mutation: false) do params = compact_query_params(page: page) paginate("/my/bookmarks.json", params: params, operation: "ListMyBookmarks", max_items: max_items) end end |