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) ⇒ Enumerator<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.

Returns:

  • (Enumerator<Hash>)

    paginated results



26
27
28
29
30
31
# File 'lib/basecamp/generated/services/my_notifications_service.rb', line 26

def get_bubble_ups(page: 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)
  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.

  • 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



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

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)).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



36
37
38
39
40
41
# File 'lib/basecamp/generated/services/my_notifications_service.rb', line 36

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