notiflows 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +305 -0
- data/SECURITY.md +27 -0
- data/lib/notiflows/client.rb +117 -0
- data/lib/notiflows/errors.rb +228 -0
- data/lib/notiflows/file_part.rb +58 -0
- data/lib/notiflows/internal/cursor_page.rb +100 -0
- data/lib/notiflows/internal/transport/base_client.rb +573 -0
- data/lib/notiflows/internal/transport/pooled_net_requester.rb +210 -0
- data/lib/notiflows/internal/type/array_of.rb +168 -0
- data/lib/notiflows/internal/type/base_model.rb +531 -0
- data/lib/notiflows/internal/type/base_page.rb +55 -0
- data/lib/notiflows/internal/type/boolean.rb +77 -0
- data/lib/notiflows/internal/type/converter.rb +327 -0
- data/lib/notiflows/internal/type/enum.rb +131 -0
- data/lib/notiflows/internal/type/file_input.rb +111 -0
- data/lib/notiflows/internal/type/hash_of.rb +188 -0
- data/lib/notiflows/internal/type/request_parameters.rb +42 -0
- data/lib/notiflows/internal/type/union.rb +237 -0
- data/lib/notiflows/internal/type/unknown.rb +81 -0
- data/lib/notiflows/internal/util.rb +920 -0
- data/lib/notiflows/internal.rb +20 -0
- data/lib/notiflows/models/delivery.rb +189 -0
- data/lib/notiflows/models/delivery_list_params.rb +78 -0
- data/lib/notiflows/models/delivery_retrieve_params.rb +14 -0
- data/lib/notiflows/models/notification.rb +151 -0
- data/lib/notiflows/models/notification_list_deliveries_params.rb +78 -0
- data/lib/notiflows/models/notification_list_params.rb +70 -0
- data/lib/notiflows/models/notification_retrieve_params.rb +14 -0
- data/lib/notiflows/models/notiflow_run_params.rb +197 -0
- data/lib/notiflows/models/notiflow_run_response.rb +19 -0
- data/lib/notiflows/models/topic.rb +27 -0
- data/lib/notiflows/models/topic_delete_params.rb +14 -0
- data/lib/notiflows/models/topic_list_params.rb +38 -0
- data/lib/notiflows/models/topic_retrieve_params.rb +14 -0
- data/lib/notiflows/models/topics/bulk_operation_response.rb +51 -0
- data/lib/notiflows/models/topics/bulk_subscribe_request.rb +20 -0
- data/lib/notiflows/models/topics/subscription_list_params.rb +56 -0
- data/lib/notiflows/models/topics/subscription_subscribe_bulk_params.rb +16 -0
- data/lib/notiflows/models/topics/subscription_unsubscribe_bulk_params.rb +16 -0
- data/lib/notiflows/models/user.rb +111 -0
- data/lib/notiflows/models/user_delete_params.rb +14 -0
- data/lib/notiflows/models/user_list_params.rb +54 -0
- data/lib/notiflows/models/user_retrieve_params.rb +14 -0
- data/lib/notiflows/models/user_upsert_params.rb +122 -0
- data/lib/notiflows/models/users/channel_setting_delete_params.rb +22 -0
- data/lib/notiflows/models/users/channel_setting_retrieve_params.rb +22 -0
- data/lib/notiflows/models/users/channel_setting_update_params.rb +45 -0
- data/lib/notiflows/models/users/channel_settings.rb +91 -0
- data/lib/notiflows/models/users/delivery_list_params.rb +80 -0
- data/lib/notiflows/models/users/delivery_retrieve_params.rb +22 -0
- data/lib/notiflows/models/users/mobile_push_settings.rb +20 -0
- data/lib/notiflows/models/users/notification_list_params.rb +72 -0
- data/lib/notiflows/models/users/notification_retrieve_params.rb +22 -0
- data/lib/notiflows/models/users/preference_retrieve_params.rb +16 -0
- data/lib/notiflows/models/users/preference_update_params.rb +16 -0
- data/lib/notiflows/models/users/preferences.rb +116 -0
- data/lib/notiflows/models/users/slack_settings.rb +29 -0
- data/lib/notiflows/models/users/subscription.rb +45 -0
- data/lib/notiflows/models/users/subscription_list_params.rb +56 -0
- data/lib/notiflows/models/users/subscription_retrieve_params.rb +22 -0
- data/lib/notiflows/models/users/subscription_subscribe_params.rb +28 -0
- data/lib/notiflows/models/users/subscription_unsubscribe_params.rb +22 -0
- data/lib/notiflows/models/users/update_preferences_request.rb +45 -0
- data/lib/notiflows/models.rb +79 -0
- data/lib/notiflows/request_options.rb +77 -0
- data/lib/notiflows/resources/deliveries.rb +77 -0
- data/lib/notiflows/resources/notifications.rb +112 -0
- data/lib/notiflows/resources/notiflows.rb +60 -0
- data/lib/notiflows/resources/topics/subscriptions.rb +106 -0
- data/lib/notiflows/resources/topics.rb +91 -0
- data/lib/notiflows/resources/users/channel_settings.rb +132 -0
- data/lib/notiflows/resources/users/deliveries.rb +82 -0
- data/lib/notiflows/resources/users/notifications.rb +80 -0
- data/lib/notiflows/resources/users/preferences.rb +86 -0
- data/lib/notiflows/resources/users/subscriptions.rb +135 -0
- data/lib/notiflows/resources/users.rb +167 -0
- data/lib/notiflows/version.rb +5 -0
- data/lib/notiflows.rb +109 -0
- data/manifest.yaml +17 -0
- data/rbi/notiflows/client.rbi +82 -0
- data/rbi/notiflows/errors.rbi +205 -0
- data/rbi/notiflows/file_part.rbi +37 -0
- data/rbi/notiflows/internal/cursor_page.rbi +37 -0
- data/rbi/notiflows/internal/transport/base_client.rbi +298 -0
- data/rbi/notiflows/internal/transport/pooled_net_requester.rbi +83 -0
- data/rbi/notiflows/internal/type/array_of.rbi +104 -0
- data/rbi/notiflows/internal/type/base_model.rbi +308 -0
- data/rbi/notiflows/internal/type/base_page.rbi +42 -0
- data/rbi/notiflows/internal/type/boolean.rbi +58 -0
- data/rbi/notiflows/internal/type/converter.rbi +216 -0
- data/rbi/notiflows/internal/type/enum.rbi +82 -0
- data/rbi/notiflows/internal/type/file_input.rbi +59 -0
- data/rbi/notiflows/internal/type/hash_of.rbi +104 -0
- data/rbi/notiflows/internal/type/request_parameters.rbi +29 -0
- data/rbi/notiflows/internal/type/union.rbi +128 -0
- data/rbi/notiflows/internal/type/unknown.rbi +58 -0
- data/rbi/notiflows/internal/util.rbi +487 -0
- data/rbi/notiflows/internal.rbi +18 -0
- data/rbi/notiflows/models/delivery.rbi +226 -0
- data/rbi/notiflows/models/delivery_list_params.rbi +123 -0
- data/rbi/notiflows/models/delivery_retrieve_params.rbi +27 -0
- data/rbi/notiflows/models/notification.rbi +190 -0
- data/rbi/notiflows/models/notification_list_deliveries_params.rbi +126 -0
- data/rbi/notiflows/models/notification_list_params.rbi +112 -0
- data/rbi/notiflows/models/notification_retrieve_params.rbi +30 -0
- data/rbi/notiflows/models/notiflow_run_params.rbi +320 -0
- data/rbi/notiflows/models/notiflow_run_response.rbi +31 -0
- data/rbi/notiflows/models/topic.rbi +32 -0
- data/rbi/notiflows/models/topic_delete_params.rbi +27 -0
- data/rbi/notiflows/models/topic_list_params.rbi +68 -0
- data/rbi/notiflows/models/topic_retrieve_params.rbi +27 -0
- data/rbi/notiflows/models/topics/bulk_operation_response.rbi +93 -0
- data/rbi/notiflows/models/topics/bulk_subscribe_request.rbi +35 -0
- data/rbi/notiflows/models/topics/subscription_list_params.rbi +95 -0
- data/rbi/notiflows/models/topics/subscription_subscribe_bulk_params.rbi +32 -0
- data/rbi/notiflows/models/topics/subscription_unsubscribe_bulk_params.rbi +32 -0
- data/rbi/notiflows/models/user.rbi +126 -0
- data/rbi/notiflows/models/user_delete_params.rbi +27 -0
- data/rbi/notiflows/models/user_list_params.rbi +90 -0
- data/rbi/notiflows/models/user_retrieve_params.rbi +27 -0
- data/rbi/notiflows/models/user_upsert_params.rbi +203 -0
- data/rbi/notiflows/models/users/channel_setting_delete_params.rbi +43 -0
- data/rbi/notiflows/models/users/channel_setting_retrieve_params.rbi +43 -0
- data/rbi/notiflows/models/users/channel_setting_update_params.rbi +92 -0
- data/rbi/notiflows/models/users/channel_settings.rbi +156 -0
- data/rbi/notiflows/models/users/delivery_list_params.rbi +128 -0
- data/rbi/notiflows/models/users/delivery_retrieve_params.rbi +43 -0
- data/rbi/notiflows/models/users/mobile_push_settings.rbi +35 -0
- data/rbi/notiflows/models/users/notification_list_params.rbi +117 -0
- data/rbi/notiflows/models/users/notification_retrieve_params.rbi +43 -0
- data/rbi/notiflows/models/users/preference_retrieve_params.rbi +32 -0
- data/rbi/notiflows/models/users/preference_update_params.rbi +34 -0
- data/rbi/notiflows/models/users/preferences.rbi +241 -0
- data/rbi/notiflows/models/users/slack_settings.rbi +49 -0
- data/rbi/notiflows/models/users/subscription.rbi +64 -0
- data/rbi/notiflows/models/users/subscription_list_params.rbi +95 -0
- data/rbi/notiflows/models/users/subscription_retrieve_params.rbi +43 -0
- data/rbi/notiflows/models/users/subscription_subscribe_params.rbi +47 -0
- data/rbi/notiflows/models/users/subscription_unsubscribe_params.rbi +43 -0
- data/rbi/notiflows/models/users/update_preferences_request.rbi +124 -0
- data/rbi/notiflows/models.rbi +42 -0
- data/rbi/notiflows/request_options.rbi +59 -0
- data/rbi/notiflows/resources/deliveries.rbi +67 -0
- data/rbi/notiflows/resources/notifications.rbi +100 -0
- data/rbi/notiflows/resources/notiflows.rbi +52 -0
- data/rbi/notiflows/resources/topics/subscriptions.rbi +88 -0
- data/rbi/notiflows/resources/topics.rbi +69 -0
- data/rbi/notiflows/resources/users/channel_settings.rbi +104 -0
- data/rbi/notiflows/resources/users/deliveries.rbi +69 -0
- data/rbi/notiflows/resources/users/notifications.rbi +66 -0
- data/rbi/notiflows/resources/users/preferences.rbi +76 -0
- data/rbi/notiflows/resources/users/subscriptions.rbi +102 -0
- data/rbi/notiflows/resources/users.rbi +147 -0
- data/rbi/notiflows/version.rbi +5 -0
- data/sig/notiflows/client.rbs +41 -0
- data/sig/notiflows/errors.rbs +117 -0
- data/sig/notiflows/file_part.rbs +21 -0
- data/sig/notiflows/internal/cursor_page.rbs +22 -0
- data/sig/notiflows/internal/transport/base_client.rbs +133 -0
- data/sig/notiflows/internal/transport/pooled_net_requester.rbs +48 -0
- data/sig/notiflows/internal/type/array_of.rbs +48 -0
- data/sig/notiflows/internal/type/base_model.rbs +102 -0
- data/sig/notiflows/internal/type/base_page.rbs +24 -0
- data/sig/notiflows/internal/type/boolean.rbs +26 -0
- data/sig/notiflows/internal/type/converter.rbs +79 -0
- data/sig/notiflows/internal/type/enum.rbs +32 -0
- data/sig/notiflows/internal/type/file_input.rbs +25 -0
- data/sig/notiflows/internal/type/hash_of.rbs +48 -0
- data/sig/notiflows/internal/type/request_parameters.rbs +19 -0
- data/sig/notiflows/internal/type/union.rbs +52 -0
- data/sig/notiflows/internal/type/unknown.rbs +26 -0
- data/sig/notiflows/internal/util.rbs +185 -0
- data/sig/notiflows/internal.rbs +9 -0
- data/sig/notiflows/models/delivery.rbs +130 -0
- data/sig/notiflows/models/delivery_list_params.rbs +77 -0
- data/sig/notiflows/models/delivery_retrieve_params.rbs +15 -0
- data/sig/notiflows/models/notification.rbs +104 -0
- data/sig/notiflows/models/notification_list_deliveries_params.rbs +77 -0
- data/sig/notiflows/models/notification_list_params.rbs +70 -0
- data/sig/notiflows/models/notification_retrieve_params.rbs +15 -0
- data/sig/notiflows/models/notiflow_run_params.rbs +199 -0
- data/sig/notiflows/models/notiflow_run_response.rbs +13 -0
- data/sig/notiflows/models/topic.rbs +15 -0
- data/sig/notiflows/models/topic_delete_params.rbs +15 -0
- data/sig/notiflows/models/topic_list_params.rbs +38 -0
- data/sig/notiflows/models/topic_retrieve_params.rbs +15 -0
- data/sig/notiflows/models/topics/bulk_operation_response.rbs +39 -0
- data/sig/notiflows/models/topics/bulk_subscribe_request.rbs +15 -0
- data/sig/notiflows/models/topics/subscription_list_params.rbs +58 -0
- data/sig/notiflows/models/topics/subscription_subscribe_bulk_params.rbs +17 -0
- data/sig/notiflows/models/topics/subscription_unsubscribe_bulk_params.rbs +17 -0
- data/sig/notiflows/models/user.rbs +75 -0
- data/sig/notiflows/models/user_delete_params.rbs +15 -0
- data/sig/notiflows/models/user_list_params.rbs +56 -0
- data/sig/notiflows/models/user_retrieve_params.rbs +15 -0
- data/sig/notiflows/models/user_upsert_params.rbs +112 -0
- data/sig/notiflows/models/users/channel_setting_delete_params.rbs +26 -0
- data/sig/notiflows/models/users/channel_setting_retrieve_params.rbs +26 -0
- data/sig/notiflows/models/users/channel_setting_update_params.rbs +42 -0
- data/sig/notiflows/models/users/channel_settings.rbs +68 -0
- data/sig/notiflows/models/users/delivery_list_params.rbs +79 -0
- data/sig/notiflows/models/users/delivery_retrieve_params.rbs +26 -0
- data/sig/notiflows/models/users/mobile_push_settings.rbs +15 -0
- data/sig/notiflows/models/users/notification_list_params.rbs +72 -0
- data/sig/notiflows/models/users/notification_retrieve_params.rbs +26 -0
- data/sig/notiflows/models/users/preference_retrieve_params.rbs +17 -0
- data/sig/notiflows/models/users/preference_update_params.rbs +17 -0
- data/sig/notiflows/models/users/preferences.rbs +118 -0
- data/sig/notiflows/models/users/slack_settings.rbs +24 -0
- data/sig/notiflows/models/users/subscription.rbs +32 -0
- data/sig/notiflows/models/users/subscription_list_params.rbs +58 -0
- data/sig/notiflows/models/users/subscription_retrieve_params.rbs +26 -0
- data/sig/notiflows/models/users/subscription_subscribe_params.rbs +25 -0
- data/sig/notiflows/models/users/subscription_unsubscribe_params.rbs +26 -0
- data/sig/notiflows/models/users/update_preferences_request.rbs +52 -0
- data/sig/notiflows/models.rbs +39 -0
- data/sig/notiflows/request_options.rbs +34 -0
- data/sig/notiflows/resources/deliveries.rbs +24 -0
- data/sig/notiflows/resources/notifications.rbs +36 -0
- data/sig/notiflows/resources/notiflows.rbs +16 -0
- data/sig/notiflows/resources/topics/subscriptions.rbs +31 -0
- data/sig/notiflows/resources/topics.rbs +23 -0
- data/sig/notiflows/resources/users/channel_settings.rbs +28 -0
- data/sig/notiflows/resources/users/deliveries.rbs +28 -0
- data/sig/notiflows/resources/users/notifications.rbs +27 -0
- data/sig/notiflows/resources/users/preferences.rbs +21 -0
- data/sig/notiflows/resources/users/subscriptions.rbs +37 -0
- data/sig/notiflows/resources/users.rbs +52 -0
- data/sig/notiflows/version.rbs +3 -0
- metadata +302 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
class SlackSettings < Notiflows::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute slack_channel_id
|
|
8
|
+
# Slack channel ID (starts with C)
|
|
9
|
+
#
|
|
10
|
+
# @return [String, nil]
|
|
11
|
+
optional :slack_channel_id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute slack_user_id
|
|
14
|
+
# Slack user ID for direct messages (starts with U)
|
|
15
|
+
#
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
optional :slack_user_id, String
|
|
18
|
+
|
|
19
|
+
# @!method initialize(slack_channel_id: nil, slack_user_id: nil)
|
|
20
|
+
# Settings for Slack notifications. At least one of `slack_channel_id` or
|
|
21
|
+
# `slack_user_id` must be provided.
|
|
22
|
+
#
|
|
23
|
+
# @param slack_channel_id [String] Slack channel ID (starts with C)
|
|
24
|
+
#
|
|
25
|
+
# @param slack_user_id [String] Slack user ID for direct messages (starts with U)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
# @see Notiflows::Resources::Users::Subscriptions#retrieve
|
|
7
|
+
class Subscription < Notiflows::Internal::Type::BaseModel
|
|
8
|
+
# @!attribute id
|
|
9
|
+
# Subscription ID
|
|
10
|
+
#
|
|
11
|
+
# @return [String]
|
|
12
|
+
required :id, String
|
|
13
|
+
|
|
14
|
+
# @!attribute created_at
|
|
15
|
+
# When the subscription was created
|
|
16
|
+
#
|
|
17
|
+
# @return [Time]
|
|
18
|
+
required :created_at, Time
|
|
19
|
+
|
|
20
|
+
# @!attribute topic_name
|
|
21
|
+
# Name of the subscribed topic
|
|
22
|
+
#
|
|
23
|
+
# @return [String]
|
|
24
|
+
required :topic_name, String
|
|
25
|
+
|
|
26
|
+
# @!attribute user_id
|
|
27
|
+
# User's internal ID
|
|
28
|
+
#
|
|
29
|
+
# @return [String]
|
|
30
|
+
required :user_id, String
|
|
31
|
+
|
|
32
|
+
# @!method initialize(id:, created_at:, topic_name:, user_id:)
|
|
33
|
+
# A user's subscription to a topic
|
|
34
|
+
#
|
|
35
|
+
# @param id [String] Subscription ID
|
|
36
|
+
#
|
|
37
|
+
# @param created_at [Time] When the subscription was created
|
|
38
|
+
#
|
|
39
|
+
# @param topic_name [String] Name of the subscribed topic
|
|
40
|
+
#
|
|
41
|
+
# @param user_id [String] User's internal ID
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
# @see Notiflows::Resources::Users::Subscriptions#list
|
|
7
|
+
class SubscriptionListParams < Notiflows::Internal::Type::BaseModel
|
|
8
|
+
extend Notiflows::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Notiflows::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute after
|
|
12
|
+
# Cursor for fetching the next page
|
|
13
|
+
#
|
|
14
|
+
# @return [String, nil]
|
|
15
|
+
optional :after, String
|
|
16
|
+
|
|
17
|
+
# @!attribute before
|
|
18
|
+
# Cursor for fetching the previous page
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :before, String
|
|
22
|
+
|
|
23
|
+
# @!attribute created_after
|
|
24
|
+
# Filter by created after (ISO 8601 datetime)
|
|
25
|
+
#
|
|
26
|
+
# @return [String, nil]
|
|
27
|
+
optional :created_after, String
|
|
28
|
+
|
|
29
|
+
# @!attribute created_before
|
|
30
|
+
# Filter by created before (ISO 8601 datetime)
|
|
31
|
+
#
|
|
32
|
+
# @return [String, nil]
|
|
33
|
+
optional :created_before, String
|
|
34
|
+
|
|
35
|
+
# @!attribute limit
|
|
36
|
+
# Number of items per page (default: 25, max: 1000)
|
|
37
|
+
#
|
|
38
|
+
# @return [Integer, nil]
|
|
39
|
+
optional :limit, Integer
|
|
40
|
+
|
|
41
|
+
# @!method initialize(after: nil, before: nil, created_after: nil, created_before: nil, limit: nil, request_options: {})
|
|
42
|
+
# @param after [String] Cursor for fetching the next page
|
|
43
|
+
#
|
|
44
|
+
# @param before [String] Cursor for fetching the previous page
|
|
45
|
+
#
|
|
46
|
+
# @param created_after [String] Filter by created after (ISO 8601 datetime)
|
|
47
|
+
#
|
|
48
|
+
# @param created_before [String] Filter by created before (ISO 8601 datetime)
|
|
49
|
+
#
|
|
50
|
+
# @param limit [Integer] Number of items per page (default: 25, max: 1000)
|
|
51
|
+
#
|
|
52
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}]
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
# @see Notiflows::Resources::Users::Subscriptions#retrieve
|
|
7
|
+
class SubscriptionRetrieveParams < Notiflows::Internal::Type::BaseModel
|
|
8
|
+
extend Notiflows::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Notiflows::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute user_external_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :user_external_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(user_external_id:, request_options: {})
|
|
17
|
+
# @param user_external_id [String]
|
|
18
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
# @see Notiflows::Resources::Users::Subscriptions#subscribe
|
|
7
|
+
class SubscriptionSubscribeParams < Notiflows::Internal::Type::BaseModel
|
|
8
|
+
extend Notiflows::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Notiflows::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute topic_name
|
|
12
|
+
# Name of the topic to subscribe to. Topics are created automatically if they
|
|
13
|
+
# don't exist.
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
required :topic_name, String
|
|
17
|
+
|
|
18
|
+
# @!method initialize(topic_name:, request_options: {})
|
|
19
|
+
# Some parameter documentations has been truncated, see
|
|
20
|
+
# {Notiflows::Models::Users::SubscriptionSubscribeParams} for more details.
|
|
21
|
+
#
|
|
22
|
+
# @param topic_name [String] Name of the topic to subscribe to. Topics are created automatically if they don'
|
|
23
|
+
#
|
|
24
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
# @see Notiflows::Resources::Users::Subscriptions#unsubscribe
|
|
7
|
+
class SubscriptionUnsubscribeParams < Notiflows::Internal::Type::BaseModel
|
|
8
|
+
extend Notiflows::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Notiflows::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute user_external_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :user_external_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(user_external_id:, request_options: {})
|
|
17
|
+
# @param user_external_id [String]
|
|
18
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
class UpdatePreferencesRequest < ::Notiflows::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute channel_types
|
|
8
|
+
# Global channel type preferences
|
|
9
|
+
#
|
|
10
|
+
# @return [Hash{Symbol=>Boolean}, nil]
|
|
11
|
+
optional :channel_types, ::Notiflows::Internal::Type::HashOf[::Notiflows::Internal::Type::Boolean]
|
|
12
|
+
|
|
13
|
+
# @!attribute notiflows
|
|
14
|
+
# Per-notiflow preferences (keyed by notiflow ID)
|
|
15
|
+
#
|
|
16
|
+
# @return [Hash{Symbol=>::Notiflows::Models::Users::UpdatePreferencesRequest::Notiflow}, nil]
|
|
17
|
+
optional :notiflows,
|
|
18
|
+
-> { ::Notiflows::Internal::Type::HashOf[::Notiflows::Users::UpdatePreferencesRequest::Notiflow] }
|
|
19
|
+
|
|
20
|
+
# @!method initialize(channel_types: nil, notiflows: nil)
|
|
21
|
+
# Request body for updating user preferences. Only provided fields are updated.
|
|
22
|
+
#
|
|
23
|
+
# @param channel_types [Hash{Symbol=>Boolean}] Global channel type preferences
|
|
24
|
+
#
|
|
25
|
+
# @param notiflows [Hash{Symbol=>::Notiflows::Models::Users::UpdatePreferencesRequest::Notiflow}] Per-notiflow preferences (keyed by notiflow ID)
|
|
26
|
+
|
|
27
|
+
class Notiflow < ::Notiflows::Internal::Type::BaseModel
|
|
28
|
+
# @!attribute channel_types
|
|
29
|
+
#
|
|
30
|
+
# @return [Hash{Symbol=>Boolean}, nil]
|
|
31
|
+
optional :channel_types, ::Notiflows::Internal::Type::HashOf[::Notiflows::Internal::Type::Boolean]
|
|
32
|
+
|
|
33
|
+
# @!attribute enabled
|
|
34
|
+
#
|
|
35
|
+
# @return [Boolean, nil]
|
|
36
|
+
optional :enabled, ::Notiflows::Internal::Type::Boolean
|
|
37
|
+
|
|
38
|
+
# @!method initialize(channel_types: nil, enabled: nil)
|
|
39
|
+
# @param channel_types [Hash{Symbol=>Boolean}]
|
|
40
|
+
# @param enabled [Boolean]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
[Notiflows::Internal::Type::BaseModel, *Notiflows::Internal::Type::BaseModel.subclasses].each do |cls|
|
|
5
|
+
cls.define_sorbet_constant!(:OrHash) { T.type_alias { T.any(cls, Notiflows::Internal::AnyHash) } }
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
Notiflows::Internal::Util.walk_namespaces(Notiflows::Models).each do |mod|
|
|
9
|
+
case mod
|
|
10
|
+
in Notiflows::Internal::Type::Enum | Notiflows::Internal::Type::Union
|
|
11
|
+
mod.constants.each do |name|
|
|
12
|
+
case mod.const_get(name)
|
|
13
|
+
in true | false
|
|
14
|
+
mod.define_sorbet_constant!(:TaggedBoolean) { T.type_alias { T::Boolean } }
|
|
15
|
+
mod.define_sorbet_constant!(:OrBoolean) { T.type_alias { T::Boolean } }
|
|
16
|
+
in Integer
|
|
17
|
+
mod.define_sorbet_constant!(:TaggedInteger) { T.type_alias { Integer } }
|
|
18
|
+
mod.define_sorbet_constant!(:OrInteger) { T.type_alias { Integer } }
|
|
19
|
+
in Float
|
|
20
|
+
mod.define_sorbet_constant!(:TaggedFloat) { T.type_alias { Float } }
|
|
21
|
+
mod.define_sorbet_constant!(:OrFloat) { T.type_alias { Float } }
|
|
22
|
+
in Symbol
|
|
23
|
+
mod.define_sorbet_constant!(:TaggedSymbol) { T.type_alias { Symbol } }
|
|
24
|
+
mod.define_sorbet_constant!(:OrSymbol) { T.type_alias { T.any(Symbol, String) } }
|
|
25
|
+
else
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
else
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
Notiflows::Internal::Util.walk_namespaces(Notiflows::Models)
|
|
33
|
+
.lazy
|
|
34
|
+
.grep(Notiflows::Internal::Type::Union)
|
|
35
|
+
.each do |mod|
|
|
36
|
+
const = :Variants
|
|
37
|
+
next if mod.sorbet_constant_defined?(const)
|
|
38
|
+
|
|
39
|
+
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
Delivery = Notiflows::Models::Delivery
|
|
43
|
+
|
|
44
|
+
DeliveryListParams = Notiflows::Models::DeliveryListParams
|
|
45
|
+
|
|
46
|
+
DeliveryRetrieveParams = Notiflows::Models::DeliveryRetrieveParams
|
|
47
|
+
|
|
48
|
+
Notification = Notiflows::Models::Notification
|
|
49
|
+
|
|
50
|
+
NotificationListDeliveriesParams = Notiflows::Models::NotificationListDeliveriesParams
|
|
51
|
+
|
|
52
|
+
NotificationListParams = Notiflows::Models::NotificationListParams
|
|
53
|
+
|
|
54
|
+
NotificationRetrieveParams = Notiflows::Models::NotificationRetrieveParams
|
|
55
|
+
|
|
56
|
+
NotiflowRunParams = Notiflows::Models::NotiflowRunParams
|
|
57
|
+
|
|
58
|
+
Topic = Notiflows::Models::Topic
|
|
59
|
+
|
|
60
|
+
TopicDeleteParams = Notiflows::Models::TopicDeleteParams
|
|
61
|
+
|
|
62
|
+
TopicListParams = Notiflows::Models::TopicListParams
|
|
63
|
+
|
|
64
|
+
TopicRetrieveParams = Notiflows::Models::TopicRetrieveParams
|
|
65
|
+
|
|
66
|
+
Topics = Notiflows::Models::Topics
|
|
67
|
+
|
|
68
|
+
User = Notiflows::Models::User
|
|
69
|
+
|
|
70
|
+
UserDeleteParams = Notiflows::Models::UserDeleteParams
|
|
71
|
+
|
|
72
|
+
UserListParams = Notiflows::Models::UserListParams
|
|
73
|
+
|
|
74
|
+
UserRetrieveParams = Notiflows::Models::UserRetrieveParams
|
|
75
|
+
|
|
76
|
+
Users = Notiflows::Models::Users
|
|
77
|
+
|
|
78
|
+
UserUpsertParams = Notiflows::Models::UserUpsertParams
|
|
79
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
# Specify HTTP behaviour to use for a specific request. These options supplement
|
|
5
|
+
# or override those provided at the client level.
|
|
6
|
+
#
|
|
7
|
+
# When making a request, you can pass an actual {RequestOptions} instance, or
|
|
8
|
+
# simply pass a Hash with symbol keys matching the attributes on this class.
|
|
9
|
+
class RequestOptions < Notiflows::Internal::Type::BaseModel
|
|
10
|
+
# @api private
|
|
11
|
+
#
|
|
12
|
+
# @param opts [Notiflows::RequestOptions, Hash{Symbol=>Object}]
|
|
13
|
+
#
|
|
14
|
+
# @raise [ArgumentError]
|
|
15
|
+
def self.validate!(opts)
|
|
16
|
+
case opts
|
|
17
|
+
in Notiflows::RequestOptions | Hash
|
|
18
|
+
opts.to_h.each_key do |k|
|
|
19
|
+
unless fields.include?(k)
|
|
20
|
+
raise ArgumentError.new("Request `opts` keys must be one of #{fields.keys}, got #{k.inspect}")
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
else
|
|
24
|
+
raise ArgumentError.new("Request `opts` must be a Hash or RequestOptions, got #{opts.inspect}")
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# @!attribute idempotency_key
|
|
29
|
+
# Idempotency key to send with request and all associated retries. Will only be
|
|
30
|
+
# sent for write requests.
|
|
31
|
+
#
|
|
32
|
+
# @return [String, nil]
|
|
33
|
+
optional :idempotency_key, String
|
|
34
|
+
|
|
35
|
+
# @!attribute extra_query
|
|
36
|
+
# Extra query params to send with the request. These are `.merge`’d into any
|
|
37
|
+
# `query` given at the client level.
|
|
38
|
+
#
|
|
39
|
+
# @return [Hash{String=>Array<String>, String, nil}, nil]
|
|
40
|
+
optional :extra_query, Notiflows::Internal::Type::HashOf[Notiflows::Internal::Type::ArrayOf[String]]
|
|
41
|
+
|
|
42
|
+
# @!attribute extra_headers
|
|
43
|
+
# Extra headers to send with the request. These are `.merged`’d into any
|
|
44
|
+
# `extra_headers` given at the client level.
|
|
45
|
+
#
|
|
46
|
+
# @return [Hash{String=>String, nil}, nil]
|
|
47
|
+
optional :extra_headers, Notiflows::Internal::Type::HashOf[String, nil?: true]
|
|
48
|
+
|
|
49
|
+
# @!attribute extra_body
|
|
50
|
+
# Extra data to send with the request. These are deep merged into any data
|
|
51
|
+
# generated as part of the normal request.
|
|
52
|
+
#
|
|
53
|
+
# @return [Object, nil]
|
|
54
|
+
optional :extra_body, Notiflows::Internal::Type::HashOf[Notiflows::Internal::Type::Unknown]
|
|
55
|
+
|
|
56
|
+
# @!attribute max_retries
|
|
57
|
+
# Maximum number of retries to attempt after a failed initial request.
|
|
58
|
+
#
|
|
59
|
+
# @return [Integer, nil]
|
|
60
|
+
optional :max_retries, Integer
|
|
61
|
+
|
|
62
|
+
# @!attribute timeout
|
|
63
|
+
# Request timeout in seconds.
|
|
64
|
+
#
|
|
65
|
+
# @return [Float, nil]
|
|
66
|
+
optional :timeout, Float
|
|
67
|
+
|
|
68
|
+
# @!method initialize(values = {})
|
|
69
|
+
# Returns a new instance of RequestOptions.
|
|
70
|
+
#
|
|
71
|
+
# @param values [Hash{Symbol=>Object}]
|
|
72
|
+
|
|
73
|
+
define_sorbet_constant!(:OrHash) do
|
|
74
|
+
T.type_alias { T.any(Notiflows::RequestOptions, Notiflows::Internal::AnyHash) }
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Resources
|
|
5
|
+
class Deliveries
|
|
6
|
+
# Retrieve details of a single delivery attempt.
|
|
7
|
+
#
|
|
8
|
+
# Includes the rendered content (`data`), channel information, and all timestamp
|
|
9
|
+
# tracking (sent, seen, read, clicked, archived).
|
|
10
|
+
#
|
|
11
|
+
# @overload retrieve(id, request_options: {})
|
|
12
|
+
#
|
|
13
|
+
# @param id [String] Delivery ID (UUID)
|
|
14
|
+
#
|
|
15
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
16
|
+
#
|
|
17
|
+
# @return [Notiflows::Models::Delivery]
|
|
18
|
+
#
|
|
19
|
+
# @see Notiflows::Models::DeliveryRetrieveParams
|
|
20
|
+
def retrieve(id, params = {})
|
|
21
|
+
@client.request(
|
|
22
|
+
method: :get,
|
|
23
|
+
path: ["deliveries/%1$s", id],
|
|
24
|
+
model: ::Notiflows::Delivery,
|
|
25
|
+
options: params[:request_options]
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Retrieve a paginated list of all deliveries in your project.
|
|
30
|
+
#
|
|
31
|
+
# A delivery represents a single attempt to send a notification through a specific
|
|
32
|
+
# channel. Use filters to narrow down results by channel, status, or time range.
|
|
33
|
+
#
|
|
34
|
+
# @overload list(after: nil, before: nil, channel_id: nil, created_after: nil, created_before: nil, limit: nil, status: nil, topic: nil, request_options: {})
|
|
35
|
+
#
|
|
36
|
+
# @param after [String] Cursor for fetching the next page
|
|
37
|
+
#
|
|
38
|
+
# @param before [String] Cursor for fetching the previous page
|
|
39
|
+
#
|
|
40
|
+
# @param channel_id [String] Filter by channel ID (UUID)
|
|
41
|
+
#
|
|
42
|
+
# @param created_after [String] Filter by created after (ISO 8601 datetime)
|
|
43
|
+
#
|
|
44
|
+
# @param created_before [String] Filter by created before (ISO 8601 datetime)
|
|
45
|
+
#
|
|
46
|
+
# @param limit [Integer] Number of items per page (default: 25, max: 1000)
|
|
47
|
+
#
|
|
48
|
+
# @param status [String] Filter by status (pending, sent, failed)
|
|
49
|
+
#
|
|
50
|
+
# @param topic [String] Filter by topic name
|
|
51
|
+
#
|
|
52
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
53
|
+
#
|
|
54
|
+
# @return [Notiflows::Internal::CursorPage<Notiflows::Models::Delivery>]
|
|
55
|
+
#
|
|
56
|
+
# @see Notiflows::Models::DeliveryListParams
|
|
57
|
+
def list(params = {})
|
|
58
|
+
parsed, options = ::Notiflows::DeliveryListParams.dump_request(params)
|
|
59
|
+
@client.request(
|
|
60
|
+
method: :get,
|
|
61
|
+
path: "deliveries",
|
|
62
|
+
query: parsed,
|
|
63
|
+
page: ::Notiflows::Internal::CursorPage,
|
|
64
|
+
model: ::Notiflows::Delivery,
|
|
65
|
+
options: options
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# @api private
|
|
70
|
+
#
|
|
71
|
+
# @param client [Notiflows::Client]
|
|
72
|
+
def initialize(client:)
|
|
73
|
+
@client = client
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Resources
|
|
5
|
+
class Notifications
|
|
6
|
+
# Retrieve a single notification by ID, including the recipient, actor, and all
|
|
7
|
+
# delivery attempts.
|
|
8
|
+
#
|
|
9
|
+
# @overload retrieve(id, request_options: {})
|
|
10
|
+
#
|
|
11
|
+
# @param id [String] Notification ID (UUID)
|
|
12
|
+
#
|
|
13
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
14
|
+
#
|
|
15
|
+
# @return [Notiflows::Models::Notification]
|
|
16
|
+
#
|
|
17
|
+
# @see Notiflows::Models::NotificationRetrieveParams
|
|
18
|
+
def retrieve(id, params = {})
|
|
19
|
+
@client.request(
|
|
20
|
+
method: :get,
|
|
21
|
+
path: ["notifications/%1$s", id],
|
|
22
|
+
model: ::Notiflows::Notification,
|
|
23
|
+
options: params[:request_options]
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Retrieve a paginated list of all notifications in your project.
|
|
28
|
+
#
|
|
29
|
+
# A notification represents a message sent to a single recipient through a
|
|
30
|
+
# notiflow run. Each notification can have multiple deliveries (one per channel).
|
|
31
|
+
#
|
|
32
|
+
# @overload list(after: nil, before: nil, created_after: nil, created_before: nil, limit: nil, status: nil, topic: nil, request_options: {})
|
|
33
|
+
#
|
|
34
|
+
# @param after [String] Cursor for fetching the next page
|
|
35
|
+
#
|
|
36
|
+
# @param before [String] Cursor for fetching the previous page
|
|
37
|
+
#
|
|
38
|
+
# @param created_after [String] Filter by created after (ISO 8601 datetime)
|
|
39
|
+
#
|
|
40
|
+
# @param created_before [String] Filter by created before (ISO 8601 datetime)
|
|
41
|
+
#
|
|
42
|
+
# @param limit [Integer] Number of items per page (default: 25, max: 1000)
|
|
43
|
+
#
|
|
44
|
+
# @param status [String] Filter by status
|
|
45
|
+
#
|
|
46
|
+
# @param topic [String] Filter by topic
|
|
47
|
+
#
|
|
48
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
49
|
+
#
|
|
50
|
+
# @return [Notiflows::Internal::CursorPage<Notiflows::Models::Notification>]
|
|
51
|
+
#
|
|
52
|
+
# @see Notiflows::Models::NotificationListParams
|
|
53
|
+
def list(params = {})
|
|
54
|
+
parsed, options = ::Notiflows::NotificationListParams.dump_request(params)
|
|
55
|
+
@client.request(
|
|
56
|
+
method: :get,
|
|
57
|
+
path: "notifications",
|
|
58
|
+
query: parsed,
|
|
59
|
+
page: ::Notiflows::Internal::CursorPage,
|
|
60
|
+
model: ::Notiflows::Notification,
|
|
61
|
+
options: options
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Retrieve all delivery attempts for a specific notification.
|
|
66
|
+
#
|
|
67
|
+
# @overload 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: {})
|
|
68
|
+
#
|
|
69
|
+
# @param notification_id [String] Notification ID (UUID)
|
|
70
|
+
#
|
|
71
|
+
# @param after [String] Cursor for fetching the next page
|
|
72
|
+
#
|
|
73
|
+
# @param before [String] Cursor for fetching the previous page
|
|
74
|
+
#
|
|
75
|
+
# @param channel_id [String] Filter by channel ID (UUID)
|
|
76
|
+
#
|
|
77
|
+
# @param created_after [String] Filter by created after (ISO 8601 datetime)
|
|
78
|
+
#
|
|
79
|
+
# @param created_before [String] Filter by created before (ISO 8601 datetime)
|
|
80
|
+
#
|
|
81
|
+
# @param limit [Integer] Number of items per page (default: 25, max: 1000)
|
|
82
|
+
#
|
|
83
|
+
# @param status [String] Filter by status (pending, sent, failed)
|
|
84
|
+
#
|
|
85
|
+
# @param topic [String] Filter by topic name
|
|
86
|
+
#
|
|
87
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
88
|
+
#
|
|
89
|
+
# @return [Notiflows::Internal::CursorPage<Notiflows::Models::Delivery>]
|
|
90
|
+
#
|
|
91
|
+
# @see Notiflows::Models::NotificationListDeliveriesParams
|
|
92
|
+
def list_deliveries(notification_id, params = {})
|
|
93
|
+
parsed, options = ::Notiflows::NotificationListDeliveriesParams.dump_request(params)
|
|
94
|
+
@client.request(
|
|
95
|
+
method: :get,
|
|
96
|
+
path: ["notifications/%1$s/deliveries", notification_id],
|
|
97
|
+
query: parsed,
|
|
98
|
+
page: ::Notiflows::Internal::CursorPage,
|
|
99
|
+
model: ::Notiflows::Delivery,
|
|
100
|
+
options: options
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @api private
|
|
105
|
+
#
|
|
106
|
+
# @param client [Notiflows::Client]
|
|
107
|
+
def initialize(client:)
|
|
108
|
+
@client = client
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Resources
|
|
5
|
+
class Notiflows
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {Notiflows::Models::NotiflowRunParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Execute a notiflow to send notifications to one or more recipients.
|
|
10
|
+
#
|
|
11
|
+
# You must provide either `recipients` (direct targeting) or `topic` (pub/sub
|
|
12
|
+
# targeting), but not both.
|
|
13
|
+
#
|
|
14
|
+
# **Direct targeting (`recipients`):** Specify exactly which users should receive
|
|
15
|
+
# the notification. Users are identified by their `external_id`. If a user doesn't
|
|
16
|
+
# exist, they will be created automatically with the provided attributes.
|
|
17
|
+
#
|
|
18
|
+
# **Topic targeting (`topic`):** Send to all users subscribed to the specified
|
|
19
|
+
# topic. Useful for broadcast scenarios.
|
|
20
|
+
#
|
|
21
|
+
# **Template variables:** The `data` object is passed to notification templates.
|
|
22
|
+
# Access variables using Liquid syntax: `{{ data.variable_name }}`
|
|
23
|
+
#
|
|
24
|
+
# @overload run(notiflow_id, actor: nil, data: nil, recipients: nil, topic: nil, request_options: {})
|
|
25
|
+
#
|
|
26
|
+
# @param notiflow_id [String] Notiflow ID (UUID)
|
|
27
|
+
#
|
|
28
|
+
# @param actor [Notiflows::Models::NotiflowRunParams::Actor] Actor (triggering user) specification. Accessible in templates as `actor.*`.
|
|
29
|
+
#
|
|
30
|
+
# @param data [Object] Template variables. Accessible in notification templates as `data.*`.
|
|
31
|
+
#
|
|
32
|
+
# @param recipients [Array<Notiflows::Models::NotiflowRunParams::Recipient>] List of recipients. Each recipient must have an `external_id`. Users are auto-cr
|
|
33
|
+
#
|
|
34
|
+
# @param topic [String] Topic name for pub/sub targeting. Cannot be used with `recipients`.
|
|
35
|
+
#
|
|
36
|
+
# @param request_options [Notiflows::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
37
|
+
#
|
|
38
|
+
# @return [Notiflows::Models::NotiflowRunResponse]
|
|
39
|
+
#
|
|
40
|
+
# @see Notiflows::Models::NotiflowRunParams
|
|
41
|
+
def run(notiflow_id, params = {})
|
|
42
|
+
parsed, options = ::Notiflows::NotiflowRunParams.dump_request(params)
|
|
43
|
+
@client.request(
|
|
44
|
+
method: :post,
|
|
45
|
+
path: ["notiflows/%1$s/run", notiflow_id],
|
|
46
|
+
body: parsed,
|
|
47
|
+
model: ::Notiflows::Models::NotiflowRunResponse,
|
|
48
|
+
options: options
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# @api private
|
|
53
|
+
#
|
|
54
|
+
# @param client [Notiflows::Client]
|
|
55
|
+
def initialize(client:)
|
|
56
|
+
@client = client
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|