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) ⇒ Enumerator<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.
32 33 34 35 36 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 32 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).
41 42 43 44 45 46 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 41 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.
23 24 25 26 27 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 23 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) ⇒ Enumerator<Hash>
List the current user's bookmarks, most recently bookmarked first (paginated).
13 14 15 16 17 18 |
# File 'lib/basecamp/generated/services/bookmarks_service.rb', line 13 def list_my_bookmarks(page: 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") end end |