Module: FizzyApiClient::Resources::Notifications

Included in:
Client
Defined in:
lib/fizzy_api_client/resources/notifications.rb

Instance Method Summary collapse

Instance Method Details

#mark_all_notifications_read(account_slug: nil) ⇒ Object



22
23
24
25
26
# File 'lib/fizzy_api_client/resources/notifications.rb', line 22

def mark_all_notifications_read(account_slug: nil)
  slug = ()
  response = connection.post("/#{slug}/notifications/bulk_reading")
  response.no_content? ? nil : response.body
end

#mark_notification_read(notification_id, account_slug: nil) ⇒ Object



10
11
12
13
14
# File 'lib/fizzy_api_client/resources/notifications.rb', line 10

def mark_notification_read(notification_id, account_slug: nil)
  slug = ()
  response = connection.post("/#{slug}/notifications/#{notification_id}/reading")
  response.no_content? ? nil : response.body
end

#mark_notification_unread(notification_id, account_slug: nil) ⇒ Object



16
17
18
19
20
# File 'lib/fizzy_api_client/resources/notifications.rb', line 16

def mark_notification_unread(notification_id, account_slug: nil)
  slug = ()
  response = connection.delete("/#{slug}/notifications/#{notification_id}/reading")
  response.no_content? ? nil : response.body
end

#notifications(page: nil, auto_paginate: false, account_slug: nil) ⇒ Object



6
7
8
# File 'lib/fizzy_api_client/resources/notifications.rb', line 6

def notifications(page: nil, auto_paginate: false, account_slug: nil)
  paginate("/notifications", account_slug: , auto_paginate: auto_paginate, page: page)
end