trycourier 4.22.0 → 4.24.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.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/lib/courier/client.rb +6 -4
  4. data/lib/courier/models/broadcast.rb +132 -0
  5. data/lib/courier/models/broadcast_archive_params.rb +20 -0
  6. data/lib/courier/models/broadcast_cancel_params.rb +20 -0
  7. data/lib/courier/models/broadcast_create_params.rb +14 -0
  8. data/lib/courier/models/broadcast_duplicate_params.rb +20 -0
  9. data/lib/courier/models/broadcast_list_params.rb +30 -0
  10. data/lib/courier/models/broadcast_list_response.rb +24 -0
  11. data/lib/courier/models/broadcast_put_content_params.rb +20 -0
  12. data/lib/courier/models/broadcast_retrieve_content_params.rb +33 -0
  13. data/lib/courier/models/broadcast_retrieve_params.rb +20 -0
  14. data/lib/courier/models/broadcast_schedule.rb +59 -0
  15. data/lib/courier/models/broadcast_schedule_params.rb +20 -0
  16. data/lib/courier/models/broadcast_send_params.rb +20 -0
  17. data/lib/courier/models/broadcast_update_params.rb +20 -0
  18. data/lib/courier/models/create_broadcast_request.rb +43 -0
  19. data/lib/courier/models/journey_node.rb +1 -1
  20. data/lib/courier/models/journey_send_node.rb +46 -3
  21. data/lib/courier/models/schedule_broadcast_request.rb +59 -0
  22. data/lib/courier/models/send_broadcast_request.rb +39 -0
  23. data/lib/courier/models/update_broadcast_request.rb +18 -0
  24. data/lib/courier/models.rb +36 -2
  25. data/lib/courier/resources/broadcasts.rb +292 -0
  26. data/lib/courier/version.rb +1 -1
  27. data/lib/courier.rb +20 -5
  28. data/rbi/courier/client.rbi +5 -3
  29. data/rbi/courier/models/broadcast.rbi +164 -0
  30. data/rbi/courier/models/broadcast_archive_params.rbi +35 -0
  31. data/rbi/courier/models/broadcast_cancel_params.rbi +35 -0
  32. data/rbi/courier/models/broadcast_create_params.rbi +27 -0
  33. data/rbi/courier/models/broadcast_duplicate_params.rbi +35 -0
  34. data/rbi/courier/models/broadcast_list_params.rbi +54 -0
  35. data/rbi/courier/models/broadcast_list_response.rbi +39 -0
  36. data/rbi/courier/models/broadcast_put_content_params.rbi +35 -0
  37. data/rbi/courier/models/broadcast_retrieve_content_params.rbi +57 -0
  38. data/rbi/courier/models/broadcast_retrieve_params.rbi +35 -0
  39. data/rbi/courier/models/broadcast_schedule.rbi +92 -0
  40. data/rbi/courier/models/broadcast_schedule_params.rbi +35 -0
  41. data/rbi/courier/models/broadcast_send_params.rbi +35 -0
  42. data/rbi/courier/models/broadcast_update_params.rbi +35 -0
  43. data/rbi/courier/models/create_broadcast_request.rbi +81 -0
  44. data/rbi/courier/models/journey_send_node.rbi +72 -3
  45. data/rbi/courier/models/schedule_broadcast_request.rbi +103 -0
  46. data/rbi/courier/models/send_broadcast_request.rbi +77 -0
  47. data/rbi/courier/models/update_broadcast_request.rbi +28 -0
  48. data/rbi/courier/models.rbi +37 -2
  49. data/rbi/courier/resources/broadcasts.rbi +201 -0
  50. data/sig/courier/client.rbs +2 -2
  51. data/sig/courier/models/broadcast.rbs +98 -0
  52. data/sig/courier/models/broadcast_archive_params.rbs +23 -0
  53. data/sig/courier/models/broadcast_cancel_params.rbs +23 -0
  54. data/sig/courier/models/broadcast_create_params.rbs +15 -0
  55. data/sig/courier/models/broadcast_duplicate_params.rbs +23 -0
  56. data/sig/courier/models/broadcast_list_params.rbs +30 -0
  57. data/sig/courier/models/broadcast_list_response.rbs +22 -0
  58. data/sig/courier/models/broadcast_put_content_params.rbs +25 -0
  59. data/sig/courier/models/broadcast_retrieve_content_params.rbs +30 -0
  60. data/sig/courier/models/broadcast_retrieve_params.rbs +23 -0
  61. data/sig/courier/models/broadcast_schedule.rbs +46 -0
  62. data/sig/courier/models/broadcast_schedule_params.rbs +25 -0
  63. data/sig/courier/models/broadcast_send_params.rbs +25 -0
  64. data/sig/courier/models/broadcast_update_params.rbs +25 -0
  65. data/sig/courier/models/create_broadcast_request.rbs +40 -0
  66. data/sig/courier/models/journey_send_node.rbs +19 -0
  67. data/sig/courier/models/schedule_broadcast_request.rbs +48 -0
  68. data/sig/courier/models/send_broadcast_request.rbs +36 -0
  69. data/sig/courier/models/update_broadcast_request.rbs +13 -0
  70. data/sig/courier/models.rbs +36 -2
  71. data/sig/courier/resources/broadcasts.rbs +74 -0
  72. metadata +59 -14
  73. data/lib/courier/models/inbox/message_delete_params.rb +0 -22
  74. data/lib/courier/models/inbox/message_restore_params.rb +0 -22
  75. data/lib/courier/resources/inbox/messages.rb +0 -58
  76. data/lib/courier/resources/inbox.rb +0 -19
  77. data/rbi/courier/models/inbox/message_delete_params.rbi +0 -40
  78. data/rbi/courier/models/inbox/message_restore_params.rbi +0 -40
  79. data/rbi/courier/resources/inbox/messages.rbi +0 -44
  80. data/rbi/courier/resources/inbox.rbi +0 -16
  81. data/sig/courier/models/inbox/message_delete_params.rbs +0 -25
  82. data/sig/courier/models/inbox/message_restore_params.rbs +0 -25
  83. data/sig/courier/resources/inbox/messages.rbs +0 -19
  84. data/sig/courier/resources/inbox.rbs +0 -9
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class ScheduleBroadcastRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute recipient_id
7
+ # ID of the target list or audience.
8
+ #
9
+ # @return [String]
10
+ required :recipient_id, String
11
+
12
+ # @!attribute recipient_type
13
+ # Whether the broadcast targets a list or an audience.
14
+ #
15
+ # @return [Symbol, Courier::Models::ScheduleBroadcastRequest::RecipientType]
16
+ required :recipient_type, enum: -> { Courier::ScheduleBroadcastRequest::RecipientType }
17
+
18
+ # @!attribute scheduled_to
19
+ # Wall-clock timestamp of the future send, no timezone offset (e.g.
20
+ # "2026-07-21T20:00:00"). The zone is given by `timezone`.
21
+ #
22
+ # @return [String]
23
+ required :scheduled_to, String
24
+
25
+ # @!attribute timezone
26
+ # IANA timezone for the scheduled send (e.g. America/New_York).
27
+ #
28
+ # @return [String, nil]
29
+ optional :timezone, String
30
+
31
+ # @!method initialize(recipient_id:, recipient_type:, scheduled_to:, timezone: nil)
32
+ # Some parameter documentations has been truncated, see
33
+ # {Courier::Models::ScheduleBroadcastRequest} for more details.
34
+ #
35
+ # Request body for scheduling a broadcast for a future send.
36
+ #
37
+ # @param recipient_id [String] ID of the target list or audience.
38
+ #
39
+ # @param recipient_type [Symbol, Courier::Models::ScheduleBroadcastRequest::RecipientType] Whether the broadcast targets a list or an audience.
40
+ #
41
+ # @param scheduled_to [String] Wall-clock timestamp of the future send, no timezone offset (e.g. "2026-07-21T20
42
+ #
43
+ # @param timezone [String] IANA timezone for the scheduled send (e.g. America/New_York).
44
+
45
+ # Whether the broadcast targets a list or an audience.
46
+ #
47
+ # @see Courier::Models::ScheduleBroadcastRequest#recipient_type
48
+ module RecipientType
49
+ extend Courier::Internal::Type::Enum
50
+
51
+ LIST = :list
52
+ AUDIENCE = :audience
53
+
54
+ # @!method self.values
55
+ # @return [Array<Symbol>]
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class SendBroadcastRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute recipient_id
7
+ # ID of the target list or audience.
8
+ #
9
+ # @return [String]
10
+ required :recipient_id, String
11
+
12
+ # @!attribute recipient_type
13
+ # Whether the broadcast targets a list or an audience.
14
+ #
15
+ # @return [Symbol, Courier::Models::SendBroadcastRequest::RecipientType]
16
+ required :recipient_type, enum: -> { Courier::SendBroadcastRequest::RecipientType }
17
+
18
+ # @!method initialize(recipient_id:, recipient_type:)
19
+ # Request body for sending a broadcast immediately.
20
+ #
21
+ # @param recipient_id [String] ID of the target list or audience.
22
+ #
23
+ # @param recipient_type [Symbol, Courier::Models::SendBroadcastRequest::RecipientType] Whether the broadcast targets a list or an audience.
24
+
25
+ # Whether the broadcast targets a list or an audience.
26
+ #
27
+ # @see Courier::Models::SendBroadcastRequest#recipient_type
28
+ module RecipientType
29
+ extend Courier::Internal::Type::Enum
30
+
31
+ LIST = :list
32
+ AUDIENCE = :audience
33
+
34
+ # @!method self.values
35
+ # @return [Array<Symbol>]
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class UpdateBroadcastRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute name
7
+ # New human-readable name.
8
+ #
9
+ # @return [String]
10
+ required :name, String
11
+
12
+ # @!method initialize(name:)
13
+ # Request body for updating a broadcast. Only the name is mutable.
14
+ #
15
+ # @param name [String] New human-readable name.
16
+ end
17
+ end
18
+ end
@@ -113,6 +113,34 @@ module Courier
113
113
 
114
114
  BrandUpdateParams = Courier::Models::BrandUpdateParams
115
115
 
116
+ Broadcast = Courier::Models::Broadcast
117
+
118
+ BroadcastArchiveParams = Courier::Models::BroadcastArchiveParams
119
+
120
+ BroadcastCancelParams = Courier::Models::BroadcastCancelParams
121
+
122
+ BroadcastCreateParams = Courier::Models::BroadcastCreateParams
123
+
124
+ BroadcastDuplicateParams = Courier::Models::BroadcastDuplicateParams
125
+
126
+ BroadcastListParams = Courier::Models::BroadcastListParams
127
+
128
+ BroadcastListResponse = Courier::Models::BroadcastListResponse
129
+
130
+ BroadcastPutContentParams = Courier::Models::BroadcastPutContentParams
131
+
132
+ BroadcastRetrieveContentParams = Courier::Models::BroadcastRetrieveContentParams
133
+
134
+ BroadcastRetrieveParams = Courier::Models::BroadcastRetrieveParams
135
+
136
+ BroadcastSchedule = Courier::Models::BroadcastSchedule
137
+
138
+ BroadcastScheduleParams = Courier::Models::BroadcastScheduleParams
139
+
140
+ BroadcastSendParams = Courier::Models::BroadcastSendParams
141
+
142
+ BroadcastUpdateParams = Courier::Models::BroadcastUpdateParams
143
+
116
144
  CancelJourneyRequest = Courier::Models::CancelJourneyRequest
117
145
 
118
146
  CancelJourneyResponse = Courier::Models::CancelJourneyResponse
@@ -127,6 +155,8 @@ module Courier
127
155
 
128
156
  Check = Courier::Models::Check
129
157
 
158
+ CreateBroadcastRequest = Courier::Models::CreateBroadcastRequest
159
+
130
160
  CreateJourneyRequest = Courier::Models::CreateJourneyRequest
131
161
 
132
162
  DefaultPreferences = Courier::Models::DefaultPreferences
@@ -185,8 +215,6 @@ module Courier
185
215
 
186
216
  InboundTrackEventParams = Courier::Models::InboundTrackEventParams
187
217
 
188
- Inbox = Courier::Models::Inbox
189
-
190
218
  Intercom = Courier::Models::Intercom
191
219
 
192
220
  IntercomRecipient = Courier::Models::IntercomRecipient
@@ -474,6 +502,10 @@ module Courier
474
502
 
475
503
  Rule = Courier::Models::Rule
476
504
 
505
+ ScheduleBroadcastRequest = Courier::Models::ScheduleBroadcastRequest
506
+
507
+ SendBroadcastRequest = Courier::Models::SendBroadcastRequest
508
+
477
509
  SendDirectMessage = Courier::Models::SendDirectMessage
478
510
 
479
511
  SendMessageParams = Courier::Models::SendMessageParams
@@ -536,6 +568,8 @@ module Courier
536
568
 
537
569
  TranslationUpdateParams = Courier::Models::TranslationUpdateParams
538
570
 
571
+ UpdateBroadcastRequest = Courier::Models::UpdateBroadcastRequest
572
+
539
573
  UserProfile = Courier::Models::UserProfile
540
574
 
541
575
  UserProfileFirebaseToken = Courier::Models::UserProfileFirebaseToken
@@ -0,0 +1,292 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Resources
5
+ # Create a one-off send to a list or audience, author its content, then send it
6
+ # immediately or schedule it for later.
7
+ class Broadcasts
8
+ # Create a broadcast. Provisions a private notification template for the broadcast
9
+ # and returns the new broadcast in the draft state. Exactly one channel is
10
+ # required.
11
+ #
12
+ # @overload create(channel:, name:, request_options: {})
13
+ #
14
+ # @param channel [Symbol, Courier::Models::CreateBroadcastRequest::Channel] The single delivery channel for this broadcast.
15
+ #
16
+ # @param name [String] Human-readable name.
17
+ #
18
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
19
+ #
20
+ # @return [Courier::Models::Broadcast]
21
+ #
22
+ # @see Courier::Models::BroadcastCreateParams
23
+ def create(params)
24
+ parsed, options = Courier::BroadcastCreateParams.dump_request(params)
25
+ @client.request(
26
+ method: :post,
27
+ path: "broadcasts",
28
+ body: parsed,
29
+ model: Courier::Broadcast,
30
+ options: options
31
+ )
32
+ end
33
+
34
+ # Retrieve a broadcast by ID. Archived broadcasts return 404.
35
+ #
36
+ # @overload retrieve(broadcast_id, request_options: {})
37
+ #
38
+ # @param broadcast_id [String]
39
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
40
+ #
41
+ # @return [Courier::Models::Broadcast]
42
+ #
43
+ # @see Courier::Models::BroadcastRetrieveParams
44
+ def retrieve(broadcast_id, params = {})
45
+ @client.request(
46
+ method: :get,
47
+ path: ["broadcasts/%1$s", broadcast_id],
48
+ model: Courier::Broadcast,
49
+ options: params[:request_options]
50
+ )
51
+ end
52
+
53
+ # Update a broadcast's name. Content is edited via the broadcast's notification
54
+ # template, not this endpoint.
55
+ #
56
+ # @overload update(broadcast_id, name:, request_options: {})
57
+ #
58
+ # @param broadcast_id [String]
59
+ #
60
+ # @param name [String] New human-readable name.
61
+ #
62
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
63
+ #
64
+ # @return [Courier::Models::Broadcast]
65
+ #
66
+ # @see Courier::Models::BroadcastUpdateParams
67
+ def update(broadcast_id, params)
68
+ parsed, options = Courier::BroadcastUpdateParams.dump_request(params)
69
+ @client.request(
70
+ method: :put,
71
+ path: ["broadcasts/%1$s", broadcast_id],
72
+ body: parsed,
73
+ model: Courier::Broadcast,
74
+ options: options
75
+ )
76
+ end
77
+
78
+ # List broadcasts in your workspace. Cursor-paginated; returns broadcasts
79
+ # newest-first.
80
+ #
81
+ # @overload list(cursor: nil, limit: nil, request_options: {})
82
+ #
83
+ # @param cursor [String, nil] Opaque pagination cursor from a previous response. Omit for the first page.
84
+ #
85
+ # @param limit [Integer] Maximum number of results per page.
86
+ #
87
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
88
+ #
89
+ # @return [Courier::Models::BroadcastListResponse]
90
+ #
91
+ # @see Courier::Models::BroadcastListParams
92
+ def list(params = {})
93
+ parsed, options = Courier::BroadcastListParams.dump_request(params)
94
+ query = Courier::Internal::Util.encode_query_params(parsed)
95
+ @client.request(
96
+ method: :get,
97
+ path: "broadcasts",
98
+ query: query,
99
+ model: Courier::BroadcastListResponse,
100
+ options: options
101
+ )
102
+ end
103
+
104
+ # Archive a broadcast. This is a soft delete — the archived broadcast is returned
105
+ # and no longer appears in list results.
106
+ #
107
+ # @overload archive(broadcast_id, request_options: {})
108
+ #
109
+ # @param broadcast_id [String]
110
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
111
+ #
112
+ # @return [Courier::Models::Broadcast]
113
+ #
114
+ # @see Courier::Models::BroadcastArchiveParams
115
+ def archive(broadcast_id, params = {})
116
+ @client.request(
117
+ method: :delete,
118
+ path: ["broadcasts/%1$s", broadcast_id],
119
+ model: Courier::Broadcast,
120
+ options: params[:request_options]
121
+ )
122
+ end
123
+
124
+ # Cancel a broadcast's pending schedule, returning it to the draft state. Only
125
+ # valid for a scheduled broadcast.
126
+ #
127
+ # @overload cancel(broadcast_id, request_options: {})
128
+ #
129
+ # @param broadcast_id [String]
130
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
131
+ #
132
+ # @return [Courier::Models::Broadcast]
133
+ #
134
+ # @see Courier::Models::BroadcastCancelParams
135
+ def cancel(broadcast_id, params = {})
136
+ @client.request(
137
+ method: :post,
138
+ path: ["broadcasts/%1$s/cancel", broadcast_id],
139
+ model: Courier::Broadcast,
140
+ options: params[:request_options]
141
+ )
142
+ end
143
+
144
+ # Duplicate a broadcast (and its template) into a new draft named "{source name}
145
+ # (copy)".
146
+ #
147
+ # @overload duplicate(broadcast_id, request_options: {})
148
+ #
149
+ # @param broadcast_id [String]
150
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
151
+ #
152
+ # @return [Courier::Models::Broadcast]
153
+ #
154
+ # @see Courier::Models::BroadcastDuplicateParams
155
+ def duplicate(broadcast_id, params = {})
156
+ @client.request(
157
+ method: :post,
158
+ path: ["broadcasts/%1$s/duplicate", broadcast_id],
159
+ model: Courier::Broadcast,
160
+ options: params[:request_options]
161
+ )
162
+ end
163
+
164
+ # Author the broadcast's content by replacing the draft elemental content of its
165
+ # private notification template. The draft is published automatically when the
166
+ # broadcast is sent or scheduled.
167
+ #
168
+ # @overload put_content(broadcast_id, content:, state: nil, request_options: {})
169
+ #
170
+ # @param broadcast_id [String]
171
+ #
172
+ # @param content [Courier::Models::NotificationContentPutRequest::Content] Elemental content payload. The server defaults `version` when omitted.
173
+ #
174
+ # @param state [Symbol, Courier::Models::NotificationTemplateState] Template state. Defaults to `DRAFT`.
175
+ #
176
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
177
+ #
178
+ # @return [Courier::Models::NotificationContentMutationResponse]
179
+ #
180
+ # @see Courier::Models::BroadcastPutContentParams
181
+ def put_content(broadcast_id, params)
182
+ parsed, options = Courier::BroadcastPutContentParams.dump_request(params)
183
+ @client.request(
184
+ method: :put,
185
+ path: ["broadcasts/%1$s/content", broadcast_id],
186
+ body: parsed,
187
+ model: Courier::NotificationContentMutationResponse,
188
+ options: options
189
+ )
190
+ end
191
+
192
+ # Some parameter documentations has been truncated, see
193
+ # {Courier::Models::BroadcastRetrieveContentParams} for more details.
194
+ #
195
+ # Retrieve the broadcast's content — the elemental content of its private
196
+ # notification template. Defaults to the working draft, since broadcast content is
197
+ # authored as a draft until the broadcast is sent.
198
+ #
199
+ # @overload retrieve_content(broadcast_id, version: nil, request_options: {})
200
+ #
201
+ # @param broadcast_id [String]
202
+ #
203
+ # @param version [String] Accepts `draft`, `published`, or a version string (e.g. `v001`). Defaults to `dr
204
+ #
205
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
206
+ #
207
+ # @return [Courier::Models::NotificationContentGetResponse]
208
+ #
209
+ # @see Courier::Models::BroadcastRetrieveContentParams
210
+ def retrieve_content(broadcast_id, params = {})
211
+ parsed, options = Courier::BroadcastRetrieveContentParams.dump_request(params)
212
+ query = Courier::Internal::Util.encode_query_params(parsed)
213
+ @client.request(
214
+ method: :get,
215
+ path: ["broadcasts/%1$s/content", broadcast_id],
216
+ query: query,
217
+ model: Courier::NotificationContentGetResponse,
218
+ options: options
219
+ )
220
+ end
221
+
222
+ # Some parameter documentations has been truncated, see
223
+ # {Courier::Models::BroadcastScheduleParams} for more details.
224
+ #
225
+ # Schedule a broadcast for a future send to a list or audience. Publishes the
226
+ # broadcast template first. Not allowed once the broadcast is sending or sent. For
227
+ # an immediate send use POST /broadcasts/{broadcastId}/send.
228
+ #
229
+ # @overload schedule(broadcast_id, recipient_id:, recipient_type:, scheduled_to:, timezone: nil, request_options: {})
230
+ #
231
+ # @param broadcast_id [String]
232
+ #
233
+ # @param recipient_id [String] ID of the target list or audience.
234
+ #
235
+ # @param recipient_type [Symbol, Courier::Models::ScheduleBroadcastRequest::RecipientType] Whether the broadcast targets a list or an audience.
236
+ #
237
+ # @param scheduled_to [String] Wall-clock timestamp of the future send, no timezone offset (e.g. "2026-07-21T20
238
+ #
239
+ # @param timezone [String] IANA timezone for the scheduled send (e.g. America/New_York).
240
+ #
241
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
242
+ #
243
+ # @return [Courier::Models::Broadcast]
244
+ #
245
+ # @see Courier::Models::BroadcastScheduleParams
246
+ def schedule(broadcast_id, params)
247
+ parsed, options = Courier::BroadcastScheduleParams.dump_request(params)
248
+ @client.request(
249
+ method: :post,
250
+ path: ["broadcasts/%1$s/schedule", broadcast_id],
251
+ body: parsed,
252
+ model: Courier::Broadcast,
253
+ options: options
254
+ )
255
+ end
256
+
257
+ # Send a broadcast immediately to a list or audience. Publishes the broadcast
258
+ # template first. Not allowed once the broadcast is sending or sent.
259
+ #
260
+ # @overload send_(broadcast_id, recipient_id:, recipient_type:, request_options: {})
261
+ #
262
+ # @param broadcast_id [String]
263
+ #
264
+ # @param recipient_id [String] ID of the target list or audience.
265
+ #
266
+ # @param recipient_type [Symbol, Courier::Models::SendBroadcastRequest::RecipientType] Whether the broadcast targets a list or an audience.
267
+ #
268
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
269
+ #
270
+ # @return [Courier::Models::Broadcast]
271
+ #
272
+ # @see Courier::Models::BroadcastSendParams
273
+ def send_(broadcast_id, params)
274
+ parsed, options = Courier::BroadcastSendParams.dump_request(params)
275
+ @client.request(
276
+ method: :post,
277
+ path: ["broadcasts/%1$s/send", broadcast_id],
278
+ body: parsed,
279
+ model: Courier::Broadcast,
280
+ options: options
281
+ )
282
+ end
283
+
284
+ # @api private
285
+ #
286
+ # @param client [Courier::Client]
287
+ def initialize(client:)
288
+ @client = client
289
+ end
290
+ end
291
+ end
292
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.22.0"
4
+ VERSION = "4.24.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -54,6 +54,11 @@ require_relative "courier/internal/transport/pooled_net_requester"
54
54
  require_relative "courier/client"
55
55
  require_relative "courier/models/elemental_base_node"
56
56
  require_relative "courier/models/brand_template"
57
+ require_relative "courier/models/create_broadcast_request"
58
+ require_relative "courier/models/notification_content_put_request"
59
+ require_relative "courier/models/schedule_broadcast_request"
60
+ require_relative "courier/models/send_broadcast_request"
61
+ require_relative "courier/models/update_broadcast_request"
57
62
  require_relative "courier/models/base_check"
58
63
  require_relative "courier/models/subscription_topic_new"
59
64
  require_relative "courier/models/elemental_channel_node"
@@ -63,7 +68,6 @@ require_relative "courier/models/journeys_invoke_request"
63
68
  require_relative "courier/models/journey_publish_request"
64
69
  require_relative "courier/models/journey_template_create_request"
65
70
  require_relative "courier/models/journey_template_publish_request"
66
- require_relative "courier/models/notification_content_put_request"
67
71
  require_relative "courier/models/notification_locale_put_request"
68
72
  require_relative "courier/models/journey_template_replace_request"
69
73
  require_relative "courier/models/message_details"
@@ -124,6 +128,20 @@ require_relative "courier/models/brand_settings_in_app"
124
128
  require_relative "courier/models/brand_snippet"
125
129
  require_relative "courier/models/brand_snippets"
126
130
  require_relative "courier/models/brand_update_params"
131
+ require_relative "courier/models/broadcast"
132
+ require_relative "courier/models/broadcast_archive_params"
133
+ require_relative "courier/models/broadcast_cancel_params"
134
+ require_relative "courier/models/broadcast_create_params"
135
+ require_relative "courier/models/broadcast_duplicate_params"
136
+ require_relative "courier/models/broadcast_list_params"
137
+ require_relative "courier/models/broadcast_list_response"
138
+ require_relative "courier/models/broadcast_put_content_params"
139
+ require_relative "courier/models/broadcast_retrieve_content_params"
140
+ require_relative "courier/models/broadcast_retrieve_params"
141
+ require_relative "courier/models/broadcast_schedule"
142
+ require_relative "courier/models/broadcast_schedule_params"
143
+ require_relative "courier/models/broadcast_send_params"
144
+ require_relative "courier/models/broadcast_update_params"
127
145
  require_relative "courier/models/cancel_journey_response"
128
146
  require_relative "courier/models/channel"
129
147
  require_relative "courier/models/channel_classification"
@@ -158,8 +176,6 @@ require_relative "courier/models/filter_config"
158
176
  require_relative "courier/models/icons"
159
177
  require_relative "courier/models/inbound_track_event_params"
160
178
  require_relative "courier/models/inbound_track_event_response"
161
- require_relative "courier/models/inbox/message_delete_params"
162
- require_relative "courier/models/inbox/message_restore_params"
163
179
  require_relative "courier/models/intercom"
164
180
  require_relative "courier/models/intercom_recipient"
165
181
  require_relative "courier/models/journey"
@@ -423,11 +439,10 @@ require_relative "courier/resources/auth"
423
439
  require_relative "courier/resources/automations"
424
440
  require_relative "courier/resources/automations/invoke"
425
441
  require_relative "courier/resources/brands"
442
+ require_relative "courier/resources/broadcasts"
426
443
  require_relative "courier/resources/digests"
427
444
  require_relative "courier/resources/digests/schedules"
428
445
  require_relative "courier/resources/inbound"
429
- require_relative "courier/resources/inbox"
430
- require_relative "courier/resources/inbox/messages"
431
446
  require_relative "courier/resources/journeys"
432
447
  require_relative "courier/resources/journeys/templates"
433
448
  require_relative "courier/resources/lists"
@@ -48,6 +48,11 @@ module Courier
48
48
  sig { returns(Courier::Resources::Journeys) }
49
49
  attr_reader :journeys
50
50
 
51
+ # Create a one-off send to a list or audience, author its content, then send it
52
+ # immediately or schedule it for later.
53
+ sig { returns(Courier::Resources::Broadcasts) }
54
+ attr_reader :broadcasts
55
+
51
56
  # Manage the logos, colors, and layout that give the templates you send a
52
57
  # consistent look.
53
58
  sig { returns(Courier::Resources::Brands) }
@@ -65,9 +70,6 @@ module Courier
65
70
  sig { returns(Courier::Resources::Lists) }
66
71
  attr_reader :lists
67
72
 
68
- sig { returns(Courier::Resources::Inbox) }
69
- attr_reader :inbox
70
-
71
73
  # Look up the messages Courier has accepted, inspect their delivery history and
72
74
  # rendered output, and cancel, resend, or archive them.
73
75
  sig { returns(Courier::Resources::Messages) }