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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/lib/courier/client.rb +6 -4
- data/lib/courier/models/broadcast.rb +132 -0
- data/lib/courier/models/broadcast_archive_params.rb +20 -0
- data/lib/courier/models/broadcast_cancel_params.rb +20 -0
- data/lib/courier/models/broadcast_create_params.rb +14 -0
- data/lib/courier/models/broadcast_duplicate_params.rb +20 -0
- data/lib/courier/models/broadcast_list_params.rb +30 -0
- data/lib/courier/models/broadcast_list_response.rb +24 -0
- data/lib/courier/models/broadcast_put_content_params.rb +20 -0
- data/lib/courier/models/broadcast_retrieve_content_params.rb +33 -0
- data/lib/courier/models/broadcast_retrieve_params.rb +20 -0
- data/lib/courier/models/broadcast_schedule.rb +59 -0
- data/lib/courier/models/broadcast_schedule_params.rb +20 -0
- data/lib/courier/models/broadcast_send_params.rb +20 -0
- data/lib/courier/models/broadcast_update_params.rb +20 -0
- data/lib/courier/models/create_broadcast_request.rb +43 -0
- data/lib/courier/models/journey_node.rb +1 -1
- data/lib/courier/models/journey_send_node.rb +46 -3
- data/lib/courier/models/schedule_broadcast_request.rb +59 -0
- data/lib/courier/models/send_broadcast_request.rb +39 -0
- data/lib/courier/models/update_broadcast_request.rb +18 -0
- data/lib/courier/models.rb +36 -2
- data/lib/courier/resources/broadcasts.rb +292 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +20 -5
- data/rbi/courier/client.rbi +5 -3
- data/rbi/courier/models/broadcast.rbi +164 -0
- data/rbi/courier/models/broadcast_archive_params.rbi +35 -0
- data/rbi/courier/models/broadcast_cancel_params.rbi +35 -0
- data/rbi/courier/models/broadcast_create_params.rbi +27 -0
- data/rbi/courier/models/broadcast_duplicate_params.rbi +35 -0
- data/rbi/courier/models/broadcast_list_params.rbi +54 -0
- data/rbi/courier/models/broadcast_list_response.rbi +39 -0
- data/rbi/courier/models/broadcast_put_content_params.rbi +35 -0
- data/rbi/courier/models/broadcast_retrieve_content_params.rbi +57 -0
- data/rbi/courier/models/broadcast_retrieve_params.rbi +35 -0
- data/rbi/courier/models/broadcast_schedule.rbi +92 -0
- data/rbi/courier/models/broadcast_schedule_params.rbi +35 -0
- data/rbi/courier/models/broadcast_send_params.rbi +35 -0
- data/rbi/courier/models/broadcast_update_params.rbi +35 -0
- data/rbi/courier/models/create_broadcast_request.rbi +81 -0
- data/rbi/courier/models/journey_send_node.rbi +72 -3
- data/rbi/courier/models/schedule_broadcast_request.rbi +103 -0
- data/rbi/courier/models/send_broadcast_request.rbi +77 -0
- data/rbi/courier/models/update_broadcast_request.rbi +28 -0
- data/rbi/courier/models.rbi +37 -2
- data/rbi/courier/resources/broadcasts.rbi +201 -0
- data/sig/courier/client.rbs +2 -2
- data/sig/courier/models/broadcast.rbs +98 -0
- data/sig/courier/models/broadcast_archive_params.rbs +23 -0
- data/sig/courier/models/broadcast_cancel_params.rbs +23 -0
- data/sig/courier/models/broadcast_create_params.rbs +15 -0
- data/sig/courier/models/broadcast_duplicate_params.rbs +23 -0
- data/sig/courier/models/broadcast_list_params.rbs +30 -0
- data/sig/courier/models/broadcast_list_response.rbs +22 -0
- data/sig/courier/models/broadcast_put_content_params.rbs +25 -0
- data/sig/courier/models/broadcast_retrieve_content_params.rbs +30 -0
- data/sig/courier/models/broadcast_retrieve_params.rbs +23 -0
- data/sig/courier/models/broadcast_schedule.rbs +46 -0
- data/sig/courier/models/broadcast_schedule_params.rbs +25 -0
- data/sig/courier/models/broadcast_send_params.rbs +25 -0
- data/sig/courier/models/broadcast_update_params.rbs +25 -0
- data/sig/courier/models/create_broadcast_request.rbs +40 -0
- data/sig/courier/models/journey_send_node.rbs +19 -0
- data/sig/courier/models/schedule_broadcast_request.rbs +48 -0
- data/sig/courier/models/send_broadcast_request.rbs +36 -0
- data/sig/courier/models/update_broadcast_request.rbs +13 -0
- data/sig/courier/models.rbs +36 -2
- data/sig/courier/resources/broadcasts.rbs +74 -0
- metadata +59 -14
- data/lib/courier/models/inbox/message_delete_params.rb +0 -22
- data/lib/courier/models/inbox/message_restore_params.rb +0 -22
- data/lib/courier/resources/inbox/messages.rb +0 -58
- data/lib/courier/resources/inbox.rb +0 -19
- data/rbi/courier/models/inbox/message_delete_params.rbi +0 -40
- data/rbi/courier/models/inbox/message_restore_params.rbi +0 -40
- data/rbi/courier/resources/inbox/messages.rbi +0 -44
- data/rbi/courier/resources/inbox.rbi +0 -16
- data/sig/courier/models/inbox/message_delete_params.rbs +0 -25
- data/sig/courier/models/inbox/message_restore_params.rbs +0 -25
- data/sig/courier/resources/inbox/messages.rbs +0 -19
- data/sig/courier/resources/inbox.rbs +0 -9
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class BroadcastUpdateParams < Courier::Models::UpdateBroadcastRequest
|
|
6
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include Courier::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(Courier::BroadcastUpdateParams, Courier::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :broadcast_id
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(
|
|
19
|
+
broadcast_id: String,
|
|
20
|
+
request_options: Courier::RequestOptions::OrHash
|
|
21
|
+
).returns(T.attached_class)
|
|
22
|
+
end
|
|
23
|
+
def self.new(broadcast_id:, request_options: {})
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
sig do
|
|
27
|
+
override.returns(
|
|
28
|
+
{ broadcast_id: String, request_options: Courier::RequestOptions }
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
def to_hash
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class CreateBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::CreateBroadcastRequest, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The single delivery channel for this broadcast.
|
|
12
|
+
sig { returns(Courier::CreateBroadcastRequest::Channel::OrSymbol) }
|
|
13
|
+
attr_accessor :channel
|
|
14
|
+
|
|
15
|
+
# Human-readable name.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :name
|
|
18
|
+
|
|
19
|
+
# Request body for creating a broadcast.
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
channel: Courier::CreateBroadcastRequest::Channel::OrSymbol,
|
|
23
|
+
name: String
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# The single delivery channel for this broadcast.
|
|
28
|
+
channel:,
|
|
29
|
+
# Human-readable name.
|
|
30
|
+
name:
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
channel: Courier::CreateBroadcastRequest::Channel::OrSymbol,
|
|
38
|
+
name: String
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
def to_hash
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# The single delivery channel for this broadcast.
|
|
46
|
+
module Channel
|
|
47
|
+
extend Courier::Internal::Type::Enum
|
|
48
|
+
|
|
49
|
+
TaggedSymbol =
|
|
50
|
+
T.type_alias do
|
|
51
|
+
T.all(Symbol, Courier::CreateBroadcastRequest::Channel)
|
|
52
|
+
end
|
|
53
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
54
|
+
|
|
55
|
+
EMAIL =
|
|
56
|
+
T.let(:email, Courier::CreateBroadcastRequest::Channel::TaggedSymbol)
|
|
57
|
+
SMS =
|
|
58
|
+
T.let(:sms, Courier::CreateBroadcastRequest::Channel::TaggedSymbol)
|
|
59
|
+
PUSH =
|
|
60
|
+
T.let(:push, Courier::CreateBroadcastRequest::Channel::TaggedSymbol)
|
|
61
|
+
INBOX =
|
|
62
|
+
T.let(:inbox, Courier::CreateBroadcastRequest::Channel::TaggedSymbol)
|
|
63
|
+
SLACK =
|
|
64
|
+
T.let(:slack, Courier::CreateBroadcastRequest::Channel::TaggedSymbol)
|
|
65
|
+
MSTEAMS =
|
|
66
|
+
T.let(
|
|
67
|
+
:msteams,
|
|
68
|
+
Courier::CreateBroadcastRequest::Channel::TaggedSymbol
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
sig do
|
|
72
|
+
override.returns(
|
|
73
|
+
T::Array[Courier::CreateBroadcastRequest::Channel::TaggedSymbol]
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
def self.values
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -63,8 +63,8 @@ module Courier
|
|
|
63
63
|
# Send to the recipient. A send node sources its content from EXACTLY ONE of
|
|
64
64
|
# `message.template` (a single notification template) or `experiment` (an A/B
|
|
65
65
|
# split across weighted template variants) — supplying both, or neither, is
|
|
66
|
-
# rejected. Optionally override the recipient address,
|
|
67
|
-
# `data`.
|
|
66
|
+
# rejected. Optionally override the recipient address, send as a tenant, delay the
|
|
67
|
+
# send, or attach `data`.
|
|
68
68
|
sig do
|
|
69
69
|
params(
|
|
70
70
|
message: Courier::JourneySendNode::Message::OrHash,
|
|
@@ -119,6 +119,18 @@ module Courier
|
|
|
119
119
|
T.any(Courier::JourneySendNode::Message, Courier::Internal::AnyHash)
|
|
120
120
|
end
|
|
121
121
|
|
|
122
|
+
# Tenant context for this send. Set it to deliver on behalf of one of your
|
|
123
|
+
# customers, so the message uses that tenant's brand and settings.
|
|
124
|
+
sig { returns(T.nilable(Courier::JourneySendNode::Message::Context)) }
|
|
125
|
+
attr_reader :context
|
|
126
|
+
|
|
127
|
+
sig do
|
|
128
|
+
params(
|
|
129
|
+
context: Courier::JourneySendNode::Message::Context::OrHash
|
|
130
|
+
).void
|
|
131
|
+
end
|
|
132
|
+
attr_writer :context
|
|
133
|
+
|
|
122
134
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
123
135
|
attr_reader :data
|
|
124
136
|
|
|
@@ -147,18 +159,28 @@ module Courier
|
|
|
147
159
|
|
|
148
160
|
sig do
|
|
149
161
|
params(
|
|
162
|
+
context: Courier::JourneySendNode::Message::Context::OrHash,
|
|
150
163
|
data: T::Hash[Symbol, T.anything],
|
|
151
164
|
delay: Courier::JourneySendNode::Message::Delay::OrHash,
|
|
152
165
|
template: String,
|
|
153
166
|
to: Courier::JourneySendNode::Message::To::OrHash
|
|
154
167
|
).returns(T.attached_class)
|
|
155
168
|
end
|
|
156
|
-
def self.new(
|
|
169
|
+
def self.new(
|
|
170
|
+
# Tenant context for this send. Set it to deliver on behalf of one of your
|
|
171
|
+
# customers, so the message uses that tenant's brand and settings.
|
|
172
|
+
context: nil,
|
|
173
|
+
data: nil,
|
|
174
|
+
delay: nil,
|
|
175
|
+
template: nil,
|
|
176
|
+
to: nil
|
|
177
|
+
)
|
|
157
178
|
end
|
|
158
179
|
|
|
159
180
|
sig do
|
|
160
181
|
override.returns(
|
|
161
182
|
{
|
|
183
|
+
context: Courier::JourneySendNode::Message::Context,
|
|
162
184
|
data: T::Hash[Symbol, T.anything],
|
|
163
185
|
delay: Courier::JourneySendNode::Message::Delay,
|
|
164
186
|
template: String,
|
|
@@ -169,6 +191,53 @@ module Courier
|
|
|
169
191
|
def to_hash
|
|
170
192
|
end
|
|
171
193
|
|
|
194
|
+
class Context < Courier::Internal::Type::BaseModel
|
|
195
|
+
OrHash =
|
|
196
|
+
T.type_alias do
|
|
197
|
+
T.any(
|
|
198
|
+
Courier::JourneySendNode::Message::Context,
|
|
199
|
+
Courier::Internal::AnyHash
|
|
200
|
+
)
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# The tenant to send as. Accepts either a literal tenant id (`acme-tenant`) or a
|
|
204
|
+
# whole-string mustache reference to a value the run already holds —
|
|
205
|
+
# `{{data.tenant_id}}` from the invocation payload, or `{{f1.body.tenant_id}}`
|
|
206
|
+
# from the response of an earlier fetch node with id `f1`. A reference is resolved
|
|
207
|
+
# separately on every run, so a single journey can deliver as many tenants. Two
|
|
208
|
+
# forms are rejected with `400`: mid-string interpolation such as
|
|
209
|
+
# `tenant-{{data.region}}`, and any value beginning with `refs.`, which is
|
|
210
|
+
# reserved for internal use. A reference that resolves to nothing at run time does
|
|
211
|
+
# not stop the run — the message is still sent, with no tenant context — so make
|
|
212
|
+
# sure the referenced value is always present. `GET` returns the value in the same
|
|
213
|
+
# form it was supplied.
|
|
214
|
+
sig { returns(String) }
|
|
215
|
+
attr_accessor :tenant_id
|
|
216
|
+
|
|
217
|
+
# Tenant context for this send. Set it to deliver on behalf of one of your
|
|
218
|
+
# customers, so the message uses that tenant's brand and settings.
|
|
219
|
+
sig { params(tenant_id: String).returns(T.attached_class) }
|
|
220
|
+
def self.new(
|
|
221
|
+
# The tenant to send as. Accepts either a literal tenant id (`acme-tenant`) or a
|
|
222
|
+
# whole-string mustache reference to a value the run already holds —
|
|
223
|
+
# `{{data.tenant_id}}` from the invocation payload, or `{{f1.body.tenant_id}}`
|
|
224
|
+
# from the response of an earlier fetch node with id `f1`. A reference is resolved
|
|
225
|
+
# separately on every run, so a single journey can deliver as many tenants. Two
|
|
226
|
+
# forms are rejected with `400`: mid-string interpolation such as
|
|
227
|
+
# `tenant-{{data.region}}`, and any value beginning with `refs.`, which is
|
|
228
|
+
# reserved for internal use. A reference that resolves to nothing at run time does
|
|
229
|
+
# not stop the run — the message is still sent, with no tenant context — so make
|
|
230
|
+
# sure the referenced value is always present. `GET` returns the value in the same
|
|
231
|
+
# form it was supplied.
|
|
232
|
+
tenant_id:
|
|
233
|
+
)
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
sig { override.returns({ tenant_id: String }) }
|
|
237
|
+
def to_hash
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
|
|
172
241
|
class Delay < Courier::Internal::Type::BaseModel
|
|
173
242
|
OrHash =
|
|
174
243
|
T.type_alias do
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ScheduleBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::ScheduleBroadcastRequest, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# ID of the target list or audience.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :recipient_id
|
|
14
|
+
|
|
15
|
+
# Whether the broadcast targets a list or an audience.
|
|
16
|
+
sig do
|
|
17
|
+
returns(Courier::ScheduleBroadcastRequest::RecipientType::OrSymbol)
|
|
18
|
+
end
|
|
19
|
+
attr_accessor :recipient_type
|
|
20
|
+
|
|
21
|
+
# Wall-clock timestamp of the future send, no timezone offset (e.g.
|
|
22
|
+
# "2026-07-21T20:00:00"). The zone is given by `timezone`.
|
|
23
|
+
sig { returns(String) }
|
|
24
|
+
attr_accessor :scheduled_to
|
|
25
|
+
|
|
26
|
+
# IANA timezone for the scheduled send (e.g. America/New_York).
|
|
27
|
+
sig { returns(T.nilable(String)) }
|
|
28
|
+
attr_reader :timezone
|
|
29
|
+
|
|
30
|
+
sig { params(timezone: String).void }
|
|
31
|
+
attr_writer :timezone
|
|
32
|
+
|
|
33
|
+
# Request body for scheduling a broadcast for a future send.
|
|
34
|
+
sig do
|
|
35
|
+
params(
|
|
36
|
+
recipient_id: String,
|
|
37
|
+
recipient_type:
|
|
38
|
+
Courier::ScheduleBroadcastRequest::RecipientType::OrSymbol,
|
|
39
|
+
scheduled_to: String,
|
|
40
|
+
timezone: String
|
|
41
|
+
).returns(T.attached_class)
|
|
42
|
+
end
|
|
43
|
+
def self.new(
|
|
44
|
+
# ID of the target list or audience.
|
|
45
|
+
recipient_id:,
|
|
46
|
+
# Whether the broadcast targets a list or an audience.
|
|
47
|
+
recipient_type:,
|
|
48
|
+
# Wall-clock timestamp of the future send, no timezone offset (e.g.
|
|
49
|
+
# "2026-07-21T20:00:00"). The zone is given by `timezone`.
|
|
50
|
+
scheduled_to:,
|
|
51
|
+
# IANA timezone for the scheduled send (e.g. America/New_York).
|
|
52
|
+
timezone: nil
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
sig do
|
|
57
|
+
override.returns(
|
|
58
|
+
{
|
|
59
|
+
recipient_id: String,
|
|
60
|
+
recipient_type:
|
|
61
|
+
Courier::ScheduleBroadcastRequest::RecipientType::OrSymbol,
|
|
62
|
+
scheduled_to: String,
|
|
63
|
+
timezone: String
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
end
|
|
67
|
+
def to_hash
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Whether the broadcast targets a list or an audience.
|
|
71
|
+
module RecipientType
|
|
72
|
+
extend Courier::Internal::Type::Enum
|
|
73
|
+
|
|
74
|
+
TaggedSymbol =
|
|
75
|
+
T.type_alias do
|
|
76
|
+
T.all(Symbol, Courier::ScheduleBroadcastRequest::RecipientType)
|
|
77
|
+
end
|
|
78
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
79
|
+
|
|
80
|
+
LIST =
|
|
81
|
+
T.let(
|
|
82
|
+
:list,
|
|
83
|
+
Courier::ScheduleBroadcastRequest::RecipientType::TaggedSymbol
|
|
84
|
+
)
|
|
85
|
+
AUDIENCE =
|
|
86
|
+
T.let(
|
|
87
|
+
:audience,
|
|
88
|
+
Courier::ScheduleBroadcastRequest::RecipientType::TaggedSymbol
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
sig do
|
|
92
|
+
override.returns(
|
|
93
|
+
T::Array[
|
|
94
|
+
Courier::ScheduleBroadcastRequest::RecipientType::TaggedSymbol
|
|
95
|
+
]
|
|
96
|
+
)
|
|
97
|
+
end
|
|
98
|
+
def self.values
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class SendBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::SendBroadcastRequest, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# ID of the target list or audience.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :recipient_id
|
|
14
|
+
|
|
15
|
+
# Whether the broadcast targets a list or an audience.
|
|
16
|
+
sig { returns(Courier::SendBroadcastRequest::RecipientType::OrSymbol) }
|
|
17
|
+
attr_accessor :recipient_type
|
|
18
|
+
|
|
19
|
+
# Request body for sending a broadcast immediately.
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
recipient_id: String,
|
|
23
|
+
recipient_type: Courier::SendBroadcastRequest::RecipientType::OrSymbol
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(
|
|
27
|
+
# ID of the target list or audience.
|
|
28
|
+
recipient_id:,
|
|
29
|
+
# Whether the broadcast targets a list or an audience.
|
|
30
|
+
recipient_type:
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
override.returns(
|
|
36
|
+
{
|
|
37
|
+
recipient_id: String,
|
|
38
|
+
recipient_type:
|
|
39
|
+
Courier::SendBroadcastRequest::RecipientType::OrSymbol
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Whether the broadcast targets a list or an audience.
|
|
47
|
+
module RecipientType
|
|
48
|
+
extend Courier::Internal::Type::Enum
|
|
49
|
+
|
|
50
|
+
TaggedSymbol =
|
|
51
|
+
T.type_alias do
|
|
52
|
+
T.all(Symbol, Courier::SendBroadcastRequest::RecipientType)
|
|
53
|
+
end
|
|
54
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
55
|
+
|
|
56
|
+
LIST =
|
|
57
|
+
T.let(
|
|
58
|
+
:list,
|
|
59
|
+
Courier::SendBroadcastRequest::RecipientType::TaggedSymbol
|
|
60
|
+
)
|
|
61
|
+
AUDIENCE =
|
|
62
|
+
T.let(
|
|
63
|
+
:audience,
|
|
64
|
+
Courier::SendBroadcastRequest::RecipientType::TaggedSymbol
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
sig do
|
|
68
|
+
override.returns(
|
|
69
|
+
T::Array[Courier::SendBroadcastRequest::RecipientType::TaggedSymbol]
|
|
70
|
+
)
|
|
71
|
+
end
|
|
72
|
+
def self.values
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class UpdateBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::UpdateBroadcastRequest, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# New human-readable name.
|
|
12
|
+
sig { returns(String) }
|
|
13
|
+
attr_accessor :name
|
|
14
|
+
|
|
15
|
+
# Request body for updating a broadcast. Only the name is mutable.
|
|
16
|
+
sig { params(name: String).returns(T.attached_class) }
|
|
17
|
+
def self.new(
|
|
18
|
+
# New human-readable name.
|
|
19
|
+
name:
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
sig { override.returns({ name: String }) }
|
|
24
|
+
def to_hash
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/rbi/courier/models.rbi
CHANGED
|
@@ -77,6 +77,35 @@ module Courier
|
|
|
77
77
|
|
|
78
78
|
BrandUpdateParams = Courier::Models::BrandUpdateParams
|
|
79
79
|
|
|
80
|
+
Broadcast = Courier::Models::Broadcast
|
|
81
|
+
|
|
82
|
+
BroadcastArchiveParams = Courier::Models::BroadcastArchiveParams
|
|
83
|
+
|
|
84
|
+
BroadcastCancelParams = Courier::Models::BroadcastCancelParams
|
|
85
|
+
|
|
86
|
+
BroadcastCreateParams = Courier::Models::BroadcastCreateParams
|
|
87
|
+
|
|
88
|
+
BroadcastDuplicateParams = Courier::Models::BroadcastDuplicateParams
|
|
89
|
+
|
|
90
|
+
BroadcastListParams = Courier::Models::BroadcastListParams
|
|
91
|
+
|
|
92
|
+
BroadcastListResponse = Courier::Models::BroadcastListResponse
|
|
93
|
+
|
|
94
|
+
BroadcastPutContentParams = Courier::Models::BroadcastPutContentParams
|
|
95
|
+
|
|
96
|
+
BroadcastRetrieveContentParams =
|
|
97
|
+
Courier::Models::BroadcastRetrieveContentParams
|
|
98
|
+
|
|
99
|
+
BroadcastRetrieveParams = Courier::Models::BroadcastRetrieveParams
|
|
100
|
+
|
|
101
|
+
BroadcastSchedule = Courier::Models::BroadcastSchedule
|
|
102
|
+
|
|
103
|
+
BroadcastScheduleParams = Courier::Models::BroadcastScheduleParams
|
|
104
|
+
|
|
105
|
+
BroadcastSendParams = Courier::Models::BroadcastSendParams
|
|
106
|
+
|
|
107
|
+
BroadcastUpdateParams = Courier::Models::BroadcastUpdateParams
|
|
108
|
+
|
|
80
109
|
CancelJourneyRequest = Courier::Models::CancelJourneyRequest
|
|
81
110
|
|
|
82
111
|
CancelJourneyResponse = Courier::Models::CancelJourneyResponse
|
|
@@ -91,6 +120,8 @@ module Courier
|
|
|
91
120
|
|
|
92
121
|
Check = Courier::Models::Check
|
|
93
122
|
|
|
123
|
+
CreateBroadcastRequest = Courier::Models::CreateBroadcastRequest
|
|
124
|
+
|
|
94
125
|
CreateJourneyRequest = Courier::Models::CreateJourneyRequest
|
|
95
126
|
|
|
96
127
|
DefaultPreferences = Courier::Models::DefaultPreferences
|
|
@@ -149,8 +180,6 @@ module Courier
|
|
|
149
180
|
|
|
150
181
|
InboundTrackEventParams = Courier::Models::InboundTrackEventParams
|
|
151
182
|
|
|
152
|
-
Inbox = Courier::Models::Inbox
|
|
153
|
-
|
|
154
183
|
Intercom = Courier::Models::Intercom
|
|
155
184
|
|
|
156
185
|
IntercomRecipient = Courier::Models::IntercomRecipient
|
|
@@ -452,6 +481,10 @@ module Courier
|
|
|
452
481
|
|
|
453
482
|
Rule = Courier::Models::Rule
|
|
454
483
|
|
|
484
|
+
ScheduleBroadcastRequest = Courier::Models::ScheduleBroadcastRequest
|
|
485
|
+
|
|
486
|
+
SendBroadcastRequest = Courier::Models::SendBroadcastRequest
|
|
487
|
+
|
|
455
488
|
SendDirectMessage = Courier::Models::SendDirectMessage
|
|
456
489
|
|
|
457
490
|
SendMessageParams = Courier::Models::SendMessageParams
|
|
@@ -514,6 +547,8 @@ module Courier
|
|
|
514
547
|
|
|
515
548
|
TranslationUpdateParams = Courier::Models::TranslationUpdateParams
|
|
516
549
|
|
|
550
|
+
UpdateBroadcastRequest = Courier::Models::UpdateBroadcastRequest
|
|
551
|
+
|
|
517
552
|
UserProfile = Courier::Models::UserProfile
|
|
518
553
|
|
|
519
554
|
UserProfileFirebaseToken = Courier::Models::UserProfileFirebaseToken
|