trycourier 4.9.0 → 4.10.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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/lib/courier/internal/util.rb +3 -1
  4. data/lib/courier/models/associated_notification_list_response.rb +24 -0
  5. data/lib/courier/models/element_with_checksums.rb +60 -0
  6. data/lib/courier/models/notification_content_get_response.rb +26 -0
  7. data/lib/courier/models/notification_content_mutation_response.rb +61 -0
  8. data/lib/courier/models/notification_content_put_request.rb +51 -0
  9. data/lib/courier/models/notification_element_put_request.rb +62 -0
  10. data/lib/courier/models/notification_get_content.rb +0 -1
  11. data/lib/courier/models/notification_locale_put_request.rb +39 -0
  12. data/lib/courier/models/notification_put_content_params.rb +20 -0
  13. data/lib/courier/models/notification_put_element_params.rb +26 -0
  14. data/lib/courier/models/notification_put_locale_params.rb +26 -0
  15. data/lib/courier/models/notification_retrieve_content_params.rb +14 -1
  16. data/lib/courier/models/notification_retrieve_content_response.rb +21 -0
  17. data/lib/courier/models/notification_template_get_response.rb +1 -1
  18. data/lib/courier/models/notification_template_state.rb +16 -0
  19. data/lib/courier/models/provider_update_params.rb +3 -2
  20. data/lib/courier/models/routing_strategy_get_response.rb +1 -1
  21. data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
  22. data/lib/courier/models.rb +24 -4
  23. data/lib/courier/resources/notifications.rb +128 -13
  24. data/lib/courier/resources/providers.rb +7 -5
  25. data/lib/courier/resources/routing_strategies.rb +32 -4
  26. data/lib/courier/version.rb +1 -1
  27. data/lib/courier.rb +13 -4
  28. data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
  29. data/rbi/courier/models/element_with_checksums.rbi +109 -0
  30. data/rbi/courier/models/notification_content_get_response.rbi +45 -0
  31. data/rbi/courier/models/notification_content_mutation_response.rbi +95 -0
  32. data/rbi/courier/models/notification_content_put_request.rbi +145 -0
  33. data/rbi/courier/models/notification_element_put_request.rbi +98 -0
  34. data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
  35. data/rbi/courier/models/notification_put_content_params.rbi +38 -0
  36. data/rbi/courier/models/notification_put_element_params.rbi +46 -0
  37. data/rbi/courier/models/notification_put_locale_params.rbi +46 -0
  38. data/rbi/courier/models/notification_retrieve_content_params.rbi +21 -2
  39. data/rbi/courier/models/notification_retrieve_content_response.rbi +29 -0
  40. data/rbi/courier/models/notification_template_state.rbi +26 -0
  41. data/rbi/courier/models/provider_update_params.rbi +4 -2
  42. data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
  43. data/rbi/courier/models.rbi +28 -6
  44. data/rbi/courier/resources/notifications.rbi +105 -7
  45. data/rbi/courier/resources/providers.rbi +7 -4
  46. data/rbi/courier/resources/routing_strategies.rbi +23 -2
  47. data/sig/courier/models/associated_notification_list_response.rbs +25 -0
  48. data/sig/courier/models/element_with_checksums.rbs +60 -0
  49. data/sig/courier/models/notification_content_get_response.rbs +22 -0
  50. data/sig/courier/models/notification_content_mutation_response.rbs +47 -0
  51. data/sig/courier/models/notification_content_put_request.rbs +50 -0
  52. data/sig/courier/models/notification_element_put_request.rbs +64 -0
  53. data/sig/courier/models/notification_locale_put_request.rbs +39 -0
  54. data/sig/courier/models/notification_put_content_params.rbs +22 -0
  55. data/sig/courier/models/notification_put_element_params.rbs +32 -0
  56. data/sig/courier/models/notification_put_locale_params.rbs +32 -0
  57. data/sig/courier/models/notification_retrieve_content_params.rbs +12 -2
  58. data/sig/courier/models/notification_retrieve_content_response.rbs +12 -0
  59. data/sig/courier/models/notification_template_state.rbs +14 -0
  60. data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
  61. data/sig/courier/models.rbs +24 -4
  62. data/sig/courier/resources/notifications.rbs +32 -5
  63. data/sig/courier/resources/routing_strategies.rbs +9 -2
  64. metadata +41 -14
  65. data/lib/courier/models/notification_template_mutation_response.rb +0 -51
  66. data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
  67. data/lib/courier/models/routing_strategy_mutation_response.rb +0 -19
  68. data/lib/courier/resources/notifications/draft.rb +0 -33
  69. data/rbi/courier/models/notification_template_mutation_response.rbi +0 -121
  70. data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
  71. data/rbi/courier/models/routing_strategy_mutation_response.rbi +0 -31
  72. data/rbi/courier/resources/notifications/draft.rbi +0 -23
  73. data/sig/courier/models/notification_template_mutation_response.rbs +0 -46
  74. data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
  75. data/sig/courier/models/routing_strategy_mutation_response.rbs +0 -13
  76. data/sig/courier/resources/notifications/draft.rbs +0 -14
@@ -45,6 +45,8 @@ module Courier
45
45
 
46
46
  Alignment = Courier::Models::Alignment
47
47
 
48
+ AssociatedNotificationListResponse = Courier::Models::AssociatedNotificationListResponse
49
+
48
50
  Audience = Courier::Models::Audience
49
51
 
50
52
  AudienceDeleteParams = Courier::Models::AudienceDeleteParams
@@ -163,6 +165,8 @@ module Courier
163
165
 
164
166
  ElementalTextNodeWithType = Courier::Models::ElementalTextNodeWithType
165
167
 
168
+ ElementWithChecksums = Courier::Models::ElementWithChecksums
169
+
166
170
  EmailFooter = Courier::Models::EmailFooter
167
171
 
168
172
  EmailHead = Courier::Models::EmailHead
@@ -255,18 +259,34 @@ module Courier
255
259
 
256
260
  NotificationArchiveParams = Courier::Models::NotificationArchiveParams
257
261
 
262
+ NotificationContentGetResponse = Courier::Models::NotificationContentGetResponse
263
+
264
+ NotificationContentMutationResponse = Courier::Models::NotificationContentMutationResponse
265
+
266
+ NotificationContentPutRequest = Courier::Models::NotificationContentPutRequest
267
+
258
268
  NotificationCreateParams = Courier::Models::NotificationCreateParams
259
269
 
270
+ NotificationElementPutRequest = Courier::Models::NotificationElementPutRequest
271
+
260
272
  NotificationGetContent = Courier::Models::NotificationGetContent
261
273
 
262
274
  NotificationListParams = Courier::Models::NotificationListParams
263
275
 
264
276
  NotificationListVersionsParams = Courier::Models::NotificationListVersionsParams
265
277
 
278
+ NotificationLocalePutRequest = Courier::Models::NotificationLocalePutRequest
279
+
266
280
  NotificationPreferenceDetails = Courier::Models::NotificationPreferenceDetails
267
281
 
268
282
  NotificationPublishParams = Courier::Models::NotificationPublishParams
269
283
 
284
+ NotificationPutContentParams = Courier::Models::NotificationPutContentParams
285
+
286
+ NotificationPutElementParams = Courier::Models::NotificationPutElementParams
287
+
288
+ NotificationPutLocaleParams = Courier::Models::NotificationPutLocaleParams
289
+
270
290
  NotificationReplaceParams = Courier::Models::NotificationReplaceParams
271
291
 
272
292
  NotificationRetrieveContentParams = Courier::Models::NotificationRetrieveContentParams
@@ -279,12 +299,12 @@ module Courier
279
299
 
280
300
  NotificationTemplateGetResponse = Courier::Models::NotificationTemplateGetResponse
281
301
 
282
- NotificationTemplateMutationResponse = Courier::Models::NotificationTemplateMutationResponse
283
-
284
302
  NotificationTemplatePayload = Courier::Models::NotificationTemplatePayload
285
303
 
286
304
  NotificationTemplatePublishRequest = Courier::Models::NotificationTemplatePublishRequest
287
305
 
306
+ NotificationTemplateState = Courier::Models::NotificationTemplateState
307
+
288
308
  NotificationTemplateSummary = Courier::Models::NotificationTemplateSummary
289
309
 
290
310
  NotificationTemplateUpdateRequest = Courier::Models::NotificationTemplateUpdateRequest
@@ -351,12 +371,12 @@ module Courier
351
371
 
352
372
  RoutingStrategyGetResponse = Courier::Models::RoutingStrategyGetResponse
353
373
 
374
+ RoutingStrategyListNotificationsParams = Courier::Models::RoutingStrategyListNotificationsParams
375
+
354
376
  RoutingStrategyListParams = Courier::Models::RoutingStrategyListParams
355
377
 
356
378
  RoutingStrategyListResponse = Courier::Models::RoutingStrategyListResponse
357
379
 
358
- RoutingStrategyMutationResponse = Courier::Models::RoutingStrategyMutationResponse
359
-
360
380
  RoutingStrategyReplaceParams = Courier::Models::RoutingStrategyReplaceParams
361
381
 
362
382
  RoutingStrategyReplaceRequest = Courier::Models::RoutingStrategyReplaceRequest
@@ -3,9 +3,6 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Notifications
6
- # @return [Courier::Resources::Notifications::Draft]
7
- attr_reader :draft
8
-
9
6
  # @return [Courier::Resources::Notifications::Checks]
10
7
  attr_reader :checks
11
8
 
@@ -23,7 +20,7 @@ module Courier
23
20
  #
24
21
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
25
22
  #
26
- # @return [Courier::Models::NotificationTemplateMutationResponse]
23
+ # @return [Courier::Models::NotificationTemplateGetResponse]
27
24
  #
28
25
  # @see Courier::Models::NotificationCreateParams
29
26
  def create(params)
@@ -32,7 +29,7 @@ module Courier
32
29
  method: :post,
33
30
  path: "notifications",
34
31
  body: parsed,
35
- model: Courier::NotificationTemplateMutationResponse,
32
+ model: Courier::NotificationTemplateGetResponse,
36
33
  options: options
37
34
  )
38
35
  end
@@ -165,6 +162,111 @@ module Courier
165
162
  )
166
163
  end
167
164
 
165
+ # Replace the elemental content of a notification template. Overwrites all
166
+ # elements in the template with the provided content. Only supported for V2
167
+ # (elemental) templates.
168
+ #
169
+ # @overload put_content(id, content:, state: nil, request_options: {})
170
+ #
171
+ # @param id [String] Notification template ID (`nt_` prefix).
172
+ #
173
+ # @param content [Courier::Models::NotificationContentPutRequest::Content] Elemental content payload. The server defaults `version` when omitted.
174
+ #
175
+ # @param state [Symbol, Courier::Models::NotificationTemplateState] Template state. Defaults to `DRAFT`.
176
+ #
177
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
178
+ #
179
+ # @return [Courier::Models::NotificationContentMutationResponse]
180
+ #
181
+ # @see Courier::Models::NotificationPutContentParams
182
+ def put_content(id, params)
183
+ parsed, options = Courier::NotificationPutContentParams.dump_request(params)
184
+ @client.request(
185
+ method: :put,
186
+ path: ["notifications/%1$s/content", id],
187
+ body: parsed,
188
+ model: Courier::NotificationContentMutationResponse,
189
+ options: options
190
+ )
191
+ end
192
+
193
+ # Update a single element within a notification template. Only supported for V2
194
+ # (elemental) templates.
195
+ #
196
+ # @overload put_element(element_id, id:, type:, channels: nil, data: nil, if_: nil, loop_: nil, ref: nil, state: nil, request_options: {})
197
+ #
198
+ # @param element_id [String] Path param: Element ID within the template.
199
+ #
200
+ # @param id [String] Path param: Notification template ID (`nt_` prefix).
201
+ #
202
+ # @param type [String] Body param: Element type (text, meta, action, image, etc.).
203
+ #
204
+ # @param channels [Array<String>] Body param
205
+ #
206
+ # @param data [Hash{Symbol=>Object}] Body param
207
+ #
208
+ # @param if_ [String] Body param
209
+ #
210
+ # @param loop_ [String] Body param
211
+ #
212
+ # @param ref [String] Body param
213
+ #
214
+ # @param state [Symbol, Courier::Models::NotificationTemplateState] Body param: Template state. Defaults to `DRAFT`.
215
+ #
216
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
217
+ #
218
+ # @return [Courier::Models::NotificationContentMutationResponse]
219
+ #
220
+ # @see Courier::Models::NotificationPutElementParams
221
+ def put_element(element_id, params)
222
+ parsed, options = Courier::NotificationPutElementParams.dump_request(params)
223
+ id =
224
+ parsed.delete(:id) do
225
+ raise ArgumentError.new("missing required path argument #{_1}")
226
+ end
227
+ @client.request(
228
+ method: :put,
229
+ path: ["notifications/%1$s/elements/%2$s", id, element_id],
230
+ body: parsed,
231
+ model: Courier::NotificationContentMutationResponse,
232
+ options: options
233
+ )
234
+ end
235
+
236
+ # Set locale-specific content overrides for a notification template. Each element
237
+ # override must reference an existing element by ID. Only supported for V2
238
+ # (elemental) templates.
239
+ #
240
+ # @overload put_locale(locale_id, id:, elements:, state: nil, request_options: {})
241
+ #
242
+ # @param locale_id [String] Path param: Locale code (e.g., `es`, `fr`, `pt-BR`).
243
+ #
244
+ # @param id [String] Path param: Notification template ID (`nt_` prefix).
245
+ #
246
+ # @param elements [Array<Courier::Models::NotificationLocalePutRequest::Element>] Body param: Elements with locale-specific content overrides.
247
+ #
248
+ # @param state [Symbol, Courier::Models::NotificationTemplateState] Body param: Template state. Defaults to `DRAFT`.
249
+ #
250
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
251
+ #
252
+ # @return [Courier::Models::NotificationContentMutationResponse]
253
+ #
254
+ # @see Courier::Models::NotificationPutLocaleParams
255
+ def put_locale(locale_id, params)
256
+ parsed, options = Courier::NotificationPutLocaleParams.dump_request(params)
257
+ id =
258
+ parsed.delete(:id) do
259
+ raise ArgumentError.new("missing required path argument #{_1}")
260
+ end
261
+ @client.request(
262
+ method: :put,
263
+ path: ["notifications/%1$s/locales/%2$s", id, locale_id],
264
+ body: parsed,
265
+ model: Courier::NotificationContentMutationResponse,
266
+ options: options
267
+ )
268
+ end
269
+
168
270
  # Some parameter documentations has been truncated, see
169
271
  # {Courier::Models::NotificationReplaceParams} for more details.
170
272
  #
@@ -180,7 +282,7 @@ module Courier
180
282
  #
181
283
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
182
284
  #
183
- # @return [Courier::Models::NotificationTemplateMutationResponse]
285
+ # @return [Courier::Models::NotificationTemplateGetResponse]
184
286
  #
185
287
  # @see Courier::Models::NotificationReplaceParams
186
288
  def replace(id, params)
@@ -189,25 +291,39 @@ module Courier
189
291
  method: :put,
190
292
  path: ["notifications/%1$s", id],
191
293
  body: parsed,
192
- model: Courier::NotificationTemplateMutationResponse,
294
+ model: Courier::NotificationTemplateGetResponse,
193
295
  options: options
194
296
  )
195
297
  end
196
298
 
197
- # @overload retrieve_content(id, request_options: {})
299
+ # Some parameter documentations has been truncated, see
300
+ # {Courier::Models::NotificationRetrieveContentParams} for more details.
301
+ #
302
+ # Retrieve the content of a notification template. The response shape depends on
303
+ # whether the template uses V1 (blocks/channels) or V2 (elemental) content. Use
304
+ # the `version` query parameter to select draft, published, or a specific
305
+ # historical version.
306
+ #
307
+ # @overload retrieve_content(id, version: nil, request_options: {})
308
+ #
309
+ # @param id [String] Notification template ID (`nt_` prefix).
310
+ #
311
+ # @param version [String] Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to `p
198
312
  #
199
- # @param id [String]
200
313
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
201
314
  #
202
- # @return [Courier::Models::NotificationGetContent]
315
+ # @return [Courier::Models::NotificationContentGetResponse, Courier::Models::NotificationGetContent]
203
316
  #
204
317
  # @see Courier::Models::NotificationRetrieveContentParams
205
318
  def retrieve_content(id, params = {})
319
+ parsed, options = Courier::NotificationRetrieveContentParams.dump_request(params)
320
+ query = Courier::Internal::Util.encode_query_params(parsed)
206
321
  @client.request(
207
322
  method: :get,
208
323
  path: ["notifications/%1$s/content", id],
209
- model: Courier::NotificationGetContent,
210
- options: params[:request_options]
324
+ query: query,
325
+ model: Courier::Models::NotificationRetrieveContentResponse,
326
+ options: options
211
327
  )
212
328
  end
213
329
 
@@ -216,7 +332,6 @@ module Courier
216
332
  # @param client [Courier::Client]
217
333
  def initialize(client:)
218
334
  @client = client
219
- @draft = Courier::Resources::Notifications::Draft.new(client: client)
220
335
  @checks = Courier::Resources::Notifications::Checks.new(client: client)
221
336
  end
222
337
  end
@@ -61,15 +61,17 @@ module Courier
61
61
  # Some parameter documentations has been truncated, see
62
62
  # {Courier::Models::ProviderUpdateParams} for more details.
63
63
  #
64
- # Update an existing provider configuration. The `provider` key is required. All
65
- # other fields are optional omitted fields are cleared from the stored
66
- # configuration (this is a full replacement, not a partial merge).
64
+ # Replace an existing provider configuration. The `provider` key is required and
65
+ # determines which provider-specific settings schema is applied. All other fields
66
+ # are optional omitted fields are cleared from the stored configuration (this is
67
+ # a full replacement, not a partial merge). Changing the provider type for an
68
+ # existing configuration is not supported.
67
69
  #
68
70
  # @overload update(id, provider:, alias_: nil, settings: nil, title: nil, request_options: {})
69
71
  #
70
72
  # @param id [String] A unique identifier of the provider configuration to update.
71
73
  #
72
- # @param provider [String] The provider key identifying the type.
74
+ # @param provider [String] The provider key identifying the type. Required on every request because it sele
73
75
  #
74
76
  # @param alias_ [String] Updated alias. Omit to clear.
75
77
  #
@@ -85,7 +87,7 @@ module Courier
85
87
  def update(id, params)
86
88
  parsed, options = Courier::ProviderUpdateParams.dump_request(params)
87
89
  @client.request(
88
- method: :post,
90
+ method: :put,
89
91
  path: ["providers/%1$s", id],
90
92
  body: parsed,
91
93
  model: Courier::Provider,
@@ -22,7 +22,7 @@ module Courier
22
22
  #
23
23
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
24
24
  #
25
- # @return [Courier::Models::RoutingStrategyMutationResponse]
25
+ # @return [Courier::Models::RoutingStrategyGetResponse]
26
26
  #
27
27
  # @see Courier::Models::RoutingStrategyCreateParams
28
28
  def create(params)
@@ -31,7 +31,7 @@ module Courier
31
31
  method: :post,
32
32
  path: "routing-strategies",
33
33
  body: parsed,
34
- model: Courier::RoutingStrategyMutationResponse,
34
+ model: Courier::RoutingStrategyGetResponse,
35
35
  options: options
36
36
  )
37
37
  end
@@ -105,6 +105,34 @@ module Courier
105
105
  )
106
106
  end
107
107
 
108
+ # List notification templates associated with a routing strategy. Includes
109
+ # template metadata only, not full content.
110
+ #
111
+ # @overload list_notifications(id, cursor: nil, limit: nil, request_options: {})
112
+ #
113
+ # @param id [String] Routing strategy ID (`rs_` prefix).
114
+ #
115
+ # @param cursor [String, nil] Opaque pagination cursor from a previous response. Omit for the first page.
116
+ #
117
+ # @param limit [Integer] Maximum number of results per page. Default 20, max 100.
118
+ #
119
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
120
+ #
121
+ # @return [Courier::Models::AssociatedNotificationListResponse]
122
+ #
123
+ # @see Courier::Models::RoutingStrategyListNotificationsParams
124
+ def list_notifications(id, params = {})
125
+ parsed, options = Courier::RoutingStrategyListNotificationsParams.dump_request(params)
126
+ query = Courier::Internal::Util.encode_query_params(parsed)
127
+ @client.request(
128
+ method: :get,
129
+ path: ["routing-strategies/%1$s/notifications", id],
130
+ query: query,
131
+ model: Courier::AssociatedNotificationListResponse,
132
+ options: options
133
+ )
134
+ end
135
+
108
136
  # Replace a routing strategy. Full document replacement; the caller must send the
109
137
  # complete desired state. Missing optional fields are cleared.
110
138
  #
@@ -126,7 +154,7 @@ module Courier
126
154
  #
127
155
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
128
156
  #
129
- # @return [Courier::Models::RoutingStrategyMutationResponse]
157
+ # @return [Courier::Models::RoutingStrategyGetResponse]
130
158
  #
131
159
  # @see Courier::Models::RoutingStrategyReplaceParams
132
160
  def replace(id, params)
@@ -135,7 +163,7 @@ module Courier
135
163
  method: :put,
136
164
  path: ["routing-strategies/%1$s", id],
137
165
  body: parsed,
138
- model: Courier::RoutingStrategyMutationResponse,
166
+ model: Courier::RoutingStrategyGetResponse,
139
167
  options: options
140
168
  )
141
169
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.9.0"
4
+ VERSION = "4.10.1"
5
5
  end
data/lib/courier.rb CHANGED
@@ -62,6 +62,9 @@ require_relative "courier/models/journeys_invoke_request"
62
62
  require_relative "courier/models/message_details"
63
63
  require_relative "courier/models/notification_template_create_request"
64
64
  require_relative "courier/models/notification_template_publish_request"
65
+ require_relative "courier/models/notification_content_put_request"
66
+ require_relative "courier/models/notification_element_put_request"
67
+ require_relative "courier/models/notification_locale_put_request"
65
68
  require_relative "courier/models/notification_template_update_request"
66
69
  require_relative "courier/models/notification_template_payload"
67
70
  require_relative "courier/models/routing_strategy_create_request"
@@ -73,6 +76,7 @@ require_relative "courier/models/users/user_token"
73
76
  require_relative "courier/models/airship_profile"
74
77
  require_relative "courier/models/airship_profile_audience"
75
78
  require_relative "courier/models/alignment"
79
+ require_relative "courier/models/associated_notification_list_response"
76
80
  require_relative "courier/models/audience"
77
81
  require_relative "courier/models/audience_delete_params"
78
82
  require_relative "courier/models/audience_filter"
@@ -137,6 +141,7 @@ require_relative "courier/models/elemental_meta_node_with_type"
137
141
  require_relative "courier/models/elemental_node"
138
142
  require_relative "courier/models/elemental_quote_node_with_type"
139
143
  require_relative "courier/models/elemental_text_node_with_type"
144
+ require_relative "courier/models/element_with_checksums"
140
145
  require_relative "courier/models/email_footer"
141
146
  require_relative "courier/models/email_head"
142
147
  require_relative "courier/models/email_header"
@@ -190,6 +195,8 @@ require_relative "courier/models/ms_teams_base_properties"
190
195
  require_relative "courier/models/ms_teams_recipient"
191
196
  require_relative "courier/models/multiple_tokens"
192
197
  require_relative "courier/models/notification_archive_params"
198
+ require_relative "courier/models/notification_content_get_response"
199
+ require_relative "courier/models/notification_content_mutation_response"
193
200
  require_relative "courier/models/notification_create_params"
194
201
  require_relative "courier/models/notification_get_content"
195
202
  require_relative "courier/models/notification_list_params"
@@ -197,17 +204,20 @@ require_relative "courier/models/notification_list_response"
197
204
  require_relative "courier/models/notification_list_versions_params"
198
205
  require_relative "courier/models/notification_preference_details"
199
206
  require_relative "courier/models/notification_publish_params"
207
+ require_relative "courier/models/notification_put_content_params"
208
+ require_relative "courier/models/notification_put_element_params"
209
+ require_relative "courier/models/notification_put_locale_params"
200
210
  require_relative "courier/models/notification_replace_params"
201
211
  require_relative "courier/models/notification_retrieve_content_params"
212
+ require_relative "courier/models/notification_retrieve_content_response"
202
213
  require_relative "courier/models/notification_retrieve_params"
203
214
  require_relative "courier/models/notifications/check_delete_params"
204
215
  require_relative "courier/models/notifications/check_list_params"
205
216
  require_relative "courier/models/notifications/check_list_response"
206
217
  require_relative "courier/models/notifications/check_update_params"
207
218
  require_relative "courier/models/notifications/check_update_response"
208
- require_relative "courier/models/notifications/draft_retrieve_content_params"
209
219
  require_relative "courier/models/notification_template_get_response"
210
- require_relative "courier/models/notification_template_mutation_response"
220
+ require_relative "courier/models/notification_template_state"
211
221
  require_relative "courier/models/notification_template_summary"
212
222
  require_relative "courier/models/notification_template_version_list_response"
213
223
  require_relative "courier/models/pagerduty"
@@ -247,9 +257,9 @@ require_relative "courier/models/request_archive_params"
247
257
  require_relative "courier/models/routing_strategy_archive_params"
248
258
  require_relative "courier/models/routing_strategy_create_params"
249
259
  require_relative "courier/models/routing_strategy_get_response"
260
+ require_relative "courier/models/routing_strategy_list_notifications_params"
250
261
  require_relative "courier/models/routing_strategy_list_params"
251
262
  require_relative "courier/models/routing_strategy_list_response"
252
- require_relative "courier/models/routing_strategy_mutation_response"
253
263
  require_relative "courier/models/routing_strategy_replace_params"
254
264
  require_relative "courier/models/routing_strategy_retrieve_params"
255
265
  require_relative "courier/models/routing_strategy_summary"
@@ -343,7 +353,6 @@ require_relative "courier/resources/lists/subscriptions"
343
353
  require_relative "courier/resources/messages"
344
354
  require_relative "courier/resources/notifications"
345
355
  require_relative "courier/resources/notifications/checks"
346
- require_relative "courier/resources/notifications/draft"
347
356
  require_relative "courier/resources/profiles"
348
357
  require_relative "courier/resources/profiles/lists"
349
358
  require_relative "courier/resources/providers"
@@ -0,0 +1,45 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class AssociatedNotificationListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::AssociatedNotificationListResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(Courier::Paging) }
15
+ attr_reader :paging
16
+
17
+ sig { params(paging: Courier::Paging::OrHash).void }
18
+ attr_writer :paging
19
+
20
+ sig { returns(T::Array[Courier::NotificationTemplateSummary]) }
21
+ attr_accessor :results
22
+
23
+ # Paginated list of notification templates associated with a routing strategy.
24
+ sig do
25
+ params(
26
+ paging: Courier::Paging::OrHash,
27
+ results: T::Array[Courier::NotificationTemplateSummary::OrHash]
28
+ ).returns(T.attached_class)
29
+ end
30
+ def self.new(paging:, results:)
31
+ end
32
+
33
+ sig do
34
+ override.returns(
35
+ {
36
+ paging: Courier::Paging,
37
+ results: T::Array[Courier::NotificationTemplateSummary]
38
+ }
39
+ )
40
+ end
41
+ def to_hash
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,109 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class ElementWithChecksums < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::ElementWithChecksums, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # MD5 hash of translatable content.
12
+ sig { returns(String) }
13
+ attr_accessor :checksum
14
+
15
+ # Element type (text, meta, action, etc.).
16
+ sig { returns(String) }
17
+ attr_accessor :type
18
+
19
+ sig { returns(T.nilable(String)) }
20
+ attr_reader :id
21
+
22
+ sig { params(id: String).void }
23
+ attr_writer :id
24
+
25
+ # Nested child elements (for group-type elements).
26
+ sig { returns(T.nilable(T::Array[Courier::ElementWithChecksums])) }
27
+ attr_reader :elements
28
+
29
+ sig { params(elements: T::Array[Courier::ElementWithChecksums]).void }
30
+ attr_writer :elements
31
+
32
+ # Locale-specific content with checksums.
33
+ sig do
34
+ returns(
35
+ T.nilable(T::Hash[Symbol, Courier::ElementWithChecksums::Locale])
36
+ )
37
+ end
38
+ attr_reader :locales
39
+
40
+ sig do
41
+ params(
42
+ locales:
43
+ T::Hash[Symbol, Courier::ElementWithChecksums::Locale::OrHash]
44
+ ).void
45
+ end
46
+ attr_writer :locales
47
+
48
+ # An element with its content checksum and optional nested elements and locale
49
+ # checksums.
50
+ sig do
51
+ params(
52
+ checksum: String,
53
+ type: String,
54
+ id: String,
55
+ elements: T::Array[Courier::ElementWithChecksums],
56
+ locales:
57
+ T::Hash[Symbol, Courier::ElementWithChecksums::Locale::OrHash]
58
+ ).returns(T.attached_class)
59
+ end
60
+ def self.new(
61
+ # MD5 hash of translatable content.
62
+ checksum:,
63
+ # Element type (text, meta, action, etc.).
64
+ type:,
65
+ id: nil,
66
+ # Nested child elements (for group-type elements).
67
+ elements: nil,
68
+ # Locale-specific content with checksums.
69
+ locales: nil
70
+ )
71
+ end
72
+
73
+ sig do
74
+ override.returns(
75
+ {
76
+ checksum: String,
77
+ type: String,
78
+ id: String,
79
+ elements: T::Array[Courier::ElementWithChecksums],
80
+ locales: T::Hash[Symbol, Courier::ElementWithChecksums::Locale]
81
+ }
82
+ )
83
+ end
84
+ def to_hash
85
+ end
86
+
87
+ class Locale < Courier::Internal::Type::BaseModel
88
+ OrHash =
89
+ T.type_alias do
90
+ T.any(
91
+ Courier::ElementWithChecksums::Locale,
92
+ Courier::Internal::AnyHash
93
+ )
94
+ end
95
+
96
+ sig { returns(String) }
97
+ attr_accessor :checksum
98
+
99
+ sig { params(checksum: String).returns(T.attached_class) }
100
+ def self.new(checksum:)
101
+ end
102
+
103
+ sig { override.returns({ checksum: String }) }
104
+ def to_hash
105
+ end
106
+ end
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,45 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationContentGetResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::NotificationContentGetResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(T::Array[Courier::ElementWithChecksums]) }
15
+ attr_accessor :elements
16
+
17
+ # Content version identifier.
18
+ sig { returns(String) }
19
+ attr_accessor :version
20
+
21
+ # Elemental content response for V2 templates. Contains versioned elements with
22
+ # content checksums.
23
+ sig do
24
+ params(
25
+ elements: T::Array[Courier::ElementWithChecksums::OrHash],
26
+ version: String
27
+ ).returns(T.attached_class)
28
+ end
29
+ def self.new(
30
+ elements:,
31
+ # Content version identifier.
32
+ version:
33
+ )
34
+ end
35
+
36
+ sig do
37
+ override.returns(
38
+ { elements: T::Array[Courier::ElementWithChecksums], version: String }
39
+ )
40
+ end
41
+ def to_hash
42
+ end
43
+ end
44
+ end
45
+ end