Class: Notiflows::Resources::Users::Notifications
- Inherits:
-
Object
- Object
- Notiflows::Resources::Users::Notifications
- Defined in:
- lib/notiflows/resources/users/notifications.rb
Instance Method Summary collapse
-
#initialize(client:) ⇒ Notifications
constructor
private
A new instance of Notifications.
-
#list(user_external_id, 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 all notifications sent to a specific user.
-
#retrieve(notification_id, user_external_id:, request_options: {}) ⇒ Notiflows::Models::Notification
Retrieve a specific notification for a user, including 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.
74 75 76 |
# File 'lib/notiflows/resources/users/notifications.rb', line 74 def initialize(client:) @client = client end |
Instance Method Details
#list(user_external_id, 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 all notifications sent to a specific user.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/notiflows/resources/users/notifications.rb', line 59 def list(user_external_id, params = {}) parsed, = ::Notiflows::Users::NotificationListParams.dump_request(params) @client.request( method: :get, path: ["users/%1$s/notifications", user_external_id], query: parsed, page: ::Notiflows::Internal::CursorPage, model: ::Notiflows::Notification, options: ) end |
#retrieve(notification_id, user_external_id:, request_options: {}) ⇒ Notiflows::Models::Notification
Retrieve a specific notification for a user, including all delivery attempts.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/notiflows/resources/users/notifications.rb', line 20 def retrieve(notification_id, params) parsed, = ::Notiflows::Users::NotificationRetrieveParams.dump_request(params) user_external_id = parsed.delete(:user_external_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :get, path: ["users/%1$s/notifications/%2$s", user_external_id, notification_id], model: ::Notiflows::Notification, options: ) end |