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,162 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplateGetResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationTemplateGetResponse,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Epoch milliseconds when the template was created.
|
|
15
|
+
sig { returns(Integer) }
|
|
16
|
+
attr_accessor :created
|
|
17
|
+
|
|
18
|
+
# User ID of the creator.
|
|
19
|
+
sig { returns(String) }
|
|
20
|
+
attr_accessor :creator
|
|
21
|
+
|
|
22
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
23
|
+
# GET response envelope.
|
|
24
|
+
sig { returns(Courier::NotificationTemplateGetResponse::Notification) }
|
|
25
|
+
attr_reader :notification
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
notification:
|
|
30
|
+
Courier::NotificationTemplateGetResponse::Notification::OrHash
|
|
31
|
+
).void
|
|
32
|
+
end
|
|
33
|
+
attr_writer :notification
|
|
34
|
+
|
|
35
|
+
# The template state. Always uppercase.
|
|
36
|
+
sig do
|
|
37
|
+
returns(Courier::NotificationTemplateGetResponse::State::TaggedSymbol)
|
|
38
|
+
end
|
|
39
|
+
attr_accessor :state
|
|
40
|
+
|
|
41
|
+
# Epoch milliseconds of last update.
|
|
42
|
+
sig { returns(T.nilable(Integer)) }
|
|
43
|
+
attr_reader :updated
|
|
44
|
+
|
|
45
|
+
sig { params(updated: Integer).void }
|
|
46
|
+
attr_writer :updated
|
|
47
|
+
|
|
48
|
+
# User ID of the last updater.
|
|
49
|
+
sig { returns(T.nilable(String)) }
|
|
50
|
+
attr_reader :updater
|
|
51
|
+
|
|
52
|
+
sig { params(updater: String).void }
|
|
53
|
+
attr_writer :updater
|
|
54
|
+
|
|
55
|
+
# Envelope response for GET /notifications/{id}. The notification object mirrors
|
|
56
|
+
# the POST/PUT input shape. Nullable fields return null when unset.
|
|
57
|
+
sig do
|
|
58
|
+
params(
|
|
59
|
+
created: Integer,
|
|
60
|
+
creator: String,
|
|
61
|
+
notification:
|
|
62
|
+
Courier::NotificationTemplateGetResponse::Notification::OrHash,
|
|
63
|
+
state: Courier::NotificationTemplateGetResponse::State::OrSymbol,
|
|
64
|
+
updated: Integer,
|
|
65
|
+
updater: String
|
|
66
|
+
).returns(T.attached_class)
|
|
67
|
+
end
|
|
68
|
+
def self.new(
|
|
69
|
+
# Epoch milliseconds when the template was created.
|
|
70
|
+
created:,
|
|
71
|
+
# User ID of the creator.
|
|
72
|
+
creator:,
|
|
73
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
74
|
+
# GET response envelope.
|
|
75
|
+
notification:,
|
|
76
|
+
# The template state. Always uppercase.
|
|
77
|
+
state:,
|
|
78
|
+
# Epoch milliseconds of last update.
|
|
79
|
+
updated: nil,
|
|
80
|
+
# User ID of the last updater.
|
|
81
|
+
updater: nil
|
|
82
|
+
)
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
sig do
|
|
86
|
+
override.returns(
|
|
87
|
+
{
|
|
88
|
+
created: Integer,
|
|
89
|
+
creator: String,
|
|
90
|
+
notification:
|
|
91
|
+
Courier::NotificationTemplateGetResponse::Notification,
|
|
92
|
+
state:
|
|
93
|
+
Courier::NotificationTemplateGetResponse::State::TaggedSymbol,
|
|
94
|
+
updated: Integer,
|
|
95
|
+
updater: String
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
def to_hash
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
class Notification < Courier::Models::NotificationTemplatePayload
|
|
103
|
+
OrHash =
|
|
104
|
+
T.type_alias do
|
|
105
|
+
T.any(
|
|
106
|
+
Courier::NotificationTemplateGetResponse::Notification,
|
|
107
|
+
Courier::Internal::AnyHash
|
|
108
|
+
)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# The template ID.
|
|
112
|
+
sig { returns(String) }
|
|
113
|
+
attr_accessor :id
|
|
114
|
+
|
|
115
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
116
|
+
# GET response envelope.
|
|
117
|
+
sig { params(id: String).returns(T.attached_class) }
|
|
118
|
+
def self.new(
|
|
119
|
+
# The template ID.
|
|
120
|
+
id:
|
|
121
|
+
)
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
sig { override.returns({ id: String }) }
|
|
125
|
+
def to_hash
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# The template state. Always uppercase.
|
|
130
|
+
module State
|
|
131
|
+
extend Courier::Internal::Type::Enum
|
|
132
|
+
|
|
133
|
+
TaggedSymbol =
|
|
134
|
+
T.type_alias do
|
|
135
|
+
T.all(Symbol, Courier::NotificationTemplateGetResponse::State)
|
|
136
|
+
end
|
|
137
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
138
|
+
|
|
139
|
+
DRAFT =
|
|
140
|
+
T.let(
|
|
141
|
+
:DRAFT,
|
|
142
|
+
Courier::NotificationTemplateGetResponse::State::TaggedSymbol
|
|
143
|
+
)
|
|
144
|
+
PUBLISHED =
|
|
145
|
+
T.let(
|
|
146
|
+
:PUBLISHED,
|
|
147
|
+
Courier::NotificationTemplateGetResponse::State::TaggedSymbol
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
sig do
|
|
151
|
+
override.returns(
|
|
152
|
+
T::Array[
|
|
153
|
+
Courier::NotificationTemplateGetResponse::State::TaggedSymbol
|
|
154
|
+
]
|
|
155
|
+
)
|
|
156
|
+
end
|
|
157
|
+
def self.values
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
end
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplateMutationResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationTemplateMutationResponse,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
returns(Courier::NotificationTemplateMutationResponse::Notification)
|
|
16
|
+
end
|
|
17
|
+
attr_reader :notification
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
params(
|
|
21
|
+
notification:
|
|
22
|
+
Courier::NotificationTemplateMutationResponse::Notification::OrHash
|
|
23
|
+
).void
|
|
24
|
+
end
|
|
25
|
+
attr_writer :notification
|
|
26
|
+
|
|
27
|
+
# The template state after the operation. Always uppercase.
|
|
28
|
+
sig do
|
|
29
|
+
returns(
|
|
30
|
+
Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
attr_accessor :state
|
|
34
|
+
|
|
35
|
+
# Response returned by POST and PUT operations.
|
|
36
|
+
sig do
|
|
37
|
+
params(
|
|
38
|
+
notification:
|
|
39
|
+
Courier::NotificationTemplateMutationResponse::Notification::OrHash,
|
|
40
|
+
state: Courier::NotificationTemplateMutationResponse::State::OrSymbol
|
|
41
|
+
).returns(T.attached_class)
|
|
42
|
+
end
|
|
43
|
+
def self.new(
|
|
44
|
+
notification:,
|
|
45
|
+
# The template state after the operation. Always uppercase.
|
|
46
|
+
state:
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
sig do
|
|
51
|
+
override.returns(
|
|
52
|
+
{
|
|
53
|
+
notification:
|
|
54
|
+
Courier::NotificationTemplateMutationResponse::Notification,
|
|
55
|
+
state:
|
|
56
|
+
Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
end
|
|
60
|
+
def to_hash
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
class Notification < Courier::Internal::Type::BaseModel
|
|
64
|
+
OrHash =
|
|
65
|
+
T.type_alias do
|
|
66
|
+
T.any(
|
|
67
|
+
Courier::NotificationTemplateMutationResponse::Notification,
|
|
68
|
+
Courier::Internal::AnyHash
|
|
69
|
+
)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# The ID of the created or updated template.
|
|
73
|
+
sig { returns(String) }
|
|
74
|
+
attr_accessor :id
|
|
75
|
+
|
|
76
|
+
sig { params(id: String).returns(T.attached_class) }
|
|
77
|
+
def self.new(
|
|
78
|
+
# The ID of the created or updated template.
|
|
79
|
+
id:
|
|
80
|
+
)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
sig { override.returns({ id: String }) }
|
|
84
|
+
def to_hash
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# The template state after the operation. Always uppercase.
|
|
89
|
+
module State
|
|
90
|
+
extend Courier::Internal::Type::Enum
|
|
91
|
+
|
|
92
|
+
TaggedSymbol =
|
|
93
|
+
T.type_alias do
|
|
94
|
+
T.all(Symbol, Courier::NotificationTemplateMutationResponse::State)
|
|
95
|
+
end
|
|
96
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
97
|
+
|
|
98
|
+
DRAFT =
|
|
99
|
+
T.let(
|
|
100
|
+
:DRAFT,
|
|
101
|
+
Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
|
|
102
|
+
)
|
|
103
|
+
PUBLISHED =
|
|
104
|
+
T.let(
|
|
105
|
+
:PUBLISHED,
|
|
106
|
+
Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
sig do
|
|
110
|
+
override.returns(
|
|
111
|
+
T::Array[
|
|
112
|
+
Courier::NotificationTemplateMutationResponse::State::TaggedSymbol
|
|
113
|
+
]
|
|
114
|
+
)
|
|
115
|
+
end
|
|
116
|
+
def self.values
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplatePayload < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationTemplatePayload,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Brand reference, or null for no brand.
|
|
15
|
+
sig { returns(T.nilable(Courier::NotificationTemplatePayload::Brand)) }
|
|
16
|
+
attr_reader :brand
|
|
17
|
+
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
brand: T.nilable(Courier::NotificationTemplatePayload::Brand::OrHash)
|
|
21
|
+
).void
|
|
22
|
+
end
|
|
23
|
+
attr_writer :brand
|
|
24
|
+
|
|
25
|
+
# Elemental content definition.
|
|
26
|
+
sig { returns(Courier::ElementalContent) }
|
|
27
|
+
attr_reader :content
|
|
28
|
+
|
|
29
|
+
sig { params(content: Courier::ElementalContent::OrHash).void }
|
|
30
|
+
attr_writer :content
|
|
31
|
+
|
|
32
|
+
# Display name for the template.
|
|
33
|
+
sig { returns(String) }
|
|
34
|
+
attr_accessor :name
|
|
35
|
+
|
|
36
|
+
# Routing strategy reference, or null for none.
|
|
37
|
+
sig { returns(T.nilable(Courier::NotificationTemplatePayload::Routing)) }
|
|
38
|
+
attr_reader :routing
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
params(
|
|
42
|
+
routing:
|
|
43
|
+
T.nilable(Courier::NotificationTemplatePayload::Routing::OrHash)
|
|
44
|
+
).void
|
|
45
|
+
end
|
|
46
|
+
attr_writer :routing
|
|
47
|
+
|
|
48
|
+
# Subscription topic reference, or null for none.
|
|
49
|
+
sig do
|
|
50
|
+
returns(T.nilable(Courier::NotificationTemplatePayload::Subscription))
|
|
51
|
+
end
|
|
52
|
+
attr_reader :subscription
|
|
53
|
+
|
|
54
|
+
sig do
|
|
55
|
+
params(
|
|
56
|
+
subscription:
|
|
57
|
+
T.nilable(
|
|
58
|
+
Courier::NotificationTemplatePayload::Subscription::OrHash
|
|
59
|
+
)
|
|
60
|
+
).void
|
|
61
|
+
end
|
|
62
|
+
attr_writer :subscription
|
|
63
|
+
|
|
64
|
+
# Tags for categorization. Send empty array for none.
|
|
65
|
+
sig { returns(T::Array[String]) }
|
|
66
|
+
attr_accessor :tags
|
|
67
|
+
|
|
68
|
+
# Full document shape used in POST and PUT request bodies, and returned inside the
|
|
69
|
+
# GET response envelope.
|
|
70
|
+
sig do
|
|
71
|
+
params(
|
|
72
|
+
brand: T.nilable(Courier::NotificationTemplatePayload::Brand::OrHash),
|
|
73
|
+
content: Courier::ElementalContent::OrHash,
|
|
74
|
+
name: String,
|
|
75
|
+
routing:
|
|
76
|
+
T.nilable(Courier::NotificationTemplatePayload::Routing::OrHash),
|
|
77
|
+
subscription:
|
|
78
|
+
T.nilable(
|
|
79
|
+
Courier::NotificationTemplatePayload::Subscription::OrHash
|
|
80
|
+
),
|
|
81
|
+
tags: T::Array[String]
|
|
82
|
+
).returns(T.attached_class)
|
|
83
|
+
end
|
|
84
|
+
def self.new(
|
|
85
|
+
# Brand reference, or null for no brand.
|
|
86
|
+
brand:,
|
|
87
|
+
# Elemental content definition.
|
|
88
|
+
content:,
|
|
89
|
+
# Display name for the template.
|
|
90
|
+
name:,
|
|
91
|
+
# Routing strategy reference, or null for none.
|
|
92
|
+
routing:,
|
|
93
|
+
# Subscription topic reference, or null for none.
|
|
94
|
+
subscription:,
|
|
95
|
+
# Tags for categorization. Send empty array for none.
|
|
96
|
+
tags:
|
|
97
|
+
)
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
sig do
|
|
101
|
+
override.returns(
|
|
102
|
+
{
|
|
103
|
+
brand: T.nilable(Courier::NotificationTemplatePayload::Brand),
|
|
104
|
+
content: Courier::ElementalContent,
|
|
105
|
+
name: String,
|
|
106
|
+
routing: T.nilable(Courier::NotificationTemplatePayload::Routing),
|
|
107
|
+
subscription:
|
|
108
|
+
T.nilable(Courier::NotificationTemplatePayload::Subscription),
|
|
109
|
+
tags: T::Array[String]
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
end
|
|
113
|
+
def to_hash
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
class Brand < Courier::Internal::Type::BaseModel
|
|
117
|
+
OrHash =
|
|
118
|
+
T.type_alias do
|
|
119
|
+
T.any(
|
|
120
|
+
Courier::NotificationTemplatePayload::Brand,
|
|
121
|
+
Courier::Internal::AnyHash
|
|
122
|
+
)
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
sig { returns(String) }
|
|
126
|
+
attr_accessor :id
|
|
127
|
+
|
|
128
|
+
# Brand reference, or null for no brand.
|
|
129
|
+
sig { params(id: String).returns(T.attached_class) }
|
|
130
|
+
def self.new(id:)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
sig { override.returns({ id: String }) }
|
|
134
|
+
def to_hash
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
class Routing < Courier::Internal::Type::BaseModel
|
|
139
|
+
OrHash =
|
|
140
|
+
T.type_alias do
|
|
141
|
+
T.any(
|
|
142
|
+
Courier::NotificationTemplatePayload::Routing,
|
|
143
|
+
Courier::Internal::AnyHash
|
|
144
|
+
)
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
sig { returns(String) }
|
|
148
|
+
attr_accessor :strategy_id
|
|
149
|
+
|
|
150
|
+
# Routing strategy reference, or null for none.
|
|
151
|
+
sig { params(strategy_id: String).returns(T.attached_class) }
|
|
152
|
+
def self.new(strategy_id:)
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
sig { override.returns({ strategy_id: String }) }
|
|
156
|
+
def to_hash
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
class Subscription < Courier::Internal::Type::BaseModel
|
|
161
|
+
OrHash =
|
|
162
|
+
T.type_alias do
|
|
163
|
+
T.any(
|
|
164
|
+
Courier::NotificationTemplatePayload::Subscription,
|
|
165
|
+
Courier::Internal::AnyHash
|
|
166
|
+
)
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
sig { returns(String) }
|
|
170
|
+
attr_accessor :topic_id
|
|
171
|
+
|
|
172
|
+
# Subscription topic reference, or null for none.
|
|
173
|
+
sig { params(topic_id: String).returns(T.attached_class) }
|
|
174
|
+
def self.new(topic_id:)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
sig { override.returns({ topic_id: String }) }
|
|
178
|
+
def to_hash
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplatePublishRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationTemplatePublishRequest,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Historical version to publish (e.g. "v001"). Omit to publish the current draft.
|
|
15
|
+
sig { returns(T.nilable(String)) }
|
|
16
|
+
attr_reader :version
|
|
17
|
+
|
|
18
|
+
sig { params(version: String).void }
|
|
19
|
+
attr_writer :version
|
|
20
|
+
|
|
21
|
+
# Optional request body for publishing a notification template. Omit or send an
|
|
22
|
+
# empty object to publish the current draft.
|
|
23
|
+
sig { params(version: String).returns(T.attached_class) }
|
|
24
|
+
def self.new(
|
|
25
|
+
# Historical version to publish (e.g. "v001"). Omit to publish the current draft.
|
|
26
|
+
version: nil
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
sig { override.returns({ version: String }) }
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Template state. Defaults to `DRAFT`.
|
|
6
|
+
module NotificationTemplateState
|
|
7
|
+
extend Courier::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
TaggedSymbol =
|
|
10
|
+
T.type_alias { T.all(Symbol, Courier::NotificationTemplateState) }
|
|
11
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
12
|
+
|
|
13
|
+
DRAFT = T.let(:DRAFT, Courier::NotificationTemplateState::TaggedSymbol)
|
|
14
|
+
PUBLISHED =
|
|
15
|
+
T.let(:PUBLISHED, Courier::NotificationTemplateState::TaggedSymbol)
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
override.returns(
|
|
19
|
+
T::Array[Courier::NotificationTemplateState::TaggedSymbol]
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.values
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationTemplateSummary < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::NotificationTemplateSummary,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :id
|
|
16
|
+
|
|
17
|
+
# Epoch milliseconds when the template was created.
|
|
18
|
+
sig { returns(Integer) }
|
|
19
|
+
attr_accessor :created
|
|
20
|
+
|
|
21
|
+
# User ID of the creator.
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :creator
|
|
24
|
+
|
|
25
|
+
sig { returns(String) }
|
|
26
|
+
attr_accessor :name
|
|
27
|
+
|
|
28
|
+
sig { returns(Courier::NotificationTemplateSummary::State::TaggedSymbol) }
|
|
29
|
+
attr_accessor :state
|
|
30
|
+
|
|
31
|
+
sig { returns(T::Array[String]) }
|
|
32
|
+
attr_accessor :tags
|
|
33
|
+
|
|
34
|
+
# Epoch milliseconds of last update.
|
|
35
|
+
sig { returns(T.nilable(Integer)) }
|
|
36
|
+
attr_reader :updated
|
|
37
|
+
|
|
38
|
+
sig { params(updated: Integer).void }
|
|
39
|
+
attr_writer :updated
|
|
40
|
+
|
|
41
|
+
# User ID of the last updater.
|
|
42
|
+
sig { returns(T.nilable(String)) }
|
|
43
|
+
attr_reader :updater
|
|
44
|
+
|
|
45
|
+
sig { params(updater: String).void }
|
|
46
|
+
attr_writer :updater
|
|
47
|
+
|
|
48
|
+
# V2 (CDS) template summary returned in list responses.
|
|
49
|
+
sig do
|
|
50
|
+
params(
|
|
51
|
+
id: String,
|
|
52
|
+
created: Integer,
|
|
53
|
+
creator: String,
|
|
54
|
+
name: String,
|
|
55
|
+
state: Courier::NotificationTemplateSummary::State::OrSymbol,
|
|
56
|
+
tags: T::Array[String],
|
|
57
|
+
updated: Integer,
|
|
58
|
+
updater: String
|
|
59
|
+
).returns(T.attached_class)
|
|
60
|
+
end
|
|
61
|
+
def self.new(
|
|
62
|
+
id:,
|
|
63
|
+
# Epoch milliseconds when the template was created.
|
|
64
|
+
created:,
|
|
65
|
+
# User ID of the creator.
|
|
66
|
+
creator:,
|
|
67
|
+
name:,
|
|
68
|
+
state:,
|
|
69
|
+
tags:,
|
|
70
|
+
# Epoch milliseconds of last update.
|
|
71
|
+
updated: nil,
|
|
72
|
+
# User ID of the last updater.
|
|
73
|
+
updater: nil
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
sig do
|
|
78
|
+
override.returns(
|
|
79
|
+
{
|
|
80
|
+
id: String,
|
|
81
|
+
created: Integer,
|
|
82
|
+
creator: String,
|
|
83
|
+
name: String,
|
|
84
|
+
state: Courier::NotificationTemplateSummary::State::TaggedSymbol,
|
|
85
|
+
tags: T::Array[String],
|
|
86
|
+
updated: Integer,
|
|
87
|
+
updater: String
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
def to_hash
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
module State
|
|
95
|
+
extend Courier::Internal::Type::Enum
|
|
96
|
+
|
|
97
|
+
TaggedSymbol =
|
|
98
|
+
T.type_alias do
|
|
99
|
+
T.all(Symbol, Courier::NotificationTemplateSummary::State)
|
|
100
|
+
end
|
|
101
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
102
|
+
|
|
103
|
+
DRAFT =
|
|
104
|
+
T.let(
|
|
105
|
+
:DRAFT,
|
|
106
|
+
Courier::NotificationTemplateSummary::State::TaggedSymbol
|
|
107
|
+
)
|
|
108
|
+
PUBLISHED =
|
|
109
|
+
T.let(
|
|
110
|
+
:PUBLISHED,
|
|
111
|
+
Courier::NotificationTemplateSummary::State::TaggedSymbol
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
sig do
|
|
115
|
+
override.returns(
|
|
116
|
+
T::Array[Courier::NotificationTemplateSummary::State::TaggedSymbol]
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
def self.values
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|