Class: Basecamp::Services::MyNotificationsService

Inherits:
BaseService
  • Object
show all
Defined in:
lib/basecamp/generated/services/my_notifications_service.rb

Overview

Service for MyNotifications operations

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from Basecamp::Services::BaseService

Instance Method Details

#get_bubble_ups(page: nil, max_items: nil) ⇒ ListEnumerator<Hash>

Get the current user's current and scheduled bubble-ups (paginated, 50 per page).

Parameters:

  • page (Integer, nil) (defaults to: nil)

    Page number. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.

  • max_items (Integer, nil) (defaults to: nil)

    cap on items yielded across pages; nil or non-positive means no cap

Returns:

  • (ListEnumerator<Hash>)

    lazily paginated results (#meta carries pagination metadata)



29
30
31
32
33
34
# File 'lib/basecamp/generated/services/my_notifications_service.rb', line 29

def get_bubble_ups(page: nil, max_items: nil)
  wrap_paginated(service: "mynotifications", operation: "get_bubble_ups", is_mutation: false) do
    params = compact_query_params(page: page)
    paginate("/my/readings/bubble_ups.json", params: params, operation: "GetBubbleUps", max_items: max_items)
  end
end

#get_my_notifications(page: nil, limit_bubble_ups: nil) ⇒ Hash

Get the current user's notification inbox (the "Hey!" menu).

Parameters:

  • page (Integer, nil) (defaults to: nil)

    Page number for paginating through read items. Defaults to 1. This operation is not auto-paginated in any SDK, so a page is returned as asked for and later pages are not followed.

  • limit_bubble_ups (Boolean, nil) (defaults to: nil)

    Set to true to cap bubble_ups at 2 current bubble-ups and omit the scheduled_bubble_ups key entirely. Defaults to false. Use the dedicated bubble-ups endpoint (GetBubbleUps) to page through all current and scheduled bubble-ups.

Returns:

  • (Hash)

    response data



19
20
21
22
23
# File 'lib/basecamp/generated/services/my_notifications_service.rb', line 19

def get_my_notifications(page: nil, limit_bubble_ups: nil)
  with_operation(service: "mynotifications", operation: "get_my_notifications", is_mutation: false) do
    http_get("/my/readings.json", params: compact_query_params(page: page, limit_bubble_ups: limit_bubble_ups), operation: "GetMyNotifications").json
  end
end

#mark_as_read(readables:) ⇒ void

This method returns an undefined value.

Mark specified items as read

Parameters:

  • readables (Array)

    Array of readable_sgid values identifying the items to mark as read



39
40
41
42
43
44
# File 'lib/basecamp/generated/services/my_notifications_service.rb', line 39

def mark_as_read(readables:)
  with_operation(service: "mynotifications", operation: "mark_as_read", is_mutation: true) do
    http_put("/my/unreads.json", body: compact_params(readables: readables))
    nil
  end
end