trycourier 4.8.0 → 4.10.0
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 +4 -4
- data/CHANGELOG.md +41 -0
- data/README.md +1 -1
- data/lib/courier/client.rb +8 -0
- data/lib/courier/internal/util.rb +19 -6
- data/lib/courier/models/associated_notification_list_response.rb +24 -0
- data/lib/courier/models/channel.rb +75 -0
- data/lib/courier/models/channel_metadata.rb +15 -0
- data/lib/courier/models/element_with_checksums.rb +60 -0
- data/lib/courier/models/elemental_content.rb +2 -2
- data/lib/courier/models/elemental_html_node_with_type.rb +24 -0
- data/lib/courier/models/elemental_node.rb +3 -1
- data/lib/courier/models/message_channels.rb +8 -0
- data/lib/courier/models/message_providers.rb +8 -0
- data/lib/courier/models/message_providers_type.rb +38 -0
- data/lib/courier/models/metadata.rb +15 -0
- data/lib/courier/models/notification_archive_params.rb +20 -0
- data/lib/courier/models/notification_content_get_response.rb +26 -0
- data/lib/courier/models/notification_content_mutation_response.rb +61 -0
- data/lib/courier/models/notification_content_put_request.rb +51 -0
- data/lib/courier/models/notification_create_params.rb +14 -0
- data/lib/courier/models/notification_element_put_request.rb +62 -0
- data/lib/courier/models/notification_get_content.rb +0 -1
- data/lib/courier/models/notification_list_params.rb +13 -4
- data/lib/courier/models/notification_list_response.rb +108 -93
- data/lib/courier/models/notification_list_versions_params.rb +37 -0
- data/lib/courier/models/notification_locale_put_request.rb +39 -0
- data/lib/courier/models/notification_publish_params.rb +20 -0
- data/lib/courier/models/notification_put_content_params.rb +20 -0
- data/lib/courier/models/notification_put_element_params.rb +26 -0
- data/lib/courier/models/notification_put_locale_params.rb +26 -0
- data/lib/courier/models/notification_replace_params.rb +20 -0
- data/lib/courier/models/notification_retrieve_content_params.rb +14 -1
- data/lib/courier/models/notification_retrieve_content_response.rb +21 -0
- data/lib/courier/models/notification_retrieve_params.rb +33 -0
- data/lib/courier/models/notification_template_create_request.rb +45 -0
- data/lib/courier/models/notification_template_get_response.rb +92 -0
- data/lib/courier/models/notification_template_mutation_response.rb +51 -0
- data/lib/courier/models/notification_template_payload.rb +98 -0
- data/lib/courier/models/notification_template_publish_request.rb +19 -0
- data/lib/courier/models/notification_template_state.rb +16 -0
- data/lib/courier/models/notification_template_summary.rb +81 -0
- data/lib/courier/models/notification_template_update_request.rb +46 -0
- data/lib/courier/models/notification_template_version_list_response.rb +22 -0
- data/lib/courier/models/provider.rb +67 -0
- data/lib/courier/models/provider_create_params.rb +52 -0
- data/lib/courier/models/provider_delete_params.rb +20 -0
- data/lib/courier/models/provider_list_params.rb +22 -0
- data/lib/courier/models/provider_list_response.rb +24 -0
- data/lib/courier/models/provider_retrieve_params.rb +20 -0
- data/lib/courier/models/provider_update_params.rb +58 -0
- data/lib/courier/models/providers/catalog_list_params.rb +44 -0
- data/lib/courier/models/providers/catalog_list_response.rb +26 -0
- data/lib/courier/models/providers_catalog_entry.rb +86 -0
- data/lib/courier/models/routing_strategy_archive_params.rb +20 -0
- data/lib/courier/models/routing_strategy_create_params.rb +14 -0
- data/lib/courier/models/routing_strategy_create_request.rb +58 -0
- data/lib/courier/models/routing_strategy_get_response.rb +99 -0
- data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
- data/lib/courier/models/routing_strategy_list_params.rb +30 -0
- data/lib/courier/models/routing_strategy_list_response.rb +24 -0
- data/lib/courier/models/routing_strategy_mutation_response.rb +19 -0
- data/lib/courier/models/routing_strategy_replace_params.rb +20 -0
- data/lib/courier/models/routing_strategy_replace_request.rb +59 -0
- data/lib/courier/models/routing_strategy_retrieve_params.rb +20 -0
- data/lib/courier/models/routing_strategy_summary.rb +75 -0
- data/lib/courier/models/send_message_params.rb +6 -154
- data/lib/courier/models/tenant_template_input.rb +6 -152
- data/lib/courier/models/timeouts.rb +21 -0
- data/lib/courier/models/version_node.rb +46 -0
- data/lib/courier/models.rb +110 -0
- data/lib/courier/resources/notifications.rb +289 -12
- data/lib/courier/resources/providers/catalog.rb +49 -0
- data/lib/courier/resources/providers.rb +150 -0
- data/lib/courier/resources/routing_strategies.rb +179 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +60 -2
- data/rbi/courier/client.rbi +6 -0
- data/rbi/courier/internal/util.rbi +8 -0
- data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
- data/rbi/courier/models/channel.rbi +106 -0
- data/rbi/courier/models/channel_metadata.rbi +28 -0
- data/rbi/courier/models/element_with_checksums.rbi +109 -0
- data/rbi/courier/models/elemental_content.rbi +6 -3
- data/rbi/courier/models/elemental_html_node_with_type.rbi +59 -0
- data/rbi/courier/models/elemental_node.rbi +2 -1
- data/rbi/courier/models/message_channels.rbi +11 -0
- data/rbi/courier/models/message_providers.rbi +11 -0
- data/rbi/courier/models/message_providers_type.rbi +60 -0
- data/rbi/courier/models/metadata.rbi +26 -0
- data/rbi/courier/models/notification_archive_params.rbi +35 -0
- data/rbi/courier/models/notification_content_get_response.rbi +45 -0
- data/rbi/courier/models/notification_content_mutation_response.rbi +95 -0
- data/rbi/courier/models/notification_content_put_request.rbi +145 -0
- data/rbi/courier/models/notification_create_params.rbi +27 -0
- data/rbi/courier/models/notification_element_put_request.rbi +98 -0
- data/rbi/courier/models/notification_list_params.rbi +15 -2
- data/rbi/courier/models/notification_list_response.rbi +159 -119
- data/rbi/courier/models/notification_list_versions_params.rbi +66 -0
- data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
- data/rbi/courier/models/notification_publish_params.rbi +35 -0
- data/rbi/courier/models/notification_put_content_params.rbi +38 -0
- data/rbi/courier/models/notification_put_element_params.rbi +46 -0
- data/rbi/courier/models/notification_put_locale_params.rbi +46 -0
- data/rbi/courier/models/notification_replace_params.rbi +35 -0
- data/rbi/courier/models/notification_retrieve_content_params.rbi +21 -2
- data/rbi/courier/models/notification_retrieve_content_response.rbi +29 -0
- data/rbi/courier/models/notification_retrieve_params.rbi +54 -0
- data/rbi/courier/models/notification_template_create_request.rbi +102 -0
- data/rbi/courier/models/notification_template_get_response.rbi +162 -0
- data/rbi/courier/models/notification_template_mutation_response.rbi +121 -0
- data/rbi/courier/models/notification_template_payload.rbi +183 -0
- data/rbi/courier/models/notification_template_publish_request.rbi +35 -0
- data/rbi/courier/models/notification_template_state.rbi +26 -0
- data/rbi/courier/models/notification_template_summary.rbi +124 -0
- data/rbi/courier/models/notification_template_update_request.rbi +103 -0
- data/rbi/courier/models/notification_template_version_list_response.rbi +41 -0
- data/rbi/courier/models/provider.rbi +87 -0
- data/rbi/courier/models/provider_create_params.rbi +82 -0
- data/rbi/courier/models/provider_delete_params.rbi +35 -0
- data/rbi/courier/models/provider_list_params.rbi +43 -0
- data/rbi/courier/models/provider_list_response.rbi +42 -0
- data/rbi/courier/models/provider_retrieve_params.rbi +35 -0
- data/rbi/courier/models/provider_update_params.rbi +86 -0
- data/rbi/courier/models/providers/catalog_list_params.rbi +75 -0
- data/rbi/courier/models/providers/catalog_list_response.rbi +47 -0
- data/rbi/courier/models/providers_catalog_entry.rbi +129 -0
- data/rbi/courier/models/routing_strategy_archive_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_create_params.rbi +30 -0
- data/rbi/courier/models/routing_strategy_create_request.rbi +86 -0
- data/rbi/courier/models/routing_strategy_get_response.rbi +121 -0
- data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
- data/rbi/courier/models/routing_strategy_list_params.rbi +54 -0
- data/rbi/courier/models/routing_strategy_list_response.rbi +45 -0
- data/rbi/courier/models/routing_strategy_mutation_response.rbi +31 -0
- data/rbi/courier/models/routing_strategy_replace_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_replace_request.rbi +87 -0
- data/rbi/courier/models/routing_strategy_retrieve_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_summary.rbi +95 -0
- data/rbi/courier/models/send_message_params.rbi +6 -362
- data/rbi/courier/models/tenant_template_input.rbi +8 -336
- data/rbi/courier/models/timeouts.rbi +33 -0
- data/rbi/courier/models/version_node.rbi +65 -0
- data/rbi/courier/models.rbi +122 -0
- data/rbi/courier/resources/notifications.rbi +222 -6
- data/rbi/courier/resources/providers/catalog.rbi +38 -0
- data/rbi/courier/resources/providers.rbi +116 -0
- data/rbi/courier/resources/routing_strategies.rbi +147 -0
- data/sig/courier/client.rbs +4 -0
- data/sig/courier/internal/util.rbs +4 -0
- data/sig/courier/models/associated_notification_list_response.rbs +25 -0
- data/sig/courier/models/channel.rbs +61 -0
- data/sig/courier/models/channel_metadata.rbs +13 -0
- data/sig/courier/models/element_with_checksums.rbs +60 -0
- data/sig/courier/models/elemental_html_node_with_type.rbs +32 -0
- data/sig/courier/models/elemental_node.rbs +1 -0
- data/sig/courier/models/message_channels.rbs +7 -0
- data/sig/courier/models/message_providers.rbs +7 -0
- data/sig/courier/models/message_providers_type.rbs +35 -0
- data/sig/courier/models/metadata.rbs +13 -0
- data/sig/courier/models/notification_archive_params.rbs +20 -0
- data/sig/courier/models/notification_content_get_response.rbs +22 -0
- data/sig/courier/models/notification_content_mutation_response.rbs +47 -0
- data/sig/courier/models/notification_content_put_request.rbs +50 -0
- data/sig/courier/models/notification_create_params.rbs +15 -0
- data/sig/courier/models/notification_element_put_request.rbs +64 -0
- data/sig/courier/models/notification_list_params.rbs +7 -1
- data/sig/courier/models/notification_list_response.rbs +81 -71
- data/sig/courier/models/notification_list_versions_params.rbs +36 -0
- data/sig/courier/models/notification_locale_put_request.rbs +39 -0
- data/sig/courier/models/notification_publish_params.rbs +22 -0
- data/sig/courier/models/notification_put_content_params.rbs +22 -0
- data/sig/courier/models/notification_put_element_params.rbs +32 -0
- data/sig/courier/models/notification_put_locale_params.rbs +32 -0
- data/sig/courier/models/notification_replace_params.rbs +22 -0
- data/sig/courier/models/notification_retrieve_content_params.rbs +12 -2
- data/sig/courier/models/notification_retrieve_content_response.rbs +12 -0
- data/sig/courier/models/notification_retrieve_params.rbs +30 -0
- data/sig/courier/models/notification_template_create_request.rbs +40 -0
- data/sig/courier/models/notification_template_get_response.rbs +72 -0
- data/sig/courier/models/notification_template_mutation_response.rbs +46 -0
- data/sig/courier/models/notification_template_payload.rbs +75 -0
- data/sig/courier/models/notification_template_publish_request.rbs +15 -0
- data/sig/courier/models/notification_template_state.rbs +14 -0
- data/sig/courier/models/notification_template_summary.rbs +70 -0
- data/sig/courier/models/notification_template_update_request.rbs +40 -0
- data/sig/courier/models/notification_template_version_list_response.rbs +22 -0
- data/sig/courier/models/provider.rbs +52 -0
- data/sig/courier/models/provider_create_params.rbs +47 -0
- data/sig/courier/models/provider_delete_params.rbs +20 -0
- data/sig/courier/models/provider_list_params.rbs +25 -0
- data/sig/courier/models/provider_list_response.rbs +22 -0
- data/sig/courier/models/provider_retrieve_params.rbs +20 -0
- data/sig/courier/models/provider_update_params.rbs +52 -0
- data/sig/courier/models/providers/catalog_list_params.rbs +40 -0
- data/sig/courier/models/providers/catalog_list_response.rbs +27 -0
- data/sig/courier/models/providers_catalog_entry.rbs +64 -0
- data/sig/courier/models/routing_strategy_archive_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_create_params.rbs +15 -0
- data/sig/courier/models/routing_strategy_create_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_get_response.rbs +70 -0
- data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
- data/sig/courier/models/routing_strategy_list_params.rbs +30 -0
- data/sig/courier/models/routing_strategy_list_response.rbs +25 -0
- data/sig/courier/models/routing_strategy_mutation_response.rbs +13 -0
- data/sig/courier/models/routing_strategy_replace_params.rbs +22 -0
- data/sig/courier/models/routing_strategy_replace_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_retrieve_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_summary.rbs +55 -0
- data/sig/courier/models/send_message_params.rbs +8 -130
- data/sig/courier/models/tenant_template_input.rbs +12 -134
- data/sig/courier/models/timeouts.rbs +15 -0
- data/sig/courier/models/version_node.rbs +32 -0
- data/sig/courier/models.rbs +108 -0
- data/sig/courier/resources/notifications.rbs +65 -3
- data/sig/courier/resources/providers/catalog.rbs +16 -0
- data/sig/courier/resources/providers.rbs +38 -0
- data/sig/courier/resources/routing_strategies.rbs +48 -0
- metadata +182 -8
- data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
- data/lib/courier/resources/notifications/draft.rb +0 -33
- data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
- data/rbi/courier/resources/notifications/draft.rbi +0 -23
- data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
- data/sig/courier/resources/notifications/draft.rbs +0 -14
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationContentPutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationContentPutRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
15
|
+
sig { returns(Courier::NotificationContentPutRequest::Content) }
|
|
16
|
+
attr_reader :content
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
content: Courier::NotificationContentPutRequest::Content::OrHash
|
|
21
|
+
).void
|
|
22
|
+
end
|
|
23
|
+
attr_writer :content
|
|
24
|
+
|
|
25
|
+
# Template state. Defaults to `DRAFT`.
|
|
26
|
+
sig { returns(T.nilable(Courier::NotificationTemplateState::OrSymbol)) }
|
|
27
|
+
attr_reader :state
|
|
28
|
+
|
|
29
|
+
sig { params(state: Courier::NotificationTemplateState::OrSymbol).void }
|
|
30
|
+
attr_writer :state
|
|
31
|
+
|
|
32
|
+
# Request body for replacing the elemental content of a notification template.
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
content: Courier::NotificationContentPutRequest::Content::OrHash,
|
|
36
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
37
|
+
).returns(T.attached_class)
|
|
38
|
+
end
|
|
39
|
+
def self.new(
|
|
40
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
41
|
+
content:,
|
|
42
|
+
# Template state. Defaults to `DRAFT`.
|
|
43
|
+
state: nil
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
sig do
|
|
48
|
+
override.returns(
|
|
49
|
+
{
|
|
50
|
+
content: Courier::NotificationContentPutRequest::Content,
|
|
51
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
def to_hash
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class Content < Courier::Internal::Type::BaseModel
|
|
59
|
+
OrHash =
|
|
60
|
+
T.type_alias do
|
|
61
|
+
T.any(
|
|
62
|
+
Courier::NotificationContentPutRequest::Content,
|
|
63
|
+
Courier::Internal::AnyHash
|
|
64
|
+
)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
returns(
|
|
69
|
+
T::Array[
|
|
70
|
+
T.any(
|
|
71
|
+
Courier::ElementalTextNodeWithType,
|
|
72
|
+
Courier::ElementalMetaNodeWithType,
|
|
73
|
+
Courier::ElementalChannelNodeWithType,
|
|
74
|
+
Courier::ElementalImageNodeWithType,
|
|
75
|
+
Courier::ElementalActionNodeWithType,
|
|
76
|
+
Courier::ElementalDividerNodeWithType,
|
|
77
|
+
Courier::ElementalQuoteNodeWithType,
|
|
78
|
+
Courier::ElementalHTMLNodeWithType
|
|
79
|
+
)
|
|
80
|
+
]
|
|
81
|
+
)
|
|
82
|
+
end
|
|
83
|
+
attr_accessor :elements
|
|
84
|
+
|
|
85
|
+
# Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
86
|
+
# omitted.
|
|
87
|
+
sig { returns(T.nilable(String)) }
|
|
88
|
+
attr_reader :version
|
|
89
|
+
|
|
90
|
+
sig { params(version: String).void }
|
|
91
|
+
attr_writer :version
|
|
92
|
+
|
|
93
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
94
|
+
sig do
|
|
95
|
+
params(
|
|
96
|
+
elements:
|
|
97
|
+
T::Array[
|
|
98
|
+
T.any(
|
|
99
|
+
Courier::ElementalTextNodeWithType::OrHash,
|
|
100
|
+
Courier::ElementalMetaNodeWithType::OrHash,
|
|
101
|
+
Courier::ElementalChannelNodeWithType::OrHash,
|
|
102
|
+
Courier::ElementalImageNodeWithType::OrHash,
|
|
103
|
+
Courier::ElementalActionNodeWithType::OrHash,
|
|
104
|
+
Courier::ElementalDividerNodeWithType::OrHash,
|
|
105
|
+
Courier::ElementalQuoteNodeWithType::OrHash,
|
|
106
|
+
Courier::ElementalHTMLNodeWithType::OrHash
|
|
107
|
+
)
|
|
108
|
+
],
|
|
109
|
+
version: String
|
|
110
|
+
).returns(T.attached_class)
|
|
111
|
+
end
|
|
112
|
+
def self.new(
|
|
113
|
+
elements:,
|
|
114
|
+
# Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
115
|
+
# omitted.
|
|
116
|
+
version: nil
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
sig do
|
|
121
|
+
override.returns(
|
|
122
|
+
{
|
|
123
|
+
elements:
|
|
124
|
+
T::Array[
|
|
125
|
+
T.any(
|
|
126
|
+
Courier::ElementalTextNodeWithType,
|
|
127
|
+
Courier::ElementalMetaNodeWithType,
|
|
128
|
+
Courier::ElementalChannelNodeWithType,
|
|
129
|
+
Courier::ElementalImageNodeWithType,
|
|
130
|
+
Courier::ElementalActionNodeWithType,
|
|
131
|
+
Courier::ElementalDividerNodeWithType,
|
|
132
|
+
Courier::ElementalQuoteNodeWithType,
|
|
133
|
+
Courier::ElementalHTMLNodeWithType
|
|
134
|
+
)
|
|
135
|
+
],
|
|
136
|
+
version: String
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
end
|
|
140
|
+
def to_hash
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationCreateParams < Courier::Models::NotificationTemplateCreateRequest
|
|
6
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Courier::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Courier::NotificationCreateParams, Courier::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
params(request_options: Courier::RequestOptions::OrHash).returns(
|
|
16
|
+
T.attached_class
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
def self.new(request_options: {})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { override.returns({ request_options: Courier::RequestOptions }) }
|
|
23
|
+
def to_hash
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationElementPutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationElementPutRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Element type (text, meta, action, image, etc.).
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :type
|
|
17
|
+
|
|
18
|
+
sig { returns(T.nilable(T::Array[String])) }
|
|
19
|
+
attr_reader :channels
|
|
20
|
+
|
|
21
|
+
sig { params(channels: T::Array[String]).void }
|
|
22
|
+
attr_writer :channels
|
|
23
|
+
|
|
24
|
+
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
25
|
+
attr_reader :data
|
|
26
|
+
|
|
27
|
+
sig { params(data: T::Hash[Symbol, T.anything]).void }
|
|
28
|
+
attr_writer :data
|
|
29
|
+
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_reader :if_
|
|
32
|
+
|
|
33
|
+
sig { params(if_: String).void }
|
|
34
|
+
attr_writer :if_
|
|
35
|
+
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
attr_reader :loop_
|
|
38
|
+
|
|
39
|
+
sig { params(loop_: String).void }
|
|
40
|
+
attr_writer :loop_
|
|
41
|
+
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
attr_reader :ref
|
|
44
|
+
|
|
45
|
+
sig { params(ref: String).void }
|
|
46
|
+
attr_writer :ref
|
|
47
|
+
|
|
48
|
+
# Template state. Defaults to `DRAFT`.
|
|
49
|
+
sig { returns(T.nilable(Courier::NotificationTemplateState::OrSymbol)) }
|
|
50
|
+
attr_reader :state
|
|
51
|
+
|
|
52
|
+
sig { params(state: Courier::NotificationTemplateState::OrSymbol).void }
|
|
53
|
+
attr_writer :state
|
|
54
|
+
|
|
55
|
+
# Request body for updating a single element. Additional type-specific fields are
|
|
56
|
+
# allowed.
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
type: String,
|
|
60
|
+
channels: T::Array[String],
|
|
61
|
+
data: T::Hash[Symbol, T.anything],
|
|
62
|
+
if_: String,
|
|
63
|
+
loop_: String,
|
|
64
|
+
ref: String,
|
|
65
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
66
|
+
).returns(T.attached_class)
|
|
67
|
+
end
|
|
68
|
+
def self.new(
|
|
69
|
+
# Element type (text, meta, action, image, etc.).
|
|
70
|
+
type:,
|
|
71
|
+
channels: nil,
|
|
72
|
+
data: nil,
|
|
73
|
+
if_: nil,
|
|
74
|
+
loop_: nil,
|
|
75
|
+
ref: nil,
|
|
76
|
+
# Template state. Defaults to `DRAFT`.
|
|
77
|
+
state: nil
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{
|
|
84
|
+
type: String,
|
|
85
|
+
channels: T::Array[String],
|
|
86
|
+
data: T::Hash[Symbol, T.anything],
|
|
87
|
+
if_: String,
|
|
88
|
+
loop_: String,
|
|
89
|
+
ref: String,
|
|
90
|
+
state: Courier::NotificationTemplateState::OrSymbol
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
def to_hash
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -11,23 +11,35 @@ module Courier
|
|
|
11
11
|
T.any(Courier::NotificationListParams, Courier::Internal::AnyHash)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
14
15
|
sig { returns(T.nilable(String)) }
|
|
15
16
|
attr_accessor :cursor
|
|
16
17
|
|
|
17
|
-
#
|
|
18
|
+
# Filter to templates linked to this event map ID.
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_reader :event_id
|
|
21
|
+
|
|
22
|
+
sig { params(event_id: String).void }
|
|
23
|
+
attr_writer :event_id
|
|
24
|
+
|
|
25
|
+
# Include template notes in the response. Only applies to legacy templates.
|
|
18
26
|
sig { returns(T.nilable(T::Boolean)) }
|
|
19
27
|
attr_accessor :notes
|
|
20
28
|
|
|
21
29
|
sig do
|
|
22
30
|
params(
|
|
23
31
|
cursor: T.nilable(String),
|
|
32
|
+
event_id: String,
|
|
24
33
|
notes: T.nilable(T::Boolean),
|
|
25
34
|
request_options: Courier::RequestOptions::OrHash
|
|
26
35
|
).returns(T.attached_class)
|
|
27
36
|
end
|
|
28
37
|
def self.new(
|
|
38
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
29
39
|
cursor: nil,
|
|
30
|
-
#
|
|
40
|
+
# Filter to templates linked to this event map ID.
|
|
41
|
+
event_id: nil,
|
|
42
|
+
# Include template notes in the response. Only applies to legacy templates.
|
|
31
43
|
notes: nil,
|
|
32
44
|
request_options: {}
|
|
33
45
|
)
|
|
@@ -37,6 +49,7 @@ module Courier
|
|
|
37
49
|
override.returns(
|
|
38
50
|
{
|
|
39
51
|
cursor: T.nilable(String),
|
|
52
|
+
event_id: String,
|
|
40
53
|
notes: T.nilable(T::Boolean),
|
|
41
54
|
request_options: Courier::RequestOptions
|
|
42
55
|
}
|
|
@@ -17,8 +17,11 @@ module Courier
|
|
|
17
17
|
sig { params(paging: Courier::Paging::OrHash).void }
|
|
18
18
|
attr_writer :paging
|
|
19
19
|
|
|
20
|
+
# Notification templates in this workspace.
|
|
20
21
|
sig do
|
|
21
|
-
returns(
|
|
22
|
+
returns(
|
|
23
|
+
T::Array[Courier::Models::NotificationListResponse::Result::Variants]
|
|
24
|
+
)
|
|
22
25
|
end
|
|
23
26
|
attr_accessor :results
|
|
24
27
|
|
|
@@ -26,194 +29,231 @@ module Courier
|
|
|
26
29
|
params(
|
|
27
30
|
paging: Courier::Paging::OrHash,
|
|
28
31
|
results:
|
|
29
|
-
T::Array[
|
|
32
|
+
T::Array[
|
|
33
|
+
T.any(
|
|
34
|
+
Courier::Models::NotificationListResponse::Result::Notification::OrHash,
|
|
35
|
+
Courier::NotificationTemplateSummary::OrHash
|
|
36
|
+
)
|
|
37
|
+
]
|
|
30
38
|
).returns(T.attached_class)
|
|
31
39
|
end
|
|
32
|
-
def self.new(
|
|
40
|
+
def self.new(
|
|
41
|
+
paging:,
|
|
42
|
+
# Notification templates in this workspace.
|
|
43
|
+
results:
|
|
44
|
+
)
|
|
33
45
|
end
|
|
34
46
|
|
|
35
47
|
sig do
|
|
36
48
|
override.returns(
|
|
37
49
|
{
|
|
38
50
|
paging: Courier::Paging,
|
|
39
|
-
results:
|
|
51
|
+
results:
|
|
52
|
+
T::Array[
|
|
53
|
+
Courier::Models::NotificationListResponse::Result::Variants
|
|
54
|
+
]
|
|
40
55
|
}
|
|
41
56
|
)
|
|
42
57
|
end
|
|
43
58
|
def to_hash
|
|
44
59
|
end
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
# V2 (CDS) template summary returned in list responses.
|
|
62
|
+
module Result
|
|
63
|
+
extend Courier::Internal::Type::Union
|
|
64
|
+
|
|
65
|
+
Variants =
|
|
48
66
|
T.type_alias do
|
|
49
67
|
T.any(
|
|
50
|
-
Courier::Models::NotificationListResponse::Result,
|
|
51
|
-
Courier::
|
|
68
|
+
Courier::Models::NotificationListResponse::Result::Notification,
|
|
69
|
+
Courier::NotificationTemplateSummary
|
|
52
70
|
)
|
|
53
71
|
end
|
|
54
72
|
|
|
55
|
-
|
|
56
|
-
|
|
73
|
+
class Notification < Courier::Internal::Type::BaseModel
|
|
74
|
+
OrHash =
|
|
75
|
+
T.type_alias do
|
|
76
|
+
T.any(
|
|
77
|
+
Courier::Models::NotificationListResponse::Result::Notification,
|
|
78
|
+
Courier::Internal::AnyHash
|
|
79
|
+
)
|
|
80
|
+
end
|
|
57
81
|
|
|
58
|
-
|
|
59
|
-
|
|
82
|
+
sig { returns(String) }
|
|
83
|
+
attr_accessor :id
|
|
60
84
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
attr_accessor :event_ids
|
|
85
|
+
sig { returns(Integer) }
|
|
86
|
+
attr_accessor :created_at
|
|
64
87
|
|
|
65
|
-
|
|
66
|
-
|
|
88
|
+
# Array of event IDs associated with this notification
|
|
89
|
+
sig { returns(T::Array[String]) }
|
|
90
|
+
attr_accessor :event_ids
|
|
67
91
|
|
|
68
|
-
|
|
69
|
-
|
|
92
|
+
sig { returns(String) }
|
|
93
|
+
attr_accessor :note
|
|
70
94
|
|
|
71
|
-
|
|
72
|
-
|
|
95
|
+
sig { returns(Courier::MessageRouting) }
|
|
96
|
+
attr_reader :routing
|
|
73
97
|
|
|
74
|
-
|
|
75
|
-
|
|
98
|
+
sig { params(routing: Courier::MessageRouting::OrHash).void }
|
|
99
|
+
attr_writer :routing
|
|
76
100
|
|
|
77
|
-
|
|
78
|
-
|
|
101
|
+
sig { returns(String) }
|
|
102
|
+
attr_accessor :topic_id
|
|
79
103
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
T.nilable(Courier::Models::NotificationListResponse::Result::Tags)
|
|
83
|
-
)
|
|
84
|
-
end
|
|
85
|
-
attr_reader :tags
|
|
104
|
+
sig { returns(Integer) }
|
|
105
|
+
attr_accessor :updated_at
|
|
86
106
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
tags:
|
|
107
|
+
sig do
|
|
108
|
+
returns(
|
|
90
109
|
T.nilable(
|
|
91
|
-
Courier::Models::NotificationListResponse::Result::Tags
|
|
110
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags
|
|
92
111
|
)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
attr_reader :tags
|
|
96
115
|
|
|
97
|
-
|
|
98
|
-
|
|
116
|
+
sig do
|
|
117
|
+
params(
|
|
118
|
+
tags:
|
|
119
|
+
T.nilable(
|
|
120
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags::OrHash
|
|
121
|
+
)
|
|
122
|
+
).void
|
|
123
|
+
end
|
|
124
|
+
attr_writer :tags
|
|
99
125
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
id: String,
|
|
103
|
-
created_at: Integer,
|
|
104
|
-
event_ids: T::Array[String],
|
|
105
|
-
note: String,
|
|
106
|
-
routing: Courier::MessageRouting::OrHash,
|
|
107
|
-
topic_id: String,
|
|
108
|
-
updated_at: Integer,
|
|
109
|
-
tags:
|
|
110
|
-
T.nilable(
|
|
111
|
-
Courier::Models::NotificationListResponse::Result::Tags::OrHash
|
|
112
|
-
),
|
|
113
|
-
title: T.nilable(String)
|
|
114
|
-
).returns(T.attached_class)
|
|
115
|
-
end
|
|
116
|
-
def self.new(
|
|
117
|
-
id:,
|
|
118
|
-
created_at:,
|
|
119
|
-
# Array of event IDs associated with this notification
|
|
120
|
-
event_ids:,
|
|
121
|
-
note:,
|
|
122
|
-
routing:,
|
|
123
|
-
topic_id:,
|
|
124
|
-
updated_at:,
|
|
125
|
-
tags: nil,
|
|
126
|
-
title: nil
|
|
127
|
-
)
|
|
128
|
-
end
|
|
126
|
+
sig { returns(T.nilable(String)) }
|
|
127
|
+
attr_accessor :title
|
|
129
128
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
{
|
|
129
|
+
sig do
|
|
130
|
+
params(
|
|
133
131
|
id: String,
|
|
134
132
|
created_at: Integer,
|
|
135
133
|
event_ids: T::Array[String],
|
|
136
134
|
note: String,
|
|
137
|
-
routing: Courier::MessageRouting,
|
|
135
|
+
routing: Courier::MessageRouting::OrHash,
|
|
138
136
|
topic_id: String,
|
|
139
137
|
updated_at: Integer,
|
|
140
138
|
tags:
|
|
141
139
|
T.nilable(
|
|
142
|
-
Courier::Models::NotificationListResponse::Result::Tags
|
|
140
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags::OrHash
|
|
143
141
|
),
|
|
144
142
|
title: T.nilable(String)
|
|
145
|
-
}
|
|
146
|
-
)
|
|
147
|
-
end
|
|
148
|
-
def to_hash
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
class Tags < Courier::Internal::Type::BaseModel
|
|
152
|
-
OrHash =
|
|
153
|
-
T.type_alias do
|
|
154
|
-
T.any(
|
|
155
|
-
Courier::Models::NotificationListResponse::Result::Tags,
|
|
156
|
-
Courier::Internal::AnyHash
|
|
157
|
-
)
|
|
158
|
-
end
|
|
159
|
-
|
|
160
|
-
sig do
|
|
161
|
-
returns(
|
|
162
|
-
T::Array[
|
|
163
|
-
Courier::Models::NotificationListResponse::Result::Tags::Data
|
|
164
|
-
]
|
|
165
|
-
)
|
|
166
|
-
end
|
|
167
|
-
attr_accessor :data
|
|
168
|
-
|
|
169
|
-
sig do
|
|
170
|
-
params(
|
|
171
|
-
data:
|
|
172
|
-
T::Array[
|
|
173
|
-
Courier::Models::NotificationListResponse::Result::Tags::Data::OrHash
|
|
174
|
-
]
|
|
175
143
|
).returns(T.attached_class)
|
|
176
144
|
end
|
|
177
|
-
def self.new(
|
|
145
|
+
def self.new(
|
|
146
|
+
id:,
|
|
147
|
+
created_at:,
|
|
148
|
+
# Array of event IDs associated with this notification
|
|
149
|
+
event_ids:,
|
|
150
|
+
note:,
|
|
151
|
+
routing:,
|
|
152
|
+
topic_id:,
|
|
153
|
+
updated_at:,
|
|
154
|
+
tags: nil,
|
|
155
|
+
title: nil
|
|
156
|
+
)
|
|
178
157
|
end
|
|
179
158
|
|
|
180
159
|
sig do
|
|
181
160
|
override.returns(
|
|
182
161
|
{
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
162
|
+
id: String,
|
|
163
|
+
created_at: Integer,
|
|
164
|
+
event_ids: T::Array[String],
|
|
165
|
+
note: String,
|
|
166
|
+
routing: Courier::MessageRouting,
|
|
167
|
+
topic_id: String,
|
|
168
|
+
updated_at: Integer,
|
|
169
|
+
tags:
|
|
170
|
+
T.nilable(
|
|
171
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags
|
|
172
|
+
),
|
|
173
|
+
title: T.nilable(String)
|
|
187
174
|
}
|
|
188
175
|
)
|
|
189
176
|
end
|
|
190
177
|
def to_hash
|
|
191
178
|
end
|
|
192
179
|
|
|
193
|
-
class
|
|
180
|
+
class Tags < Courier::Internal::Type::BaseModel
|
|
194
181
|
OrHash =
|
|
195
182
|
T.type_alias do
|
|
196
183
|
T.any(
|
|
197
|
-
Courier::Models::NotificationListResponse::Result::Tags
|
|
184
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags,
|
|
198
185
|
Courier::Internal::AnyHash
|
|
199
186
|
)
|
|
200
187
|
end
|
|
201
188
|
|
|
202
|
-
sig
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
189
|
+
sig do
|
|
190
|
+
returns(
|
|
191
|
+
T::Array[
|
|
192
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags::Data
|
|
193
|
+
]
|
|
194
|
+
)
|
|
195
|
+
end
|
|
196
|
+
attr_accessor :data
|
|
207
197
|
|
|
208
|
-
sig
|
|
209
|
-
|
|
198
|
+
sig do
|
|
199
|
+
params(
|
|
200
|
+
data:
|
|
201
|
+
T::Array[
|
|
202
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags::Data::OrHash
|
|
203
|
+
]
|
|
204
|
+
).returns(T.attached_class)
|
|
205
|
+
end
|
|
206
|
+
def self.new(data:)
|
|
210
207
|
end
|
|
211
208
|
|
|
212
|
-
sig
|
|
209
|
+
sig do
|
|
210
|
+
override.returns(
|
|
211
|
+
{
|
|
212
|
+
data:
|
|
213
|
+
T::Array[
|
|
214
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags::Data
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
end
|
|
213
219
|
def to_hash
|
|
214
220
|
end
|
|
221
|
+
|
|
222
|
+
class Data < Courier::Internal::Type::BaseModel
|
|
223
|
+
OrHash =
|
|
224
|
+
T.type_alias do
|
|
225
|
+
T.any(
|
|
226
|
+
Courier::Models::NotificationListResponse::Result::Notification::Tags::Data,
|
|
227
|
+
Courier::Internal::AnyHash
|
|
228
|
+
)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
sig { returns(String) }
|
|
232
|
+
attr_accessor :id
|
|
233
|
+
|
|
234
|
+
sig { returns(String) }
|
|
235
|
+
attr_accessor :name
|
|
236
|
+
|
|
237
|
+
sig { params(id: String, name: String).returns(T.attached_class) }
|
|
238
|
+
def self.new(id:, name:)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
sig { override.returns({ id: String, name: String }) }
|
|
242
|
+
def to_hash
|
|
243
|
+
end
|
|
244
|
+
end
|
|
215
245
|
end
|
|
216
246
|
end
|
|
247
|
+
|
|
248
|
+
sig do
|
|
249
|
+
override.returns(
|
|
250
|
+
T::Array[
|
|
251
|
+
Courier::Models::NotificationListResponse::Result::Variants
|
|
252
|
+
]
|
|
253
|
+
)
|
|
254
|
+
end
|
|
255
|
+
def self.variants
|
|
256
|
+
end
|
|
217
257
|
end
|
|
218
258
|
end
|
|
219
259
|
end
|