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_my_notifications(page: 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.

Returns:

  • (Hash)

    response data



13
14
15
16
17
# File 'lib/basecamp/generated/services/my_notifications_service.rb', line 13

def get_my_notifications(page: nil)
  with_operation(service: "mynotifications", operation: "get_my_notifications", is_mutation: false) do
    http_get("/my/readings.json", params: compact_query_params(page: page)).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



22
23
24
25
26
27
# File 'lib/basecamp/generated/services/my_notifications_service.rb', line 22

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