trycourier 6.2.0 → 6.4.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 +14 -0
- data/README.md +1 -1
- data/lib/courier/models/journey_send_node.rb +70 -3
- data/lib/courier/models/journey_send_node_to_ms_teams.rb +81 -0
- data/lib/courier/models/journey_send_node_to_slack.rb +20 -0
- data/lib/courier/models/journey_send_node_to_slack_channel.rb +29 -0
- data/lib/courier/models/journey_send_node_to_slack_email.rb +30 -0
- data/lib/courier/models/journey_send_node_to_slack_user_id.rb +29 -0
- data/lib/courier/models/ms_teams.rb +6 -0
- data/lib/courier/models/ms_teams_base_properties.rb +10 -5
- data/lib/courier/models/ms_teams_recipient.rb +6 -1
- data/lib/courier/models/send_to_ms_teams_channel_id.rb +9 -5
- data/lib/courier/models/send_to_ms_teams_channel_name.rb +12 -9
- data/lib/courier/models/send_to_ms_teams_email.rb +8 -5
- data/lib/courier/models/send_to_ms_teams_user_id.rb +13 -10
- data/lib/courier/models/user_profile.rb +3 -1
- data/lib/courier/models.rb +10 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +5 -0
- data/rbi/courier/models/journey_send_node.rbi +123 -0
- data/rbi/courier/models/journey_send_node_to_ms_teams.rbi +124 -0
- data/rbi/courier/models/journey_send_node_to_slack.rbi +26 -0
- data/rbi/courier/models/journey_send_node_to_slack_channel.rbi +45 -0
- data/rbi/courier/models/journey_send_node_to_slack_email.rbi +47 -0
- data/rbi/courier/models/journey_send_node_to_slack_user_id.rbi +45 -0
- data/rbi/courier/models/ms_teams.rbi +2 -0
- data/rbi/courier/models/ms_teams_base_properties.rbi +15 -5
- data/rbi/courier/models/ms_teams_recipient.rbi +7 -1
- data/rbi/courier/models/send_to_ms_teams_channel_id.rbi +14 -5
- data/rbi/courier/models/send_to_ms_teams_channel_name.rbi +16 -8
- data/rbi/courier/models/send_to_ms_teams_email.rbi +13 -5
- data/rbi/courier/models/send_to_ms_teams_user_id.rbi +16 -8
- data/rbi/courier/models/user_profile.rbi +4 -0
- data/rbi/courier/models.rbi +10 -0
- data/sig/courier/models/journey_send_node.rbs +42 -0
- data/sig/courier/models/journey_send_node_to_ms_teams.rbs +64 -0
- data/sig/courier/models/journey_send_node_to_slack.rbs +14 -0
- data/sig/courier/models/journey_send_node_to_slack_channel.rbs +18 -0
- data/sig/courier/models/journey_send_node_to_slack_email.rbs +18 -0
- data/sig/courier/models/journey_send_node_to_slack_user_id.rbs +18 -0
- data/sig/courier/models/ms_teams_base_properties.rbs +7 -3
- data/sig/courier/models/send_to_ms_teams_channel_id.rbs +8 -4
- data/sig/courier/models/send_to_ms_teams_channel_name.rbs +11 -7
- data/sig/courier/models/send_to_ms_teams_email.rbs +8 -4
- data/sig/courier/models/send_to_ms_teams_user_id.rbs +13 -9
- data/sig/courier/models.rbs +10 -0
- metadata +17 -2
|
@@ -23,6 +23,16 @@ module Courier
|
|
|
23
23
|
sig { params(id: String).void }
|
|
24
24
|
attr_writer :id
|
|
25
25
|
|
|
26
|
+
# The channel this node sends through. Optional — when omitted, the field is
|
|
27
|
+
# absent from the node, including on `GET`; nodes created before this field
|
|
28
|
+
# existed have it unset. Setting it makes the node's channel explicit to any
|
|
29
|
+
# client reading the journey.
|
|
30
|
+
sig { returns(T.nilable(Courier::JourneySendNode::Channel::OrSymbol)) }
|
|
31
|
+
attr_reader :channel
|
|
32
|
+
|
|
33
|
+
sig { params(channel: Courier::JourneySendNode::Channel::OrSymbol).void }
|
|
34
|
+
attr_writer :channel
|
|
35
|
+
|
|
26
36
|
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
27
37
|
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
28
38
|
# express "no conditions".
|
|
@@ -70,6 +80,7 @@ module Courier
|
|
|
70
80
|
message: Courier::JourneySendNode::Message::OrHash,
|
|
71
81
|
type: Courier::JourneySendNode::Type::OrSymbol,
|
|
72
82
|
id: String,
|
|
83
|
+
channel: Courier::JourneySendNode::Channel::OrSymbol,
|
|
73
84
|
conditions:
|
|
74
85
|
T.any(
|
|
75
86
|
T::Array[String],
|
|
@@ -83,6 +94,11 @@ module Courier
|
|
|
83
94
|
message:,
|
|
84
95
|
type:,
|
|
85
96
|
id: nil,
|
|
97
|
+
# The channel this node sends through. Optional — when omitted, the field is
|
|
98
|
+
# absent from the node, including on `GET`; nodes created before this field
|
|
99
|
+
# existed have it unset. Setting it makes the node's channel explicit to any
|
|
100
|
+
# client reading the journey.
|
|
101
|
+
channel: nil,
|
|
86
102
|
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
87
103
|
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
88
104
|
# express "no conditions".
|
|
@@ -100,6 +116,7 @@ module Courier
|
|
|
100
116
|
message: Courier::JourneySendNode::Message,
|
|
101
117
|
type: Courier::JourneySendNode::Type::OrSymbol,
|
|
102
118
|
id: String,
|
|
119
|
+
channel: Courier::JourneySendNode::Channel::OrSymbol,
|
|
103
120
|
conditions:
|
|
104
121
|
T.any(
|
|
105
122
|
T::Array[String],
|
|
@@ -151,6 +168,9 @@ module Courier
|
|
|
151
168
|
sig { params(template: String).void }
|
|
152
169
|
attr_writer :template
|
|
153
170
|
|
|
171
|
+
# Recipient override for this send. Provide exactly one of `email_override`,
|
|
172
|
+
# `phone_number_override`, `user_id_override`, `slack`, or `ms_teams` — not a
|
|
173
|
+
# combination.
|
|
154
174
|
sig { returns(T.nilable(Courier::JourneySendNode::Message::To)) }
|
|
155
175
|
attr_reader :to
|
|
156
176
|
|
|
@@ -173,6 +193,9 @@ module Courier
|
|
|
173
193
|
data: nil,
|
|
174
194
|
delay: nil,
|
|
175
195
|
template: nil,
|
|
196
|
+
# Recipient override for this send. Provide exactly one of `email_override`,
|
|
197
|
+
# `phone_number_override`, `user_id_override`, `slack`, or `ms_teams` — not a
|
|
198
|
+
# combination.
|
|
176
199
|
to: nil
|
|
177
200
|
)
|
|
178
201
|
end
|
|
@@ -282,28 +305,93 @@ module Courier
|
|
|
282
305
|
sig { params(email_override: String).void }
|
|
283
306
|
attr_writer :email_override
|
|
284
307
|
|
|
308
|
+
# Send to a Microsoft Teams address directly, bypassing the recipient's stored
|
|
309
|
+
# profile. Requires exactly one target: `channel_id`, `channel_name` (with
|
|
310
|
+
# `team_id`), `user_id`, or `email`. `channel_name`, `user_id`, and `email` also
|
|
311
|
+
# need at least one of `service_url` or `tenant_id` — if you provide both, they
|
|
312
|
+
# must agree. `channel_id` doesn't require tenant context to publish, but provide
|
|
313
|
+
# `service_url` or `tenant_id` anyway: sends without either have failed at
|
|
314
|
+
# delivery in testing. `conversation_id` and `reply_to_activity_id`, available on
|
|
315
|
+
# the send API's `MsTeams` profile, aren't supported here yet.
|
|
316
|
+
sig { returns(T.nilable(Courier::JourneySendNodeToMsTeams)) }
|
|
317
|
+
attr_reader :ms_teams
|
|
318
|
+
|
|
319
|
+
sig do
|
|
320
|
+
params(ms_teams: Courier::JourneySendNodeToMsTeams::OrHash).void
|
|
321
|
+
end
|
|
322
|
+
attr_writer :ms_teams
|
|
323
|
+
|
|
285
324
|
sig { returns(T.nilable(String)) }
|
|
286
325
|
attr_reader :phone_number_override
|
|
287
326
|
|
|
288
327
|
sig { params(phone_number_override: String).void }
|
|
289
328
|
attr_writer :phone_number_override
|
|
290
329
|
|
|
330
|
+
# Send to a Slack address directly, bypassing the recipient's stored profile.
|
|
331
|
+
# Requires exactly one of `channel`, `user_id`, or `email`.
|
|
332
|
+
sig do
|
|
333
|
+
returns(
|
|
334
|
+
T.nilable(
|
|
335
|
+
T.any(
|
|
336
|
+
Courier::JourneySendNodeToSlackChannel,
|
|
337
|
+
Courier::JourneySendNodeToSlackUserID,
|
|
338
|
+
Courier::JourneySendNodeToSlackEmail
|
|
339
|
+
)
|
|
340
|
+
)
|
|
341
|
+
)
|
|
342
|
+
end
|
|
343
|
+
attr_reader :slack
|
|
344
|
+
|
|
345
|
+
sig do
|
|
346
|
+
params(
|
|
347
|
+
slack:
|
|
348
|
+
T.any(
|
|
349
|
+
Courier::JourneySendNodeToSlackChannel::OrHash,
|
|
350
|
+
Courier::JourneySendNodeToSlackUserID::OrHash,
|
|
351
|
+
Courier::JourneySendNodeToSlackEmail::OrHash
|
|
352
|
+
)
|
|
353
|
+
).void
|
|
354
|
+
end
|
|
355
|
+
attr_writer :slack
|
|
356
|
+
|
|
291
357
|
sig { returns(T.nilable(String)) }
|
|
292
358
|
attr_reader :user_id_override
|
|
293
359
|
|
|
294
360
|
sig { params(user_id_override: String).void }
|
|
295
361
|
attr_writer :user_id_override
|
|
296
362
|
|
|
363
|
+
# Recipient override for this send. Provide exactly one of `email_override`,
|
|
364
|
+
# `phone_number_override`, `user_id_override`, `slack`, or `ms_teams` — not a
|
|
365
|
+
# combination.
|
|
297
366
|
sig do
|
|
298
367
|
params(
|
|
299
368
|
email_override: String,
|
|
369
|
+
ms_teams: Courier::JourneySendNodeToMsTeams::OrHash,
|
|
300
370
|
phone_number_override: String,
|
|
371
|
+
slack:
|
|
372
|
+
T.any(
|
|
373
|
+
Courier::JourneySendNodeToSlackChannel::OrHash,
|
|
374
|
+
Courier::JourneySendNodeToSlackUserID::OrHash,
|
|
375
|
+
Courier::JourneySendNodeToSlackEmail::OrHash
|
|
376
|
+
),
|
|
301
377
|
user_id_override: String
|
|
302
378
|
).returns(T.attached_class)
|
|
303
379
|
end
|
|
304
380
|
def self.new(
|
|
305
381
|
email_override: nil,
|
|
382
|
+
# Send to a Microsoft Teams address directly, bypassing the recipient's stored
|
|
383
|
+
# profile. Requires exactly one target: `channel_id`, `channel_name` (with
|
|
384
|
+
# `team_id`), `user_id`, or `email`. `channel_name`, `user_id`, and `email` also
|
|
385
|
+
# need at least one of `service_url` or `tenant_id` — if you provide both, they
|
|
386
|
+
# must agree. `channel_id` doesn't require tenant context to publish, but provide
|
|
387
|
+
# `service_url` or `tenant_id` anyway: sends without either have failed at
|
|
388
|
+
# delivery in testing. `conversation_id` and `reply_to_activity_id`, available on
|
|
389
|
+
# the send API's `MsTeams` profile, aren't supported here yet.
|
|
390
|
+
ms_teams: nil,
|
|
306
391
|
phone_number_override: nil,
|
|
392
|
+
# Send to a Slack address directly, bypassing the recipient's stored profile.
|
|
393
|
+
# Requires exactly one of `channel`, `user_id`, or `email`.
|
|
394
|
+
slack: nil,
|
|
307
395
|
user_id_override: nil
|
|
308
396
|
)
|
|
309
397
|
end
|
|
@@ -312,7 +400,14 @@ module Courier
|
|
|
312
400
|
override.returns(
|
|
313
401
|
{
|
|
314
402
|
email_override: String,
|
|
403
|
+
ms_teams: Courier::JourneySendNodeToMsTeams,
|
|
315
404
|
phone_number_override: String,
|
|
405
|
+
slack:
|
|
406
|
+
T.any(
|
|
407
|
+
Courier::JourneySendNodeToSlackChannel,
|
|
408
|
+
Courier::JourneySendNodeToSlackUserID,
|
|
409
|
+
Courier::JourneySendNodeToSlackEmail
|
|
410
|
+
),
|
|
316
411
|
user_id_override: String
|
|
317
412
|
}
|
|
318
413
|
)
|
|
@@ -339,6 +434,34 @@ module Courier
|
|
|
339
434
|
def self.values
|
|
340
435
|
end
|
|
341
436
|
end
|
|
437
|
+
|
|
438
|
+
# The channel this node sends through. Optional — when omitted, the field is
|
|
439
|
+
# absent from the node, including on `GET`; nodes created before this field
|
|
440
|
+
# existed have it unset. Setting it makes the node's channel explicit to any
|
|
441
|
+
# client reading the journey.
|
|
442
|
+
module Channel
|
|
443
|
+
extend Courier::Internal::Type::Enum
|
|
444
|
+
|
|
445
|
+
TaggedSymbol =
|
|
446
|
+
T.type_alias { T.all(Symbol, Courier::JourneySendNode::Channel) }
|
|
447
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
448
|
+
|
|
449
|
+
EMAIL = T.let(:email, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
450
|
+
SMS = T.let(:sms, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
451
|
+
PUSH = T.let(:push, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
452
|
+
INBOX = T.let(:inbox, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
453
|
+
SLACK = T.let(:slack, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
454
|
+
MSTEAMS =
|
|
455
|
+
T.let(:msteams, Courier::JourneySendNode::Channel::TaggedSymbol)
|
|
456
|
+
|
|
457
|
+
sig do
|
|
458
|
+
override.returns(
|
|
459
|
+
T::Array[Courier::JourneySendNode::Channel::TaggedSymbol]
|
|
460
|
+
)
|
|
461
|
+
end
|
|
462
|
+
def self.values
|
|
463
|
+
end
|
|
464
|
+
end
|
|
342
465
|
end
|
|
343
466
|
end
|
|
344
467
|
end
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneySendNodeToMsTeams < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::JourneySendNodeToMsTeams, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Bot Framework channel ID to send to.
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_reader :channel_id
|
|
14
|
+
|
|
15
|
+
sig { params(channel_id: String).void }
|
|
16
|
+
attr_writer :channel_id
|
|
17
|
+
|
|
18
|
+
# Teams channel name to send to. Requires `team_id`.
|
|
19
|
+
sig { returns(T.nilable(String)) }
|
|
20
|
+
attr_reader :channel_name
|
|
21
|
+
|
|
22
|
+
sig { params(channel_name: String).void }
|
|
23
|
+
attr_writer :channel_name
|
|
24
|
+
|
|
25
|
+
# Email address of the Teams user to send to.
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_reader :email
|
|
28
|
+
|
|
29
|
+
sig { params(email: String).void }
|
|
30
|
+
attr_writer :email
|
|
31
|
+
|
|
32
|
+
# The regional Bot Framework host for this conversation, e.g.
|
|
33
|
+
# `https://smba.trafficmanager.net/amer`. A path segment naming the Microsoft
|
|
34
|
+
# tenant may follow it and is used to derive `tenant_id` when it is not supplied
|
|
35
|
+
# directly.
|
|
36
|
+
sig { returns(T.nilable(String)) }
|
|
37
|
+
attr_reader :service_url
|
|
38
|
+
|
|
39
|
+
sig { params(service_url: String).void }
|
|
40
|
+
attr_writer :service_url
|
|
41
|
+
|
|
42
|
+
# Microsoft Teams team ID. Required alongside `channel_name`.
|
|
43
|
+
sig { returns(T.nilable(String)) }
|
|
44
|
+
attr_reader :team_id
|
|
45
|
+
|
|
46
|
+
sig { params(team_id: String).void }
|
|
47
|
+
attr_writer :team_id
|
|
48
|
+
|
|
49
|
+
# The Microsoft (Azure AD) tenant this send targets or authenticates against.
|
|
50
|
+
# Unrelated to `message.context.tenant_id`, which is the Courier customer's own
|
|
51
|
+
# multi-tenant context.
|
|
52
|
+
sig { returns(T.nilable(String)) }
|
|
53
|
+
attr_reader :tenant_id
|
|
54
|
+
|
|
55
|
+
sig { params(tenant_id: String).void }
|
|
56
|
+
attr_writer :tenant_id
|
|
57
|
+
|
|
58
|
+
# Microsoft Teams user ID to send to.
|
|
59
|
+
sig { returns(T.nilable(String)) }
|
|
60
|
+
attr_reader :user_id
|
|
61
|
+
|
|
62
|
+
sig { params(user_id: String).void }
|
|
63
|
+
attr_writer :user_id
|
|
64
|
+
|
|
65
|
+
# Send to a Microsoft Teams address directly, bypassing the recipient's stored
|
|
66
|
+
# profile. Requires exactly one target: `channel_id`, `channel_name` (with
|
|
67
|
+
# `team_id`), `user_id`, or `email`. `channel_name`, `user_id`, and `email` also
|
|
68
|
+
# need at least one of `service_url` or `tenant_id` — if you provide both, they
|
|
69
|
+
# must agree. `channel_id` doesn't require tenant context to publish, but provide
|
|
70
|
+
# `service_url` or `tenant_id` anyway: sends without either have failed at
|
|
71
|
+
# delivery in testing. `conversation_id` and `reply_to_activity_id`, available on
|
|
72
|
+
# the send API's `MsTeams` profile, aren't supported here yet.
|
|
73
|
+
sig do
|
|
74
|
+
params(
|
|
75
|
+
channel_id: String,
|
|
76
|
+
channel_name: String,
|
|
77
|
+
email: String,
|
|
78
|
+
service_url: String,
|
|
79
|
+
team_id: String,
|
|
80
|
+
tenant_id: String,
|
|
81
|
+
user_id: String
|
|
82
|
+
).returns(T.attached_class)
|
|
83
|
+
end
|
|
84
|
+
def self.new(
|
|
85
|
+
# Bot Framework channel ID to send to.
|
|
86
|
+
channel_id: nil,
|
|
87
|
+
# Teams channel name to send to. Requires `team_id`.
|
|
88
|
+
channel_name: nil,
|
|
89
|
+
# Email address of the Teams user to send to.
|
|
90
|
+
email: nil,
|
|
91
|
+
# The regional Bot Framework host for this conversation, e.g.
|
|
92
|
+
# `https://smba.trafficmanager.net/amer`. A path segment naming the Microsoft
|
|
93
|
+
# tenant may follow it and is used to derive `tenant_id` when it is not supplied
|
|
94
|
+
# directly.
|
|
95
|
+
service_url: nil,
|
|
96
|
+
# Microsoft Teams team ID. Required alongside `channel_name`.
|
|
97
|
+
team_id: nil,
|
|
98
|
+
# The Microsoft (Azure AD) tenant this send targets or authenticates against.
|
|
99
|
+
# Unrelated to `message.context.tenant_id`, which is the Courier customer's own
|
|
100
|
+
# multi-tenant context.
|
|
101
|
+
tenant_id: nil,
|
|
102
|
+
# Microsoft Teams user ID to send to.
|
|
103
|
+
user_id: nil
|
|
104
|
+
)
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
sig do
|
|
108
|
+
override.returns(
|
|
109
|
+
{
|
|
110
|
+
channel_id: String,
|
|
111
|
+
channel_name: String,
|
|
112
|
+
email: String,
|
|
113
|
+
service_url: String,
|
|
114
|
+
team_id: String,
|
|
115
|
+
tenant_id: String,
|
|
116
|
+
user_id: String
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
end
|
|
120
|
+
def to_hash
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Send to a Slack address directly, bypassing the recipient's stored profile.
|
|
6
|
+
# Requires exactly one of `channel`, `user_id`, or `email`.
|
|
7
|
+
module JourneySendNodeToSlack
|
|
8
|
+
extend Courier::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
Variants =
|
|
11
|
+
T.type_alias do
|
|
12
|
+
T.any(
|
|
13
|
+
Courier::JourneySendNodeToSlackChannel,
|
|
14
|
+
Courier::JourneySendNodeToSlackUserID,
|
|
15
|
+
Courier::JourneySendNodeToSlackEmail
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
sig do
|
|
20
|
+
override.returns(T::Array[Courier::JourneySendNodeToSlack::Variants])
|
|
21
|
+
end
|
|
22
|
+
def self.variants
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneySendNodeToSlackChannel < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::JourneySendNodeToSlackChannel,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Slack channel to send to, by name or ID.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :channel
|
|
17
|
+
|
|
18
|
+
# A runtime reference to a Slack access token, such as `{{data.slack_token}}`.
|
|
19
|
+
# Literal values are rejected — they'd be stored permanently with no way to rotate
|
|
20
|
+
# them. Omit to use the token on the recipient's stored Slack profile.
|
|
21
|
+
sig { returns(T.nilable(String)) }
|
|
22
|
+
attr_reader :access_token
|
|
23
|
+
|
|
24
|
+
sig { params(access_token: String).void }
|
|
25
|
+
attr_writer :access_token
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
params(channel: String, access_token: String).returns(T.attached_class)
|
|
29
|
+
end
|
|
30
|
+
def self.new(
|
|
31
|
+
# Slack channel to send to, by name or ID.
|
|
32
|
+
channel:,
|
|
33
|
+
# A runtime reference to a Slack access token, such as `{{data.slack_token}}`.
|
|
34
|
+
# Literal values are rejected — they'd be stored permanently with no way to rotate
|
|
35
|
+
# them. Omit to use the token on the recipient's stored Slack profile.
|
|
36
|
+
access_token: nil
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
sig { override.returns({ channel: String, access_token: String }) }
|
|
41
|
+
def to_hash
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneySendNodeToSlackEmail < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::JourneySendNodeToSlackEmail,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Email address of the Slack user to send to, resolved via the workspace
|
|
15
|
+
# directory.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :email
|
|
18
|
+
|
|
19
|
+
# A runtime reference to a Slack access token, such as `{{data.slack_token}}`.
|
|
20
|
+
# Literal values are rejected — they'd be stored permanently with no way to rotate
|
|
21
|
+
# them. Omit to use the token on the recipient's stored Slack profile.
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_reader :access_token
|
|
24
|
+
|
|
25
|
+
sig { params(access_token: String).void }
|
|
26
|
+
attr_writer :access_token
|
|
27
|
+
|
|
28
|
+
sig do
|
|
29
|
+
params(email: String, access_token: String).returns(T.attached_class)
|
|
30
|
+
end
|
|
31
|
+
def self.new(
|
|
32
|
+
# Email address of the Slack user to send to, resolved via the workspace
|
|
33
|
+
# directory.
|
|
34
|
+
email:,
|
|
35
|
+
# A runtime reference to a Slack access token, such as `{{data.slack_token}}`.
|
|
36
|
+
# Literal values are rejected — they'd be stored permanently with no way to rotate
|
|
37
|
+
# them. Omit to use the token on the recipient's stored Slack profile.
|
|
38
|
+
access_token: nil
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
sig { override.returns({ email: String, access_token: String }) }
|
|
43
|
+
def to_hash
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneySendNodeToSlackUserID < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::JourneySendNodeToSlackUserID,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Slack user ID to send to.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :user_id
|
|
17
|
+
|
|
18
|
+
# A runtime reference to a Slack access token, such as `{{data.slack_token}}`.
|
|
19
|
+
# Literal values are rejected — they'd be stored permanently with no way to rotate
|
|
20
|
+
# them. Omit to use the token on the recipient's stored Slack profile.
|
|
21
|
+
sig { returns(T.nilable(String)) }
|
|
22
|
+
attr_reader :access_token
|
|
23
|
+
|
|
24
|
+
sig { params(access_token: String).void }
|
|
25
|
+
attr_writer :access_token
|
|
26
|
+
|
|
27
|
+
sig do
|
|
28
|
+
params(user_id: String, access_token: String).returns(T.attached_class)
|
|
29
|
+
end
|
|
30
|
+
def self.new(
|
|
31
|
+
# Slack user ID to send to.
|
|
32
|
+
user_id:,
|
|
33
|
+
# A runtime reference to a Slack access token, such as `{{data.slack_token}}`.
|
|
34
|
+
# Literal values are rejected — they'd be stored permanently with no way to rotate
|
|
35
|
+
# them. Omit to use the token on the recipient's stored Slack profile.
|
|
36
|
+
access_token: nil
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
sig { override.returns({ user_id: String, access_token: String }) }
|
|
41
|
+
def to_hash
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -8,16 +8,26 @@ module Courier
|
|
|
8
8
|
T.any(Courier::MsTeamsBaseProperties, Courier::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
sig { returns(String) }
|
|
12
|
-
|
|
11
|
+
sig { returns(T.nilable(String)) }
|
|
12
|
+
attr_reader :service_url
|
|
13
13
|
|
|
14
|
-
sig {
|
|
15
|
-
|
|
14
|
+
sig { params(service_url: String).void }
|
|
15
|
+
attr_writer :service_url
|
|
16
16
|
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :tenant_id
|
|
19
|
+
|
|
20
|
+
sig { params(tenant_id: String).void }
|
|
21
|
+
attr_writer :tenant_id
|
|
22
|
+
|
|
23
|
+
# Tenant context shared by every MS Teams send variant. Provide at least one of
|
|
24
|
+
# `tenant_id` or `service_url`. If you provide both, they must agree — a
|
|
25
|
+
# `service_url` pointing at a different Microsoft tenant than `tenant_id` is
|
|
26
|
+
# rejected.
|
|
17
27
|
sig do
|
|
18
28
|
params(service_url: String, tenant_id: String).returns(T.attached_class)
|
|
19
29
|
end
|
|
20
|
-
def self.new(service_url
|
|
30
|
+
def self.new(service_url: nil, tenant_id: nil)
|
|
21
31
|
end
|
|
22
32
|
|
|
23
33
|
sig { override.returns({ service_url: String, tenant_id: String }) }
|
|
@@ -8,6 +8,8 @@ module Courier
|
|
|
8
8
|
T.any(Courier::MsTeamsRecipient, Courier::Internal::AnyHash)
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Provide at least one of `tenant_id` or `service_url`. If you provide both, they
|
|
12
|
+
# must agree.
|
|
11
13
|
sig do
|
|
12
14
|
returns(
|
|
13
15
|
T.any(
|
|
@@ -34,7 +36,11 @@ module Courier
|
|
|
34
36
|
)
|
|
35
37
|
).returns(T.attached_class)
|
|
36
38
|
end
|
|
37
|
-
def self.new(
|
|
39
|
+
def self.new(
|
|
40
|
+
# Provide at least one of `tenant_id` or `service_url`. If you provide both, they
|
|
41
|
+
# must agree.
|
|
42
|
+
ms_teams:
|
|
43
|
+
)
|
|
38
44
|
end
|
|
39
45
|
|
|
40
46
|
sig do
|
|
@@ -11,12 +11,21 @@ module Courier
|
|
|
11
11
|
sig { returns(String) }
|
|
12
12
|
attr_accessor :channel_id
|
|
13
13
|
|
|
14
|
-
sig { returns(String) }
|
|
15
|
-
|
|
14
|
+
sig { returns(T.nilable(String)) }
|
|
15
|
+
attr_reader :service_url
|
|
16
16
|
|
|
17
|
-
sig {
|
|
18
|
-
|
|
17
|
+
sig { params(service_url: String).void }
|
|
18
|
+
attr_writer :service_url
|
|
19
|
+
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_reader :tenant_id
|
|
22
|
+
|
|
23
|
+
sig { params(tenant_id: String).void }
|
|
24
|
+
attr_writer :tenant_id
|
|
19
25
|
|
|
26
|
+
# Sends directly to a Microsoft Teams channel by its Bot Framework ID. Still
|
|
27
|
+
# provide at least one of `tenant_id` or `service_url` — sends without either have
|
|
28
|
+
# failed Bot Framework authentication in testing.
|
|
20
29
|
sig do
|
|
21
30
|
params(
|
|
22
31
|
channel_id: String,
|
|
@@ -24,7 +33,7 @@ module Courier
|
|
|
24
33
|
tenant_id: String
|
|
25
34
|
).returns(T.attached_class)
|
|
26
35
|
end
|
|
27
|
-
def self.new(channel_id:, service_url
|
|
36
|
+
def self.new(channel_id:, service_url: nil, tenant_id: nil)
|
|
28
37
|
end
|
|
29
38
|
|
|
30
39
|
sig do
|
|
@@ -11,32 +11,40 @@ module Courier
|
|
|
11
11
|
sig { returns(String) }
|
|
12
12
|
attr_accessor :channel_name
|
|
13
13
|
|
|
14
|
-
sig { returns(String) }
|
|
15
|
-
attr_accessor :service_url
|
|
16
|
-
|
|
17
14
|
sig { returns(String) }
|
|
18
15
|
attr_accessor :team_id
|
|
19
16
|
|
|
20
|
-
sig { returns(String) }
|
|
21
|
-
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_reader :service_url
|
|
19
|
+
|
|
20
|
+
sig { params(service_url: String).void }
|
|
21
|
+
attr_writer :service_url
|
|
22
|
+
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_reader :tenant_id
|
|
22
25
|
|
|
26
|
+
sig { params(tenant_id: String).void }
|
|
27
|
+
attr_writer :tenant_id
|
|
28
|
+
|
|
29
|
+
# `team_id` is required alongside `channel_name`. Also provide at least one of
|
|
30
|
+
# `tenant_id` or `service_url`; if you provide both, they must agree.
|
|
23
31
|
sig do
|
|
24
32
|
params(
|
|
25
33
|
channel_name: String,
|
|
26
|
-
service_url: String,
|
|
27
34
|
team_id: String,
|
|
35
|
+
service_url: String,
|
|
28
36
|
tenant_id: String
|
|
29
37
|
).returns(T.attached_class)
|
|
30
38
|
end
|
|
31
|
-
def self.new(channel_name:,
|
|
39
|
+
def self.new(channel_name:, team_id:, service_url: nil, tenant_id: nil)
|
|
32
40
|
end
|
|
33
41
|
|
|
34
42
|
sig do
|
|
35
43
|
override.returns(
|
|
36
44
|
{
|
|
37
45
|
channel_name: String,
|
|
38
|
-
service_url: String,
|
|
39
46
|
team_id: String,
|
|
47
|
+
service_url: String,
|
|
40
48
|
tenant_id: String
|
|
41
49
|
}
|
|
42
50
|
)
|
|
@@ -11,18 +11,26 @@ module Courier
|
|
|
11
11
|
sig { returns(String) }
|
|
12
12
|
attr_accessor :email
|
|
13
13
|
|
|
14
|
-
sig { returns(String) }
|
|
15
|
-
|
|
14
|
+
sig { returns(T.nilable(String)) }
|
|
15
|
+
attr_reader :service_url
|
|
16
16
|
|
|
17
|
-
sig {
|
|
18
|
-
|
|
17
|
+
sig { params(service_url: String).void }
|
|
18
|
+
attr_writer :service_url
|
|
19
|
+
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_reader :tenant_id
|
|
22
|
+
|
|
23
|
+
sig { params(tenant_id: String).void }
|
|
24
|
+
attr_writer :tenant_id
|
|
19
25
|
|
|
26
|
+
# Provide at least one of `tenant_id` or `service_url`. If you provide both, they
|
|
27
|
+
# must agree.
|
|
20
28
|
sig do
|
|
21
29
|
params(email: String, service_url: String, tenant_id: String).returns(
|
|
22
30
|
T.attached_class
|
|
23
31
|
)
|
|
24
32
|
end
|
|
25
|
-
def self.new(email:, service_url
|
|
33
|
+
def self.new(email:, service_url: nil, tenant_id: nil)
|
|
26
34
|
end
|
|
27
35
|
|
|
28
36
|
sig do
|