Class: Fizzy::Services::NotificationsService
- Inherits:
-
BaseService
- Object
- BaseService
- Fizzy::Services::NotificationsService
- Defined in:
- lib/fizzy/generated/services/notifications_service.rb
Overview
Service for Notifications operations
Instance Method Summary collapse
-
#bulk_read(account_id:, notification_ids: nil) ⇒ void
bulk_read operation.
-
#list(account_id:, read: nil) ⇒ Enumerator<Hash>
list operation.
-
#read(account_id:, notification_id:) ⇒ void
read operation.
-
#tray(account_id:, include_read: nil) ⇒ Hash
tray operation.
-
#unread(account_id:, notification_id:) ⇒ void
unread operation.
Methods inherited from BaseService
Constructor Details
This class inherits a constructor from Fizzy::Services::BaseService
Instance Method Details
#bulk_read(account_id:, notification_ids: nil) ⇒ void
This method returns an undefined value.
bulk_read operation
25 26 27 28 29 30 |
# File 'lib/fizzy/generated/services/notifications_service.rb', line 25 def bulk_read(account_id:, notification_ids: nil) with_operation(service: "notifications", operation: "BulkReadNotifications", is_mutation: true, resource_id: account_id) do http_post("/#{account_id}/notifications/bulk_reading.json", body: compact_params(notification_ids: notification_ids)) nil end end |
#list(account_id:, read: nil) ⇒ Enumerator<Hash>
list operation
14 15 16 17 18 19 |
# File 'lib/fizzy/generated/services/notifications_service.rb', line 14 def list(account_id:, read: nil) wrap_paginated(service: "notifications", operation: "ListNotifications", is_mutation: false, resource_id: account_id) do params = compact_params(read: read) paginate("/#{account_id}/notifications.json", params: params) end end |
#read(account_id:, notification_id:) ⇒ void
This method returns an undefined value.
read operation
46 47 48 49 50 51 |
# File 'lib/fizzy/generated/services/notifications_service.rb', line 46 def read(account_id:, notification_id:) with_operation(service: "notifications", operation: "ReadNotification", is_mutation: true, resource_id: notification_id) do http_post("/#{account_id}/notifications/#{notification_id}/reading.json", retryable: true) nil end end |
#tray(account_id:, include_read: nil) ⇒ Hash
tray operation
36 37 38 39 40 |
# File 'lib/fizzy/generated/services/notifications_service.rb', line 36 def tray(account_id:, include_read: nil) with_operation(service: "notifications", operation: "GetNotificationTray", is_mutation: false, resource_id: account_id) do http_get("/#{account_id}/notifications/tray.json", params: compact_params(include_read: include_read)).json end end |
#unread(account_id:, notification_id:) ⇒ void
This method returns an undefined value.
unread operation
57 58 59 60 61 62 |
# File 'lib/fizzy/generated/services/notifications_service.rb', line 57 def unread(account_id:, notification_id:) with_operation(service: "notifications", operation: "UnreadNotification", is_mutation: true, resource_id: notification_id) do http_delete("/#{account_id}/notifications/#{notification_id}/reading.json") nil end end |