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,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
class SubscriptionRetrieveParams < Notiflows::Internal::Type::BaseModel
|
|
7
|
+
extend Notiflows::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Notiflows::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Notiflows::Users::SubscriptionRetrieveParams,
|
|
14
|
+
Notiflows::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :user_external_id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
user_external_id: String,
|
|
24
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(user_external_id:, request_options: {})
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
override.returns(
|
|
32
|
+
{
|
|
33
|
+
user_external_id: String,
|
|
34
|
+
request_options: Notiflows::RequestOptions
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
def to_hash
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
class SubscriptionSubscribeParams < Notiflows::Internal::Type::BaseModel
|
|
7
|
+
extend Notiflows::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Notiflows::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Notiflows::Users::SubscriptionSubscribeParams,
|
|
14
|
+
Notiflows::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
# Name of the topic to subscribe to. Topics are created automatically if they
|
|
19
|
+
# don't exist.
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :topic_name
|
|
22
|
+
|
|
23
|
+
sig do
|
|
24
|
+
params(
|
|
25
|
+
topic_name: String,
|
|
26
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
27
|
+
).returns(T.attached_class)
|
|
28
|
+
end
|
|
29
|
+
def self.new(
|
|
30
|
+
# Name of the topic to subscribe to. Topics are created automatically if they
|
|
31
|
+
# don't exist.
|
|
32
|
+
topic_name:,
|
|
33
|
+
request_options: {}
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
sig do
|
|
38
|
+
override.returns(
|
|
39
|
+
{ topic_name: String, request_options: Notiflows::RequestOptions }
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
class SubscriptionUnsubscribeParams < Notiflows::Internal::Type::BaseModel
|
|
7
|
+
extend Notiflows::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Notiflows::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Notiflows::Users::SubscriptionUnsubscribeParams,
|
|
14
|
+
Notiflows::Internal::AnyHash
|
|
15
|
+
)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
sig { returns(String) }
|
|
19
|
+
attr_accessor :user_external_id
|
|
20
|
+
|
|
21
|
+
sig do
|
|
22
|
+
params(
|
|
23
|
+
user_external_id: String,
|
|
24
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
25
|
+
).returns(T.attached_class)
|
|
26
|
+
end
|
|
27
|
+
def self.new(user_external_id:, request_options: {})
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig do
|
|
31
|
+
override.returns(
|
|
32
|
+
{
|
|
33
|
+
user_external_id: String,
|
|
34
|
+
request_options: Notiflows::RequestOptions
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
end
|
|
38
|
+
def to_hash
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
class UpdatePreferencesRequest < ::Notiflows::Internal::Type::BaseModel
|
|
7
|
+
OrHash =
|
|
8
|
+
T.type_alias do
|
|
9
|
+
T.any(
|
|
10
|
+
::Notiflows::Users::UpdatePreferencesRequest,
|
|
11
|
+
::Notiflows::Internal::AnyHash
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Global channel type preferences
|
|
16
|
+
sig { returns(T.nilable(T::Hash[Symbol, T::Boolean])) }
|
|
17
|
+
attr_reader :channel_types
|
|
18
|
+
|
|
19
|
+
sig { params(channel_types: T::Hash[Symbol, T::Boolean]).void }
|
|
20
|
+
attr_writer :channel_types
|
|
21
|
+
|
|
22
|
+
# Per-notiflow preferences (keyed by notiflow ID)
|
|
23
|
+
sig do
|
|
24
|
+
returns(
|
|
25
|
+
T.nilable(
|
|
26
|
+
T::Hash[
|
|
27
|
+
Symbol,
|
|
28
|
+
::Notiflows::Users::UpdatePreferencesRequest::Notiflow
|
|
29
|
+
]
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
attr_reader :notiflows
|
|
34
|
+
|
|
35
|
+
sig do
|
|
36
|
+
params(
|
|
37
|
+
notiflows:
|
|
38
|
+
T::Hash[
|
|
39
|
+
Symbol,
|
|
40
|
+
::Notiflows::Users::UpdatePreferencesRequest::Notiflow::OrHash
|
|
41
|
+
]
|
|
42
|
+
).void
|
|
43
|
+
end
|
|
44
|
+
attr_writer :notiflows
|
|
45
|
+
|
|
46
|
+
# Request body for updating user preferences. Only provided fields are updated.
|
|
47
|
+
sig do
|
|
48
|
+
params(
|
|
49
|
+
channel_types: T::Hash[Symbol, T::Boolean],
|
|
50
|
+
notiflows:
|
|
51
|
+
T::Hash[
|
|
52
|
+
Symbol,
|
|
53
|
+
::Notiflows::Users::UpdatePreferencesRequest::Notiflow::OrHash
|
|
54
|
+
]
|
|
55
|
+
).returns(T.attached_class)
|
|
56
|
+
end
|
|
57
|
+
def self.new(
|
|
58
|
+
# Global channel type preferences
|
|
59
|
+
channel_types: nil,
|
|
60
|
+
# Per-notiflow preferences (keyed by notiflow ID)
|
|
61
|
+
notiflows: nil
|
|
62
|
+
)
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
sig do
|
|
66
|
+
override.returns(
|
|
67
|
+
{
|
|
68
|
+
channel_types: T::Hash[Symbol, T::Boolean],
|
|
69
|
+
notiflows:
|
|
70
|
+
T::Hash[
|
|
71
|
+
Symbol,
|
|
72
|
+
::Notiflows::Users::UpdatePreferencesRequest::Notiflow
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
end
|
|
77
|
+
def to_hash
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
class Notiflow < ::Notiflows::Internal::Type::BaseModel
|
|
81
|
+
OrHash =
|
|
82
|
+
T.type_alias do
|
|
83
|
+
T.any(
|
|
84
|
+
::Notiflows::Users::UpdatePreferencesRequest::Notiflow,
|
|
85
|
+
::Notiflows::Internal::AnyHash
|
|
86
|
+
)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
sig { returns(T.nilable(T::Hash[Symbol, T::Boolean])) }
|
|
90
|
+
attr_reader :channel_types
|
|
91
|
+
|
|
92
|
+
sig { params(channel_types: T::Hash[Symbol, T::Boolean]).void }
|
|
93
|
+
attr_writer :channel_types
|
|
94
|
+
|
|
95
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
96
|
+
attr_reader :enabled
|
|
97
|
+
|
|
98
|
+
sig { params(enabled: T::Boolean).void }
|
|
99
|
+
attr_writer :enabled
|
|
100
|
+
|
|
101
|
+
sig do
|
|
102
|
+
params(
|
|
103
|
+
channel_types: T::Hash[Symbol, T::Boolean],
|
|
104
|
+
enabled: T::Boolean
|
|
105
|
+
).returns(T.attached_class)
|
|
106
|
+
end
|
|
107
|
+
def self.new(channel_types: nil, enabled: nil)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
sig do
|
|
111
|
+
override.returns(
|
|
112
|
+
{
|
|
113
|
+
channel_types: T::Hash[Symbol, T::Boolean],
|
|
114
|
+
enabled: T::Boolean
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
end
|
|
118
|
+
def to_hash
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
Delivery = Notiflows::Models::Delivery
|
|
5
|
+
|
|
6
|
+
DeliveryListParams = Notiflows::Models::DeliveryListParams
|
|
7
|
+
|
|
8
|
+
DeliveryRetrieveParams = Notiflows::Models::DeliveryRetrieveParams
|
|
9
|
+
|
|
10
|
+
Notification = Notiflows::Models::Notification
|
|
11
|
+
|
|
12
|
+
NotificationListDeliveriesParams =
|
|
13
|
+
Notiflows::Models::NotificationListDeliveriesParams
|
|
14
|
+
|
|
15
|
+
NotificationListParams = Notiflows::Models::NotificationListParams
|
|
16
|
+
|
|
17
|
+
NotificationRetrieveParams = Notiflows::Models::NotificationRetrieveParams
|
|
18
|
+
|
|
19
|
+
NotiflowRunParams = Notiflows::Models::NotiflowRunParams
|
|
20
|
+
|
|
21
|
+
Topic = Notiflows::Models::Topic
|
|
22
|
+
|
|
23
|
+
TopicDeleteParams = Notiflows::Models::TopicDeleteParams
|
|
24
|
+
|
|
25
|
+
TopicListParams = Notiflows::Models::TopicListParams
|
|
26
|
+
|
|
27
|
+
TopicRetrieveParams = Notiflows::Models::TopicRetrieveParams
|
|
28
|
+
|
|
29
|
+
Topics = Notiflows::Models::Topics
|
|
30
|
+
|
|
31
|
+
User = Notiflows::Models::User
|
|
32
|
+
|
|
33
|
+
UserDeleteParams = Notiflows::Models::UserDeleteParams
|
|
34
|
+
|
|
35
|
+
UserListParams = Notiflows::Models::UserListParams
|
|
36
|
+
|
|
37
|
+
UserRetrieveParams = Notiflows::Models::UserRetrieveParams
|
|
38
|
+
|
|
39
|
+
Users = Notiflows::Models::Users
|
|
40
|
+
|
|
41
|
+
UserUpsertParams = Notiflows::Models::UserUpsertParams
|
|
42
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# typed: strong
|
|
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
|
+
OrHash =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(Notiflows::RequestOptions, Notiflows::Internal::AnyHash)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# @api private
|
|
16
|
+
sig { params(opts: Notiflows::RequestOptions::OrHash).void }
|
|
17
|
+
def self.validate!(opts)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Idempotency key to send with request and all associated retries. Will only be
|
|
21
|
+
# sent for write requests.
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :idempotency_key
|
|
24
|
+
|
|
25
|
+
# Extra query params to send with the request. These are `.merge`’d into any
|
|
26
|
+
# `query` given at the client level.
|
|
27
|
+
sig do
|
|
28
|
+
returns(
|
|
29
|
+
T.nilable(T::Hash[String, T.nilable(T.any(T::Array[String], String))])
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
attr_accessor :extra_query
|
|
33
|
+
|
|
34
|
+
# Extra headers to send with the request. These are `.merged`’d into any
|
|
35
|
+
# `extra_headers` given at the client level.
|
|
36
|
+
sig { returns(T.nilable(T::Hash[String, T.nilable(String)])) }
|
|
37
|
+
attr_accessor :extra_headers
|
|
38
|
+
|
|
39
|
+
# Extra data to send with the request. These are deep merged into any data
|
|
40
|
+
# generated as part of the normal request.
|
|
41
|
+
sig { returns(T.nilable(T.anything)) }
|
|
42
|
+
attr_accessor :extra_body
|
|
43
|
+
|
|
44
|
+
# Maximum number of retries to attempt after a failed initial request.
|
|
45
|
+
sig { returns(T.nilable(Integer)) }
|
|
46
|
+
attr_accessor :max_retries
|
|
47
|
+
|
|
48
|
+
# Request timeout in seconds.
|
|
49
|
+
sig { returns(T.nilable(Float)) }
|
|
50
|
+
attr_accessor :timeout
|
|
51
|
+
|
|
52
|
+
# Returns a new instance of RequestOptions.
|
|
53
|
+
sig do
|
|
54
|
+
params(values: Notiflows::Internal::AnyHash).returns(T.attached_class)
|
|
55
|
+
end
|
|
56
|
+
def self.new(values = {})
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# typed: strong
|
|
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
|
+
sig do
|
|
11
|
+
params(
|
|
12
|
+
id: String,
|
|
13
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
14
|
+
).returns(Notiflows::Delivery)
|
|
15
|
+
end
|
|
16
|
+
def retrieve(
|
|
17
|
+
# Delivery ID (UUID)
|
|
18
|
+
id,
|
|
19
|
+
request_options: {}
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Retrieve a paginated list of all deliveries in your project.
|
|
24
|
+
#
|
|
25
|
+
# A delivery represents a single attempt to send a notification through a specific
|
|
26
|
+
# channel. Use filters to narrow down results by channel, status, or time range.
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
after: String,
|
|
30
|
+
before: String,
|
|
31
|
+
channel_id: String,
|
|
32
|
+
created_after: String,
|
|
33
|
+
created_before: String,
|
|
34
|
+
limit: Integer,
|
|
35
|
+
status: String,
|
|
36
|
+
topic: String,
|
|
37
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
38
|
+
).returns(Notiflows::Internal::CursorPage[Notiflows::Delivery])
|
|
39
|
+
end
|
|
40
|
+
def list(
|
|
41
|
+
# Cursor for fetching the next page
|
|
42
|
+
after: nil,
|
|
43
|
+
# Cursor for fetching the previous page
|
|
44
|
+
before: nil,
|
|
45
|
+
# Filter by channel ID (UUID)
|
|
46
|
+
channel_id: nil,
|
|
47
|
+
# Filter by created after (ISO 8601 datetime)
|
|
48
|
+
created_after: nil,
|
|
49
|
+
# Filter by created before (ISO 8601 datetime)
|
|
50
|
+
created_before: nil,
|
|
51
|
+
# Number of items per page (default: 25, max: 1000)
|
|
52
|
+
limit: nil,
|
|
53
|
+
# Filter by status (pending, sent, failed)
|
|
54
|
+
status: nil,
|
|
55
|
+
# Filter by topic name
|
|
56
|
+
topic: nil,
|
|
57
|
+
request_options: {}
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# @api private
|
|
62
|
+
sig { params(client: Notiflows::Client).returns(T.attached_class) }
|
|
63
|
+
def self.new(client:)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# typed: strong
|
|
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
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
id: String,
|
|
11
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
12
|
+
).returns(Notiflows::Notification)
|
|
13
|
+
end
|
|
14
|
+
def retrieve(
|
|
15
|
+
# Notification ID (UUID)
|
|
16
|
+
id,
|
|
17
|
+
request_options: {}
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Retrieve a paginated list of all notifications in your project.
|
|
22
|
+
#
|
|
23
|
+
# A notification represents a message sent to a single recipient through a
|
|
24
|
+
# notiflow run. Each notification can have multiple deliveries (one per channel).
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
after: String,
|
|
28
|
+
before: String,
|
|
29
|
+
created_after: String,
|
|
30
|
+
created_before: String,
|
|
31
|
+
limit: Integer,
|
|
32
|
+
status: String,
|
|
33
|
+
topic: String,
|
|
34
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
35
|
+
).returns(Notiflows::Internal::CursorPage[Notiflows::Notification])
|
|
36
|
+
end
|
|
37
|
+
def list(
|
|
38
|
+
# Cursor for fetching the next page
|
|
39
|
+
after: nil,
|
|
40
|
+
# Cursor for fetching the previous page
|
|
41
|
+
before: nil,
|
|
42
|
+
# Filter by created after (ISO 8601 datetime)
|
|
43
|
+
created_after: nil,
|
|
44
|
+
# Filter by created before (ISO 8601 datetime)
|
|
45
|
+
created_before: nil,
|
|
46
|
+
# Number of items per page (default: 25, max: 1000)
|
|
47
|
+
limit: nil,
|
|
48
|
+
# Filter by status
|
|
49
|
+
status: nil,
|
|
50
|
+
# Filter by topic
|
|
51
|
+
topic: nil,
|
|
52
|
+
request_options: {}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Retrieve all delivery attempts for a specific notification.
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
notification_id: String,
|
|
60
|
+
after: String,
|
|
61
|
+
before: String,
|
|
62
|
+
channel_id: String,
|
|
63
|
+
created_after: String,
|
|
64
|
+
created_before: String,
|
|
65
|
+
limit: Integer,
|
|
66
|
+
status: String,
|
|
67
|
+
topic: String,
|
|
68
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
69
|
+
).returns(Notiflows::Internal::CursorPage[Notiflows::Delivery])
|
|
70
|
+
end
|
|
71
|
+
def list_deliveries(
|
|
72
|
+
# Notification ID (UUID)
|
|
73
|
+
notification_id,
|
|
74
|
+
# Cursor for fetching the next page
|
|
75
|
+
after: nil,
|
|
76
|
+
# Cursor for fetching the previous page
|
|
77
|
+
before: nil,
|
|
78
|
+
# Filter by channel ID (UUID)
|
|
79
|
+
channel_id: nil,
|
|
80
|
+
# Filter by created after (ISO 8601 datetime)
|
|
81
|
+
created_after: nil,
|
|
82
|
+
# Filter by created before (ISO 8601 datetime)
|
|
83
|
+
created_before: nil,
|
|
84
|
+
# Number of items per page (default: 25, max: 1000)
|
|
85
|
+
limit: nil,
|
|
86
|
+
# Filter by status (pending, sent, failed)
|
|
87
|
+
status: nil,
|
|
88
|
+
# Filter by topic name
|
|
89
|
+
topic: nil,
|
|
90
|
+
request_options: {}
|
|
91
|
+
)
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# @api private
|
|
95
|
+
sig { params(client: Notiflows::Client).returns(T.attached_class) }
|
|
96
|
+
def self.new(client:)
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Resources
|
|
5
|
+
class Notiflows
|
|
6
|
+
# Execute a notiflow to send notifications to one or more recipients.
|
|
7
|
+
#
|
|
8
|
+
# You must provide either `recipients` (direct targeting) or `topic` (pub/sub
|
|
9
|
+
# targeting), but not both.
|
|
10
|
+
#
|
|
11
|
+
# **Direct targeting (`recipients`):** Specify exactly which users should receive
|
|
12
|
+
# the notification. Users are identified by their `external_id`. If a user doesn't
|
|
13
|
+
# exist, they will be created automatically with the provided attributes.
|
|
14
|
+
#
|
|
15
|
+
# **Topic targeting (`topic`):** Send to all users subscribed to the specified
|
|
16
|
+
# topic. Useful for broadcast scenarios.
|
|
17
|
+
#
|
|
18
|
+
# **Template variables:** The `data` object is passed to notification templates.
|
|
19
|
+
# Access variables using Liquid syntax: `{{ data.variable_name }}`
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
notiflow_id: String,
|
|
23
|
+
actor: Notiflows::NotiflowRunParams::Actor::OrHash,
|
|
24
|
+
data: T.anything,
|
|
25
|
+
recipients: T::Array[Notiflows::NotiflowRunParams::Recipient::OrHash],
|
|
26
|
+
topic: String,
|
|
27
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
28
|
+
).returns(Notiflows::Models::NotiflowRunResponse)
|
|
29
|
+
end
|
|
30
|
+
def run(
|
|
31
|
+
# Notiflow ID (UUID)
|
|
32
|
+
notiflow_id,
|
|
33
|
+
# Actor (triggering user) specification. Accessible in templates as `actor.*`.
|
|
34
|
+
actor: nil,
|
|
35
|
+
# Template variables. Accessible in notification templates as `data.*`.
|
|
36
|
+
data: nil,
|
|
37
|
+
# List of recipients. Each recipient must have an `external_id`. Users are
|
|
38
|
+
# auto-created if they don't exist.
|
|
39
|
+
recipients: nil,
|
|
40
|
+
# Topic name for pub/sub targeting. Cannot be used with `recipients`.
|
|
41
|
+
topic: nil,
|
|
42
|
+
request_options: {}
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @api private
|
|
47
|
+
sig { params(client: Notiflows::Client).returns(T.attached_class) }
|
|
48
|
+
def self.new(client:)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Notiflows
|
|
4
|
+
module Resources
|
|
5
|
+
class Topics
|
|
6
|
+
class Subscriptions
|
|
7
|
+
# Retrieve all users subscribed to a specific topic.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
topic_id: String,
|
|
11
|
+
after: String,
|
|
12
|
+
before: String,
|
|
13
|
+
created_after: String,
|
|
14
|
+
created_before: String,
|
|
15
|
+
limit: Integer,
|
|
16
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
17
|
+
).returns(
|
|
18
|
+
Notiflows::Internal::CursorPage[Notiflows::Users::Subscription]
|
|
19
|
+
)
|
|
20
|
+
end
|
|
21
|
+
def list(
|
|
22
|
+
# Topic name
|
|
23
|
+
topic_id,
|
|
24
|
+
# Cursor for fetching the next page
|
|
25
|
+
after: nil,
|
|
26
|
+
# Cursor for fetching the previous page
|
|
27
|
+
before: nil,
|
|
28
|
+
# Filter by created after (ISO 8601 datetime)
|
|
29
|
+
created_after: nil,
|
|
30
|
+
# Filter by created before (ISO 8601 datetime)
|
|
31
|
+
created_before: nil,
|
|
32
|
+
# Number of items per page (default: 25, max: 1000)
|
|
33
|
+
limit: nil,
|
|
34
|
+
request_options: {}
|
|
35
|
+
)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Subscribe multiple users to a topic in a single request.
|
|
39
|
+
#
|
|
40
|
+
# - Topics are created automatically if they don't exist.
|
|
41
|
+
# - If a user is already subscribed, they are included in the `successful`
|
|
42
|
+
# response.
|
|
43
|
+
# - Returns `207 Multi-Status` if some subscriptions failed.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
topic_id: String,
|
|
47
|
+
user_external_ids: T::Array[String],
|
|
48
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
49
|
+
).returns(Notiflows::Topics::BulkOperationResponse)
|
|
50
|
+
end
|
|
51
|
+
def subscribe_bulk(
|
|
52
|
+
# Topic name
|
|
53
|
+
topic_id,
|
|
54
|
+
# List of user external IDs to subscribe/unsubscribe
|
|
55
|
+
user_external_ids:,
|
|
56
|
+
request_options: {}
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Unsubscribe multiple users from a topic in a single request.
|
|
61
|
+
#
|
|
62
|
+
# - Returns `207 Multi-Status` if some unsubscriptions failed (e.g., user not
|
|
63
|
+
# found).
|
|
64
|
+
# - Users not subscribed to the topic are included in the `failed` response.
|
|
65
|
+
sig do
|
|
66
|
+
params(
|
|
67
|
+
topic_id: String,
|
|
68
|
+
user_external_ids: T::Array[String],
|
|
69
|
+
request_options: Notiflows::RequestOptions::OrHash
|
|
70
|
+
).returns(Notiflows::Topics::BulkOperationResponse)
|
|
71
|
+
end
|
|
72
|
+
def unsubscribe_bulk(
|
|
73
|
+
# Topic name
|
|
74
|
+
topic_id,
|
|
75
|
+
# List of user external IDs to subscribe/unsubscribe
|
|
76
|
+
user_external_ids:,
|
|
77
|
+
request_options: {}
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# @api private
|
|
82
|
+
sig { params(client: Notiflows::Client).returns(T.attached_class) }
|
|
83
|
+
def self.new(client:)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|