Class: Notiflows::Resources::Notifications
- Inherits:
-
Object
- Object
- Notiflows::Resources::Notifications
- Defined in:
- lib/notiflows/resources/notifications.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Notifications
constructor
private
A new instance of Notifications.
-
#list(after: nil, before: nil, created_after: nil, created_before: nil, limit: nil, status: nil, topic: nil, request_options: {}) ⇒ Notiflows::Internal::CursorPage<Notiflows::Models::Notification>
Retrieve a paginated list of all notifications in your project.
-
#list_deliveries(notification_id, after: nil, before: nil, channel_id: nil, created_after: nil, created_before: nil, limit: nil, status: nil, topic: nil, request_options: {}) ⇒ Notiflows::Internal::CursorPage<Notiflows::Models::Delivery>
Retrieve all delivery attempts for a specific notification.
-
#retrieve(id, request_options: {}) ⇒ Notiflows::Models::Notification
Retrieve a single notification by ID, including the recipient, actor, and all delivery attempts.
Constructor Details
#initialize(client:) ⇒ Notifications
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Notifications.
107 108 109 |
# File 'lib/notiflows/resources/notifications.rb', line 107 def initialize(client:) @client = client end |
Instance Method Details
#list(after: nil, before: nil, created_after: nil, created_before: nil, limit: nil, status: nil, topic: nil, request_options: {}) ⇒ Notiflows::Internal::CursorPage<Notiflows::Models::Notification>
Retrieve a paginated list of all notifications in your project.
A notification represents a message sent to a single recipient through a notiflow run. Each notification can have multiple deliveries (one per channel).
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/notiflows/resources/notifications.rb', line 53 def list(params = {}) parsed, = ::Notiflows::NotificationListParams.dump_request(params) @client.request( method: :get, path: "notifications", query: parsed, page: ::Notiflows::Internal::CursorPage, model: ::Notiflows::Notification, options: ) end |
#list_deliveries(notification_id, after: nil, before: nil, channel_id: nil, created_after: nil, created_before: nil, limit: nil, status: nil, topic: nil, request_options: {}) ⇒ Notiflows::Internal::CursorPage<Notiflows::Models::Delivery>
Retrieve all delivery attempts for a specific notification.
92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/notiflows/resources/notifications.rb', line 92 def list_deliveries(notification_id, params = {}) parsed, = ::Notiflows::NotificationListDeliveriesParams.dump_request(params) @client.request( method: :get, path: ["notifications/%1$s/deliveries", notification_id], query: parsed, page: ::Notiflows::Internal::CursorPage, model: ::Notiflows::Delivery, options: ) end |
#retrieve(id, request_options: {}) ⇒ Notiflows::Models::Notification
Retrieve a single notification by ID, including the recipient, actor, and all delivery attempts.
18 19 20 21 22 23 24 25 |
# File 'lib/notiflows/resources/notifications.rb', line 18 def retrieve(id, params = {}) @client.request( method: :get, path: ["notifications/%1$s", id], model: ::Notiflows::Notification, options: params[:request_options] ) end |