trycourier 4.17.1 → 4.18.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 +20 -0
- data/lib/courier/models/cancel_journey_request.rb +39 -0
- data/lib/courier/models/cancel_journey_response.rb +55 -0
- data/lib/courier/models/journey_cancel_params.rb +14 -0
- data/lib/courier/models/journey_experiment.rb +49 -0
- data/lib/courier/models/journey_experiment_variant.rb +44 -0
- data/lib/courier/models/journey_node.rb +1 -1
- data/lib/courier/models/journey_send_node.rb +23 -10
- data/lib/courier/models.rb +10 -0
- data/lib/courier/resources/journeys.rb +30 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +5 -0
- data/rbi/courier/models/cancel_journey_request.rbi +68 -0
- data/rbi/courier/models/cancel_journey_response.rbi +81 -0
- data/rbi/courier/models/journey_cancel_params.rbi +27 -0
- data/rbi/courier/models/journey_experiment.rbi +74 -0
- data/rbi/courier/models/journey_experiment_variant.rbi +61 -0
- data/rbi/courier/models/journey_send_node.rbi +32 -11
- data/rbi/courier/models.rbi +10 -0
- data/rbi/courier/resources/journeys.rbi +25 -0
- data/sig/courier/models/cancel_journey_request.rbs +33 -0
- data/sig/courier/models/cancel_journey_response.rbs +35 -0
- data/sig/courier/models/journey_cancel_params.rbs +15 -0
- data/sig/courier/models/journey_experiment.rbs +39 -0
- data/sig/courier/models/journey_experiment_variant.rbs +32 -0
- data/sig/courier/models/journey_send_node.rbs +19 -8
- data/sig/courier/models.rbs +10 -0
- data/sig/courier/resources/journeys.rbs +5 -0
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8dd821714bcedfb9a48185d8a9c04f669568f2fdd560bcbd58a7c21acf43be3
|
|
4
|
+
data.tar.gz: c8730971ee6d6fbb0e38a4f3a6a213c0a9fed7aca628d5ebc3e490c8c585d362
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1c3bdee713e6ac20200c2c35ac993a34a07b52b3e4c1bc9422e0074aeffe344b39962d7703463de38d80f00ba1ecc56e5ea839654ac0a45c6c51400fc996849b
|
|
7
|
+
data.tar.gz: 07535c3b636a1462811bd7f00685dbc3738c3ce589cc0f963baf898a2895f543c48a8e12e39135c6bebccdbabc3fb85388dea03af2aff3d0bcf6758c4ef2309e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.18.0 (2026-07-06)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.17.1...v4.18.0](https://github.com/trycourier/courier-ruby/compare/v4.17.1...v4.18.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **openapi:** Journeys cancel-by-token endpoint + send-node experiments (C-18986) ([12613c6](https://github.com/trycourier/courier-ruby/commit/12613c65e9b4facc19f7fa23cc92fac0b2ea8684))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal:** bound formatter parallelism to CPU count ([192d613](https://github.com/trycourier/courier-ruby/commit/192d6133c29e2ae7bfcd7c54bd1c244894f01b94))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
|
|
19
|
+
* **openapi:** reword Cancel journey runs 400 description (re-trigger deploy) ([89ceaab](https://github.com/trycourier/courier-ruby/commit/89ceaab2e20d45c3dd807427f5e4d248ba94cc8a))
|
|
20
|
+
* **openapi:** reword Cancel journey runs description (re-trigger deploy) ([ccce802](https://github.com/trycourier/courier-ruby/commit/ccce8027d4279de031ff2f7e95a250e512dbfbed))
|
|
21
|
+
* **openapi:** tighten Journeys cancel/experiment copy (C-19177) ([10c4f1d](https://github.com/trycourier/courier-ruby/commit/10c4f1d3ca27c525ec5d75d49f4bb30cc0d6180d))
|
|
22
|
+
|
|
3
23
|
## 4.17.1 (2026-06-25)
|
|
4
24
|
|
|
5
25
|
Full Changelog: [v4.17.0...v4.17.1](https://github.com/trycourier/courier-ruby/compare/v4.17.0...v4.17.1)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Request body for `POST /journeys/cancel`. Provide EXACTLY ONE of
|
|
6
|
+
# `cancelation_token` (cancels every run associated with the token) or `run_id`
|
|
7
|
+
# (cancels a single tenant-scoped run).
|
|
8
|
+
module CancelJourneyRequest
|
|
9
|
+
extend Courier::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
variant -> { Courier::CancelJourneyRequest::ByCancelationToken }
|
|
12
|
+
|
|
13
|
+
variant -> { Courier::CancelJourneyRequest::ByRunID }
|
|
14
|
+
|
|
15
|
+
class ByCancelationToken < Courier::Internal::Type::BaseModel
|
|
16
|
+
# @!attribute cancelation_token
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :cancelation_token, String
|
|
20
|
+
|
|
21
|
+
# @!method initialize(cancelation_token:)
|
|
22
|
+
# @param cancelation_token [String]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class ByRunID < Courier::Internal::Type::BaseModel
|
|
26
|
+
# @!attribute run_id
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :run_id, String
|
|
30
|
+
|
|
31
|
+
# @!method initialize(run_id:)
|
|
32
|
+
# @param run_id [String]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# @!method self.variants
|
|
36
|
+
# @return [Array(Courier::Models::CancelJourneyRequest::ByCancelationToken, Courier::Models::CancelJourneyRequest::ByRunID)]
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# `202 Accepted` body for `POST /journeys/cancel`, returning the submitted
|
|
6
|
+
# identifier. When called with `cancelation_token`, returns
|
|
7
|
+
# `{ cancelation_token }`; when called with `run_id`, returns
|
|
8
|
+
# `{ run_id, status }`.
|
|
9
|
+
#
|
|
10
|
+
# @see Courier::Resources::Journeys#cancel
|
|
11
|
+
module CancelJourneyResponse
|
|
12
|
+
extend Courier::Internal::Type::Union
|
|
13
|
+
|
|
14
|
+
variant -> { Courier::CancelJourneyResponse::TokenBranch }
|
|
15
|
+
|
|
16
|
+
variant -> { Courier::CancelJourneyResponse::RunIDBranch }
|
|
17
|
+
|
|
18
|
+
class TokenBranch < Courier::Internal::Type::BaseModel
|
|
19
|
+
# @!attribute cancelation_token
|
|
20
|
+
#
|
|
21
|
+
# @return [String]
|
|
22
|
+
required :cancelation_token, String
|
|
23
|
+
|
|
24
|
+
# @!method initialize(cancelation_token:)
|
|
25
|
+
# @param cancelation_token [String]
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
class RunIDBranch < Courier::Internal::Type::BaseModel
|
|
29
|
+
# @!attribute run_id
|
|
30
|
+
#
|
|
31
|
+
# @return [String]
|
|
32
|
+
required :run_id, String
|
|
33
|
+
|
|
34
|
+
# @!attribute status
|
|
35
|
+
# The run's resulting status. `CANCELED` when the run was active and has been
|
|
36
|
+
# canceled; `PROCESSED` or `ERROR` when the run had already finished and was left
|
|
37
|
+
# unchanged; `CANCELED` for an already-canceled run.
|
|
38
|
+
#
|
|
39
|
+
# @return [String]
|
|
40
|
+
required :status, String
|
|
41
|
+
|
|
42
|
+
# @!method initialize(run_id:, status:)
|
|
43
|
+
# Some parameter documentations has been truncated, see
|
|
44
|
+
# {Courier::Models::CancelJourneyResponse::RunIDBranch} for more details.
|
|
45
|
+
#
|
|
46
|
+
# @param run_id [String]
|
|
47
|
+
#
|
|
48
|
+
# @param status [String] The run's resulting status. `CANCELED` when the run was active and has been canc
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# @!method self.variants
|
|
52
|
+
# @return [Array(Courier::Models::CancelJourneyResponse::TokenBranch, Courier::Models::CancelJourneyResponse::RunIDBranch)]
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Journeys#cancel
|
|
6
|
+
class JourneyCancelParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyExperiment < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute bucketing_key
|
|
7
|
+
# The value used to deterministically assign a recipient to a variant. Must be
|
|
8
|
+
# non-empty with no leading or trailing whitespace.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :bucketing_key, String, api_name: :bucketingKey
|
|
12
|
+
|
|
13
|
+
# @!attribute variants
|
|
14
|
+
# Between 2 and 10 weighted template variants.
|
|
15
|
+
#
|
|
16
|
+
# @return [Array<Courier::Models::JourneyExperimentVariant>]
|
|
17
|
+
required :variants, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyExperimentVariant] }
|
|
18
|
+
|
|
19
|
+
# @!attribute id
|
|
20
|
+
# Unique experiment id (prefixed `exp_`). Omit to have one generated
|
|
21
|
+
# automatically; when supplied it must be a valid `exp_` id.
|
|
22
|
+
#
|
|
23
|
+
# @return [String, nil]
|
|
24
|
+
optional :id, String
|
|
25
|
+
|
|
26
|
+
# @!attribute name
|
|
27
|
+
# Optional display name for the experiment.
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :name, String
|
|
31
|
+
|
|
32
|
+
# @!method initialize(bucketing_key:, variants:, id: nil, name: nil)
|
|
33
|
+
# Some parameter documentations has been truncated, see
|
|
34
|
+
# {Courier::Models::JourneyExperiment} for more details.
|
|
35
|
+
#
|
|
36
|
+
# A/B experiment config for a send node. The recipient is deterministically
|
|
37
|
+
# bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
|
|
38
|
+
# its `weight`. Present on a send node INSTEAD OF `message.template`.
|
|
39
|
+
#
|
|
40
|
+
# @param bucketing_key [String] The value used to deterministically assign a recipient to a variant. Must be non
|
|
41
|
+
#
|
|
42
|
+
# @param variants [Array<Courier::Models::JourneyExperimentVariant>] Between 2 and 10 weighted template variants.
|
|
43
|
+
#
|
|
44
|
+
# @param id [String] Unique experiment id (prefixed `exp_`). Omit to have one generated automatically
|
|
45
|
+
#
|
|
46
|
+
# @param name [String] Optional display name for the experiment.
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyExperimentVariant < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute id
|
|
7
|
+
#
|
|
8
|
+
# @return [String]
|
|
9
|
+
required :id, String
|
|
10
|
+
|
|
11
|
+
# @!attribute template_id
|
|
12
|
+
# The notification template sent for this variant.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :template_id, String, api_name: :templateId
|
|
16
|
+
|
|
17
|
+
# @!attribute weight
|
|
18
|
+
# Relative routing weight. Must be non-negative.
|
|
19
|
+
#
|
|
20
|
+
# @return [Float]
|
|
21
|
+
required :weight, Float
|
|
22
|
+
|
|
23
|
+
# @!attribute name
|
|
24
|
+
# Optional display name for the variant.
|
|
25
|
+
#
|
|
26
|
+
# @return [String, nil]
|
|
27
|
+
optional :name, String
|
|
28
|
+
|
|
29
|
+
# @!method initialize(id:, template_id:, weight:, name: nil)
|
|
30
|
+
# A single weighted variant of an experiment. Variant ids must be unique within
|
|
31
|
+
# the experiment and the sum of all variant weights must be greater than 0.
|
|
32
|
+
# Weights are relative (no sum-to-100 requirement) — routing normalizes them
|
|
33
|
+
# proportionally.
|
|
34
|
+
#
|
|
35
|
+
# @param id [String]
|
|
36
|
+
#
|
|
37
|
+
# @param template_id [String] The notification template sent for this variant.
|
|
38
|
+
#
|
|
39
|
+
# @param weight [Float] Relative routing weight. Must be non-negative.
|
|
40
|
+
#
|
|
41
|
+
# @param name [String] Optional display name for the variant.
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -14,7 +14,7 @@ module Courier
|
|
|
14
14
|
# Trigger fired by a segment event (`identify`, `group`, or `track`).
|
|
15
15
|
variant -> { Courier::JourneySegmentTriggerNode }
|
|
16
16
|
|
|
17
|
-
# Send a notification template
|
|
17
|
+
# Send to the recipient. A send node sources its content from EXACTLY ONE of `message.template` (a single notification template) or `experiment` (an A/B split across weighted template variants) — supplying both, or neither, is rejected. Optionally override the recipient address, delay the send, or attach `data`.
|
|
18
18
|
variant -> { Courier::JourneySendNode }
|
|
19
19
|
|
|
20
20
|
# Pause the journey run for a fixed `duration`.
|
|
@@ -26,12 +26,23 @@ module Courier
|
|
|
26
26
|
# @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
|
|
27
27
|
optional :conditions, union: -> { Courier::JourneyConditionsField }
|
|
28
28
|
|
|
29
|
-
# @!
|
|
29
|
+
# @!attribute experiment
|
|
30
|
+
# A/B experiment config for a send node. The recipient is deterministically
|
|
31
|
+
# bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
|
|
32
|
+
# its `weight`. Present on a send node INSTEAD OF `message.template`.
|
|
33
|
+
#
|
|
34
|
+
# @return [Courier::Models::JourneyExperiment, nil]
|
|
35
|
+
optional :experiment, -> { Courier::JourneyExperiment }
|
|
36
|
+
|
|
37
|
+
# @!method initialize(message:, type:, id: nil, conditions: nil, experiment: nil)
|
|
30
38
|
# Some parameter documentations has been truncated, see
|
|
31
39
|
# {Courier::Models::JourneySendNode} for more details.
|
|
32
40
|
#
|
|
33
|
-
# Send
|
|
34
|
-
#
|
|
41
|
+
# Send to the recipient. A send node sources its content from EXACTLY ONE of
|
|
42
|
+
# `message.template` (a single notification template) or `experiment` (an A/B
|
|
43
|
+
# split across weighted template variants) — supplying both, or neither, is
|
|
44
|
+
# rejected. Optionally override the recipient address, delay the send, or attach
|
|
45
|
+
# `data`.
|
|
35
46
|
#
|
|
36
47
|
# @param message [Courier::Models::JourneySendNode::Message]
|
|
37
48
|
#
|
|
@@ -40,14 +51,11 @@ module Courier
|
|
|
40
51
|
# @param id [String]
|
|
41
52
|
#
|
|
42
53
|
# @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
|
|
54
|
+
#
|
|
55
|
+
# @param experiment [Courier::Models::JourneyExperiment] A/B experiment config for a send node. The recipient is deterministically bucket
|
|
43
56
|
|
|
44
57
|
# @see Courier::Models::JourneySendNode#message
|
|
45
58
|
class Message < Courier::Internal::Type::BaseModel
|
|
46
|
-
# @!attribute template
|
|
47
|
-
#
|
|
48
|
-
# @return [String]
|
|
49
|
-
required :template, String
|
|
50
|
-
|
|
51
59
|
# @!attribute data
|
|
52
60
|
#
|
|
53
61
|
# @return [Hash{Symbol=>Object}, nil]
|
|
@@ -58,15 +66,20 @@ module Courier
|
|
|
58
66
|
# @return [Courier::Models::JourneySendNode::Message::Delay, nil]
|
|
59
67
|
optional :delay, -> { Courier::JourneySendNode::Message::Delay }
|
|
60
68
|
|
|
69
|
+
# @!attribute template
|
|
70
|
+
#
|
|
71
|
+
# @return [String, nil]
|
|
72
|
+
optional :template, String
|
|
73
|
+
|
|
61
74
|
# @!attribute to
|
|
62
75
|
#
|
|
63
76
|
# @return [Courier::Models::JourneySendNode::Message::To, nil]
|
|
64
77
|
optional :to, -> { Courier::JourneySendNode::Message::To }
|
|
65
78
|
|
|
66
|
-
# @!method initialize(
|
|
67
|
-
# @param template [String]
|
|
79
|
+
# @!method initialize(data: nil, delay: nil, template: nil, to: nil)
|
|
68
80
|
# @param data [Hash{Symbol=>Object}]
|
|
69
81
|
# @param delay [Courier::Models::JourneySendNode::Message::Delay]
|
|
82
|
+
# @param template [String]
|
|
70
83
|
# @param to [Courier::Models::JourneySendNode::Message::To]
|
|
71
84
|
|
|
72
85
|
# @see Courier::Models::JourneySendNode::Message#delay
|
data/lib/courier/models.rb
CHANGED
|
@@ -123,6 +123,10 @@ module Courier
|
|
|
123
123
|
|
|
124
124
|
BulkRunJobParams = Courier::Models::BulkRunJobParams
|
|
125
125
|
|
|
126
|
+
CancelJourneyRequest = Courier::Models::CancelJourneyRequest
|
|
127
|
+
|
|
128
|
+
CancelJourneyResponse = Courier::Models::CancelJourneyResponse
|
|
129
|
+
|
|
126
130
|
Channel = Courier::Models::Channel
|
|
127
131
|
|
|
128
132
|
ChannelClassification = Courier::Models::ChannelClassification
|
|
@@ -207,6 +211,8 @@ module Courier
|
|
|
207
211
|
|
|
208
212
|
JourneyArchiveParams = Courier::Models::JourneyArchiveParams
|
|
209
213
|
|
|
214
|
+
JourneyCancelParams = Courier::Models::JourneyCancelParams
|
|
215
|
+
|
|
210
216
|
# @type [Courier::Internal::Type::Converter]
|
|
211
217
|
JourneyConditionAtom = Courier::Models::JourneyConditionAtom
|
|
212
218
|
|
|
@@ -224,6 +230,10 @@ module Courier
|
|
|
224
230
|
|
|
225
231
|
JourneyExitNode = Courier::Models::JourneyExitNode
|
|
226
232
|
|
|
233
|
+
JourneyExperiment = Courier::Models::JourneyExperiment
|
|
234
|
+
|
|
235
|
+
JourneyExperimentVariant = Courier::Models::JourneyExperimentVariant
|
|
236
|
+
|
|
227
237
|
JourneyFetchGetDeleteNode = Courier::Models::JourneyFetchGetDeleteNode
|
|
228
238
|
|
|
229
239
|
JourneyFetchPostPutNode = Courier::Models::JourneyFetchPostPutNode
|
|
@@ -114,6 +114,36 @@ module Courier
|
|
|
114
114
|
)
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
+
# Some parameter documentations has been truncated, see
|
|
118
|
+
# {Courier::Models::JourneyCancelParams} for more details.
|
|
119
|
+
#
|
|
120
|
+
# Cancel journey runs. The request body must include EXACTLY ONE of
|
|
121
|
+
# `cancelation_token` (cancels every run associated with the token) or `run_id`
|
|
122
|
+
# (cancels a single tenant-scoped run). Supplying both or neither returns a `400`.
|
|
123
|
+
# A `run_id` that does not match a run for the tenant returns `404`. Cancelation
|
|
124
|
+
# is idempotent: a run that has already finished (`PROCESSED`/`ERROR`) or was
|
|
125
|
+
# already `CANCELED` is left unchanged and its current status is returned.
|
|
126
|
+
#
|
|
127
|
+
# @overload cancel(cancel_journey_request:, request_options: {})
|
|
128
|
+
#
|
|
129
|
+
# @param cancel_journey_request [Courier::Models::CancelJourneyRequest::ByCancelationToken, Courier::Models::CancelJourneyRequest::ByRunID] Request body for `POST /journeys/cancel`. Provide EXACTLY ONE of `cancelation_to
|
|
130
|
+
#
|
|
131
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
132
|
+
#
|
|
133
|
+
# @return [Courier::Models::CancelJourneyResponse::TokenBranch, Courier::Models::CancelJourneyResponse::RunIDBranch]
|
|
134
|
+
#
|
|
135
|
+
# @see Courier::Models::JourneyCancelParams
|
|
136
|
+
def cancel(params)
|
|
137
|
+
parsed, options = Courier::JourneyCancelParams.dump_request(params)
|
|
138
|
+
@client.request(
|
|
139
|
+
method: :post,
|
|
140
|
+
path: "journeys/cancel",
|
|
141
|
+
body: parsed[:cancel_journey_request],
|
|
142
|
+
model: Courier::CancelJourneyResponse,
|
|
143
|
+
options: options
|
|
144
|
+
)
|
|
145
|
+
end
|
|
146
|
+
|
|
117
147
|
# Some parameter documentations has been truncated, see
|
|
118
148
|
# {Courier::Models::JourneyInvokeParams} for more details.
|
|
119
149
|
#
|
data/lib/courier/version.rb
CHANGED
data/lib/courier.rb
CHANGED
|
@@ -58,6 +58,7 @@ require_relative "courier/models/inbound_bulk_message_user"
|
|
|
58
58
|
require_relative "courier/models/base_check"
|
|
59
59
|
require_relative "courier/models/subscription_topic_new"
|
|
60
60
|
require_relative "courier/models/elemental_channel_node"
|
|
61
|
+
require_relative "courier/models/cancel_journey_request"
|
|
61
62
|
require_relative "courier/models/create_journey_request"
|
|
62
63
|
require_relative "courier/models/journeys_invoke_request"
|
|
63
64
|
require_relative "courier/models/journey_publish_request"
|
|
@@ -131,6 +132,7 @@ require_relative "courier/models/bulk_list_users_response"
|
|
|
131
132
|
require_relative "courier/models/bulk_retrieve_job_params"
|
|
132
133
|
require_relative "courier/models/bulk_retrieve_job_response"
|
|
133
134
|
require_relative "courier/models/bulk_run_job_params"
|
|
135
|
+
require_relative "courier/models/cancel_journey_response"
|
|
134
136
|
require_relative "courier/models/channel"
|
|
135
137
|
require_relative "courier/models/channel_classification"
|
|
136
138
|
require_relative "courier/models/channel_metadata"
|
|
@@ -171,6 +173,7 @@ require_relative "courier/models/journey"
|
|
|
171
173
|
require_relative "courier/models/journey_ai_node"
|
|
172
174
|
require_relative "courier/models/journey_api_invoke_trigger_node"
|
|
173
175
|
require_relative "courier/models/journey_archive_params"
|
|
176
|
+
require_relative "courier/models/journey_cancel_params"
|
|
174
177
|
require_relative "courier/models/journey_condition_atom"
|
|
175
178
|
require_relative "courier/models/journey_condition_group"
|
|
176
179
|
require_relative "courier/models/journey_condition_nested_group"
|
|
@@ -179,6 +182,8 @@ require_relative "courier/models/journey_create_params"
|
|
|
179
182
|
require_relative "courier/models/journey_delay_duration_node"
|
|
180
183
|
require_relative "courier/models/journey_delay_until_node"
|
|
181
184
|
require_relative "courier/models/journey_exit_node"
|
|
185
|
+
require_relative "courier/models/journey_experiment"
|
|
186
|
+
require_relative "courier/models/journey_experiment_variant"
|
|
182
187
|
require_relative "courier/models/journey_fetch_get_delete_node"
|
|
183
188
|
require_relative "courier/models/journey_fetch_post_put_node"
|
|
184
189
|
require_relative "courier/models/journey_invoke_params"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Request body for `POST /journeys/cancel`. Provide EXACTLY ONE of
|
|
6
|
+
# `cancelation_token` (cancels every run associated with the token) or `run_id`
|
|
7
|
+
# (cancels a single tenant-scoped run).
|
|
8
|
+
module CancelJourneyRequest
|
|
9
|
+
extend Courier::Internal::Type::Union
|
|
10
|
+
|
|
11
|
+
Variants =
|
|
12
|
+
T.type_alias do
|
|
13
|
+
T.any(
|
|
14
|
+
Courier::CancelJourneyRequest::ByCancelationToken,
|
|
15
|
+
Courier::CancelJourneyRequest::ByRunID
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class ByCancelationToken < Courier::Internal::Type::BaseModel
|
|
20
|
+
OrHash =
|
|
21
|
+
T.type_alias do
|
|
22
|
+
T.any(
|
|
23
|
+
Courier::CancelJourneyRequest::ByCancelationToken,
|
|
24
|
+
Courier::Internal::AnyHash
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
sig { returns(String) }
|
|
29
|
+
attr_accessor :cancelation_token
|
|
30
|
+
|
|
31
|
+
sig { params(cancelation_token: String).returns(T.attached_class) }
|
|
32
|
+
def self.new(cancelation_token:)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
sig { override.returns({ cancelation_token: String }) }
|
|
36
|
+
def to_hash
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
class ByRunID < Courier::Internal::Type::BaseModel
|
|
41
|
+
OrHash =
|
|
42
|
+
T.type_alias do
|
|
43
|
+
T.any(
|
|
44
|
+
Courier::CancelJourneyRequest::ByRunID,
|
|
45
|
+
Courier::Internal::AnyHash
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
sig { returns(String) }
|
|
50
|
+
attr_accessor :run_id
|
|
51
|
+
|
|
52
|
+
sig { params(run_id: String).returns(T.attached_class) }
|
|
53
|
+
def self.new(run_id:)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
sig { override.returns({ run_id: String }) }
|
|
57
|
+
def to_hash
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
sig do
|
|
62
|
+
override.returns(T::Array[Courier::CancelJourneyRequest::Variants])
|
|
63
|
+
end
|
|
64
|
+
def self.variants
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# `202 Accepted` body for `POST /journeys/cancel`, returning the submitted
|
|
6
|
+
# identifier. When called with `cancelation_token`, returns
|
|
7
|
+
# `{ cancelation_token }`; when called with `run_id`, returns
|
|
8
|
+
# `{ run_id, status }`.
|
|
9
|
+
module CancelJourneyResponse
|
|
10
|
+
extend Courier::Internal::Type::Union
|
|
11
|
+
|
|
12
|
+
Variants =
|
|
13
|
+
T.type_alias do
|
|
14
|
+
T.any(
|
|
15
|
+
Courier::CancelJourneyResponse::TokenBranch,
|
|
16
|
+
Courier::CancelJourneyResponse::RunIDBranch
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class TokenBranch < Courier::Internal::Type::BaseModel
|
|
21
|
+
OrHash =
|
|
22
|
+
T.type_alias do
|
|
23
|
+
T.any(
|
|
24
|
+
Courier::CancelJourneyResponse::TokenBranch,
|
|
25
|
+
Courier::Internal::AnyHash
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig { returns(String) }
|
|
30
|
+
attr_accessor :cancelation_token
|
|
31
|
+
|
|
32
|
+
sig { params(cancelation_token: String).returns(T.attached_class) }
|
|
33
|
+
def self.new(cancelation_token:)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
sig { override.returns({ cancelation_token: String }) }
|
|
37
|
+
def to_hash
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
class RunIDBranch < Courier::Internal::Type::BaseModel
|
|
42
|
+
OrHash =
|
|
43
|
+
T.type_alias do
|
|
44
|
+
T.any(
|
|
45
|
+
Courier::CancelJourneyResponse::RunIDBranch,
|
|
46
|
+
Courier::Internal::AnyHash
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
sig { returns(String) }
|
|
51
|
+
attr_accessor :run_id
|
|
52
|
+
|
|
53
|
+
# The run's resulting status. `CANCELED` when the run was active and has been
|
|
54
|
+
# canceled; `PROCESSED` or `ERROR` when the run had already finished and was left
|
|
55
|
+
# unchanged; `CANCELED` for an already-canceled run.
|
|
56
|
+
sig { returns(String) }
|
|
57
|
+
attr_accessor :status
|
|
58
|
+
|
|
59
|
+
sig { params(run_id: String, status: String).returns(T.attached_class) }
|
|
60
|
+
def self.new(
|
|
61
|
+
run_id:,
|
|
62
|
+
# The run's resulting status. `CANCELED` when the run was active and has been
|
|
63
|
+
# canceled; `PROCESSED` or `ERROR` when the run had already finished and was left
|
|
64
|
+
# unchanged; `CANCELED` for an already-canceled run.
|
|
65
|
+
status:
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
sig { override.returns({ run_id: String, status: String }) }
|
|
70
|
+
def to_hash
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
sig do
|
|
75
|
+
override.returns(T::Array[Courier::CancelJourneyResponse::Variants])
|
|
76
|
+
end
|
|
77
|
+
def self.variants
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyCancelParams < Courier::Internal::Type::BaseModel
|
|
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::JourneyCancelParams, Courier::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig do
|
|
15
|
+
params(request_options: Courier::RequestOptions::OrHash).returns(
|
|
16
|
+
T.attached_class
|
|
17
|
+
)
|
|
18
|
+
end
|
|
19
|
+
def self.new(request_options: {})
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
sig { override.returns({ request_options: Courier::RequestOptions }) }
|
|
23
|
+
def to_hash
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyExperiment < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::JourneyExperiment, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The value used to deterministically assign a recipient to a variant. Must be
|
|
12
|
+
# non-empty with no leading or trailing whitespace.
|
|
13
|
+
sig { returns(String) }
|
|
14
|
+
attr_accessor :bucketing_key
|
|
15
|
+
|
|
16
|
+
# Between 2 and 10 weighted template variants.
|
|
17
|
+
sig { returns(T::Array[Courier::JourneyExperimentVariant]) }
|
|
18
|
+
attr_accessor :variants
|
|
19
|
+
|
|
20
|
+
# Unique experiment id (prefixed `exp_`). Omit to have one generated
|
|
21
|
+
# automatically; when supplied it must be a valid `exp_` id.
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_reader :id
|
|
24
|
+
|
|
25
|
+
sig { params(id: String).void }
|
|
26
|
+
attr_writer :id
|
|
27
|
+
|
|
28
|
+
# Optional display name for the experiment.
|
|
29
|
+
sig { returns(T.nilable(String)) }
|
|
30
|
+
attr_reader :name
|
|
31
|
+
|
|
32
|
+
sig { params(name: String).void }
|
|
33
|
+
attr_writer :name
|
|
34
|
+
|
|
35
|
+
# A/B experiment config for a send node. The recipient is deterministically
|
|
36
|
+
# bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
|
|
37
|
+
# its `weight`. Present on a send node INSTEAD OF `message.template`.
|
|
38
|
+
sig do
|
|
39
|
+
params(
|
|
40
|
+
bucketing_key: String,
|
|
41
|
+
variants: T::Array[Courier::JourneyExperimentVariant::OrHash],
|
|
42
|
+
id: String,
|
|
43
|
+
name: String
|
|
44
|
+
).returns(T.attached_class)
|
|
45
|
+
end
|
|
46
|
+
def self.new(
|
|
47
|
+
# The value used to deterministically assign a recipient to a variant. Must be
|
|
48
|
+
# non-empty with no leading or trailing whitespace.
|
|
49
|
+
bucketing_key:,
|
|
50
|
+
# Between 2 and 10 weighted template variants.
|
|
51
|
+
variants:,
|
|
52
|
+
# Unique experiment id (prefixed `exp_`). Omit to have one generated
|
|
53
|
+
# automatically; when supplied it must be a valid `exp_` id.
|
|
54
|
+
id: nil,
|
|
55
|
+
# Optional display name for the experiment.
|
|
56
|
+
name: nil
|
|
57
|
+
)
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
sig do
|
|
61
|
+
override.returns(
|
|
62
|
+
{
|
|
63
|
+
bucketing_key: String,
|
|
64
|
+
variants: T::Array[Courier::JourneyExperimentVariant],
|
|
65
|
+
id: String,
|
|
66
|
+
name: String
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
def to_hash
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyExperimentVariant < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::JourneyExperimentVariant, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
sig { returns(String) }
|
|
12
|
+
attr_accessor :id
|
|
13
|
+
|
|
14
|
+
# The notification template sent for this variant.
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :template_id
|
|
17
|
+
|
|
18
|
+
# Relative routing weight. Must be non-negative.
|
|
19
|
+
sig { returns(Float) }
|
|
20
|
+
attr_accessor :weight
|
|
21
|
+
|
|
22
|
+
# Optional display name for the variant.
|
|
23
|
+
sig { returns(T.nilable(String)) }
|
|
24
|
+
attr_reader :name
|
|
25
|
+
|
|
26
|
+
sig { params(name: String).void }
|
|
27
|
+
attr_writer :name
|
|
28
|
+
|
|
29
|
+
# A single weighted variant of an experiment. Variant ids must be unique within
|
|
30
|
+
# the experiment and the sum of all variant weights must be greater than 0.
|
|
31
|
+
# Weights are relative (no sum-to-100 requirement) — routing normalizes them
|
|
32
|
+
# proportionally.
|
|
33
|
+
sig do
|
|
34
|
+
params(
|
|
35
|
+
id: String,
|
|
36
|
+
template_id: String,
|
|
37
|
+
weight: Float,
|
|
38
|
+
name: String
|
|
39
|
+
).returns(T.attached_class)
|
|
40
|
+
end
|
|
41
|
+
def self.new(
|
|
42
|
+
id:,
|
|
43
|
+
# The notification template sent for this variant.
|
|
44
|
+
template_id:,
|
|
45
|
+
# Relative routing weight. Must be non-negative.
|
|
46
|
+
weight:,
|
|
47
|
+
# Optional display name for the variant.
|
|
48
|
+
name: nil
|
|
49
|
+
)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
sig do
|
|
53
|
+
override.returns(
|
|
54
|
+
{ id: String, template_id: String, weight: Float, name: String }
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
def to_hash
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -51,8 +51,20 @@ module Courier
|
|
|
51
51
|
end
|
|
52
52
|
attr_writer :conditions
|
|
53
53
|
|
|
54
|
-
#
|
|
55
|
-
#
|
|
54
|
+
# A/B experiment config for a send node. The recipient is deterministically
|
|
55
|
+
# bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
|
|
56
|
+
# its `weight`. Present on a send node INSTEAD OF `message.template`.
|
|
57
|
+
sig { returns(T.nilable(Courier::JourneyExperiment)) }
|
|
58
|
+
attr_reader :experiment
|
|
59
|
+
|
|
60
|
+
sig { params(experiment: Courier::JourneyExperiment::OrHash).void }
|
|
61
|
+
attr_writer :experiment
|
|
62
|
+
|
|
63
|
+
# Send to the recipient. A send node sources its content from EXACTLY ONE of
|
|
64
|
+
# `message.template` (a single notification template) or `experiment` (an A/B
|
|
65
|
+
# split across weighted template variants) — supplying both, or neither, is
|
|
66
|
+
# rejected. Optionally override the recipient address, delay the send, or attach
|
|
67
|
+
# `data`.
|
|
56
68
|
sig do
|
|
57
69
|
params(
|
|
58
70
|
message: Courier::JourneySendNode::Message::OrHash,
|
|
@@ -63,7 +75,8 @@ module Courier
|
|
|
63
75
|
T::Array[String],
|
|
64
76
|
Courier::JourneyConditionGroup::OrHash,
|
|
65
77
|
Courier::JourneyConditionNestedGroup::OrHash
|
|
66
|
-
)
|
|
78
|
+
),
|
|
79
|
+
experiment: Courier::JourneyExperiment::OrHash
|
|
67
80
|
).returns(T.attached_class)
|
|
68
81
|
end
|
|
69
82
|
def self.new(
|
|
@@ -73,7 +86,11 @@ module Courier
|
|
|
73
86
|
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
74
87
|
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
75
88
|
# express "no conditions".
|
|
76
|
-
conditions: nil
|
|
89
|
+
conditions: nil,
|
|
90
|
+
# A/B experiment config for a send node. The recipient is deterministically
|
|
91
|
+
# bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
|
|
92
|
+
# its `weight`. Present on a send node INSTEAD OF `message.template`.
|
|
93
|
+
experiment: nil
|
|
77
94
|
)
|
|
78
95
|
end
|
|
79
96
|
|
|
@@ -88,7 +105,8 @@ module Courier
|
|
|
88
105
|
T::Array[String],
|
|
89
106
|
Courier::JourneyConditionGroup,
|
|
90
107
|
Courier::JourneyConditionNestedGroup
|
|
91
|
-
)
|
|
108
|
+
),
|
|
109
|
+
experiment: Courier::JourneyExperiment
|
|
92
110
|
}
|
|
93
111
|
)
|
|
94
112
|
end
|
|
@@ -101,9 +119,6 @@ module Courier
|
|
|
101
119
|
T.any(Courier::JourneySendNode::Message, Courier::Internal::AnyHash)
|
|
102
120
|
end
|
|
103
121
|
|
|
104
|
-
sig { returns(String) }
|
|
105
|
-
attr_accessor :template
|
|
106
|
-
|
|
107
122
|
sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
|
|
108
123
|
attr_reader :data
|
|
109
124
|
|
|
@@ -118,6 +133,12 @@ module Courier
|
|
|
118
133
|
end
|
|
119
134
|
attr_writer :delay
|
|
120
135
|
|
|
136
|
+
sig { returns(T.nilable(String)) }
|
|
137
|
+
attr_reader :template
|
|
138
|
+
|
|
139
|
+
sig { params(template: String).void }
|
|
140
|
+
attr_writer :template
|
|
141
|
+
|
|
121
142
|
sig { returns(T.nilable(Courier::JourneySendNode::Message::To)) }
|
|
122
143
|
attr_reader :to
|
|
123
144
|
|
|
@@ -126,21 +147,21 @@ module Courier
|
|
|
126
147
|
|
|
127
148
|
sig do
|
|
128
149
|
params(
|
|
129
|
-
template: String,
|
|
130
150
|
data: T::Hash[Symbol, T.anything],
|
|
131
151
|
delay: Courier::JourneySendNode::Message::Delay::OrHash,
|
|
152
|
+
template: String,
|
|
132
153
|
to: Courier::JourneySendNode::Message::To::OrHash
|
|
133
154
|
).returns(T.attached_class)
|
|
134
155
|
end
|
|
135
|
-
def self.new(
|
|
156
|
+
def self.new(data: nil, delay: nil, template: nil, to: nil)
|
|
136
157
|
end
|
|
137
158
|
|
|
138
159
|
sig do
|
|
139
160
|
override.returns(
|
|
140
161
|
{
|
|
141
|
-
template: String,
|
|
142
162
|
data: T::Hash[Symbol, T.anything],
|
|
143
163
|
delay: Courier::JourneySendNode::Message::Delay,
|
|
164
|
+
template: String,
|
|
144
165
|
to: Courier::JourneySendNode::Message::To
|
|
145
166
|
}
|
|
146
167
|
)
|
data/rbi/courier/models.rbi
CHANGED
|
@@ -87,6 +87,10 @@ module Courier
|
|
|
87
87
|
|
|
88
88
|
BulkRunJobParams = Courier::Models::BulkRunJobParams
|
|
89
89
|
|
|
90
|
+
CancelJourneyRequest = Courier::Models::CancelJourneyRequest
|
|
91
|
+
|
|
92
|
+
CancelJourneyResponse = Courier::Models::CancelJourneyResponse
|
|
93
|
+
|
|
90
94
|
Channel = Courier::Models::Channel
|
|
91
95
|
|
|
92
96
|
ChannelClassification = Courier::Models::ChannelClassification
|
|
@@ -171,6 +175,8 @@ module Courier
|
|
|
171
175
|
|
|
172
176
|
JourneyArchiveParams = Courier::Models::JourneyArchiveParams
|
|
173
177
|
|
|
178
|
+
JourneyCancelParams = Courier::Models::JourneyCancelParams
|
|
179
|
+
|
|
174
180
|
JourneyConditionAtom =
|
|
175
181
|
T.let(
|
|
176
182
|
Courier::Models::JourneyConditionAtom,
|
|
@@ -191,6 +197,10 @@ module Courier
|
|
|
191
197
|
|
|
192
198
|
JourneyExitNode = Courier::Models::JourneyExitNode
|
|
193
199
|
|
|
200
|
+
JourneyExperiment = Courier::Models::JourneyExperiment
|
|
201
|
+
|
|
202
|
+
JourneyExperimentVariant = Courier::Models::JourneyExperimentVariant
|
|
203
|
+
|
|
194
204
|
JourneyFetchGetDeleteNode = Courier::Models::JourneyFetchGetDeleteNode
|
|
195
205
|
|
|
196
206
|
JourneyFetchPostPutNode = Courier::Models::JourneyFetchPostPutNode
|
|
@@ -101,6 +101,31 @@ module Courier
|
|
|
101
101
|
)
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
# Cancel journey runs. The request body must include EXACTLY ONE of
|
|
105
|
+
# `cancelation_token` (cancels every run associated with the token) or `run_id`
|
|
106
|
+
# (cancels a single tenant-scoped run). Supplying both or neither returns a `400`.
|
|
107
|
+
# A `run_id` that does not match a run for the tenant returns `404`. Cancelation
|
|
108
|
+
# is idempotent: a run that has already finished (`PROCESSED`/`ERROR`) or was
|
|
109
|
+
# already `CANCELED` is left unchanged and its current status is returned.
|
|
110
|
+
sig do
|
|
111
|
+
params(
|
|
112
|
+
cancel_journey_request:
|
|
113
|
+
T.any(
|
|
114
|
+
Courier::CancelJourneyRequest::ByCancelationToken::OrHash,
|
|
115
|
+
Courier::CancelJourneyRequest::ByRunID::OrHash
|
|
116
|
+
),
|
|
117
|
+
request_options: Courier::RequestOptions::OrHash
|
|
118
|
+
).returns(Courier::CancelJourneyResponse::Variants)
|
|
119
|
+
end
|
|
120
|
+
def cancel(
|
|
121
|
+
# Request body for `POST /journeys/cancel`. Provide EXACTLY ONE of
|
|
122
|
+
# `cancelation_token` (cancels every run associated with the token) or `run_id`
|
|
123
|
+
# (cancels a single tenant-scoped run).
|
|
124
|
+
cancel_journey_request:,
|
|
125
|
+
request_options: {}
|
|
126
|
+
)
|
|
127
|
+
end
|
|
128
|
+
|
|
104
129
|
# Invoke a journey by id or alias to start a new run. The response includes a
|
|
105
130
|
# `runId` identifying the run.
|
|
106
131
|
sig do
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type cancel_journey_request =
|
|
4
|
+
Courier::CancelJourneyRequest::ByCancelationToken
|
|
5
|
+
| Courier::CancelJourneyRequest::ByRunID
|
|
6
|
+
|
|
7
|
+
module CancelJourneyRequest
|
|
8
|
+
extend Courier::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
type by_cancelation_token = { cancelation_token: String }
|
|
11
|
+
|
|
12
|
+
class ByCancelationToken < Courier::Internal::Type::BaseModel
|
|
13
|
+
attr_accessor cancelation_token: String
|
|
14
|
+
|
|
15
|
+
def initialize: (cancelation_token: String) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> { cancelation_token: String }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
type by_run_id = { run_id: String }
|
|
21
|
+
|
|
22
|
+
class ByRunID < Courier::Internal::Type::BaseModel
|
|
23
|
+
attr_accessor run_id: String
|
|
24
|
+
|
|
25
|
+
def initialize: (run_id: String) -> void
|
|
26
|
+
|
|
27
|
+
def to_hash: -> { run_id: String }
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def self?.variants: -> ::Array[Courier::Models::cancel_journey_request]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type cancel_journey_response =
|
|
4
|
+
Courier::CancelJourneyResponse::TokenBranch
|
|
5
|
+
| Courier::CancelJourneyResponse::RunIDBranch
|
|
6
|
+
|
|
7
|
+
module CancelJourneyResponse
|
|
8
|
+
extend Courier::Internal::Type::Union
|
|
9
|
+
|
|
10
|
+
type token_branch = { cancelation_token: String }
|
|
11
|
+
|
|
12
|
+
class TokenBranch < Courier::Internal::Type::BaseModel
|
|
13
|
+
attr_accessor cancelation_token: String
|
|
14
|
+
|
|
15
|
+
def initialize: (cancelation_token: String) -> void
|
|
16
|
+
|
|
17
|
+
def to_hash: -> { cancelation_token: String }
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
type run_id_branch = { run_id: String, status: String }
|
|
21
|
+
|
|
22
|
+
class RunIDBranch < Courier::Internal::Type::BaseModel
|
|
23
|
+
attr_accessor run_id: String
|
|
24
|
+
|
|
25
|
+
attr_accessor status: String
|
|
26
|
+
|
|
27
|
+
def initialize: (run_id: String, status: String) -> void
|
|
28
|
+
|
|
29
|
+
def to_hash: -> { run_id: String, status: String }
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self?.variants: -> ::Array[Courier::Models::cancel_journey_response]
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type journey_cancel_params =
|
|
4
|
+
{ } & Courier::Internal::Type::request_parameters
|
|
5
|
+
|
|
6
|
+
class JourneyCancelParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
def initialize: (?request_options: Courier::request_opts) -> void
|
|
11
|
+
|
|
12
|
+
def to_hash: -> { request_options: Courier::RequestOptions }
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type journey_experiment =
|
|
4
|
+
{
|
|
5
|
+
bucketing_key: String,
|
|
6
|
+
variants: ::Array[Courier::JourneyExperimentVariant],
|
|
7
|
+
id: String,
|
|
8
|
+
name: String
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
class JourneyExperiment < Courier::Internal::Type::BaseModel
|
|
12
|
+
attr_accessor bucketing_key: String
|
|
13
|
+
|
|
14
|
+
attr_accessor variants: ::Array[Courier::JourneyExperimentVariant]
|
|
15
|
+
|
|
16
|
+
attr_reader id: String?
|
|
17
|
+
|
|
18
|
+
def id=: (String) -> String
|
|
19
|
+
|
|
20
|
+
attr_reader name: String?
|
|
21
|
+
|
|
22
|
+
def name=: (String) -> String
|
|
23
|
+
|
|
24
|
+
def initialize: (
|
|
25
|
+
bucketing_key: String,
|
|
26
|
+
variants: ::Array[Courier::JourneyExperimentVariant],
|
|
27
|
+
?id: String,
|
|
28
|
+
?name: String
|
|
29
|
+
) -> void
|
|
30
|
+
|
|
31
|
+
def to_hash: -> {
|
|
32
|
+
bucketing_key: String,
|
|
33
|
+
variants: ::Array[Courier::JourneyExperimentVariant],
|
|
34
|
+
id: String,
|
|
35
|
+
name: String
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module Courier
|
|
2
|
+
module Models
|
|
3
|
+
type journey_experiment_variant =
|
|
4
|
+
{ id: String, template_id: String, weight: Float, name: String }
|
|
5
|
+
|
|
6
|
+
class JourneyExperimentVariant < Courier::Internal::Type::BaseModel
|
|
7
|
+
attr_accessor id: String
|
|
8
|
+
|
|
9
|
+
attr_accessor template_id: String
|
|
10
|
+
|
|
11
|
+
attr_accessor weight: Float
|
|
12
|
+
|
|
13
|
+
attr_reader name: String?
|
|
14
|
+
|
|
15
|
+
def name=: (String) -> String
|
|
16
|
+
|
|
17
|
+
def initialize: (
|
|
18
|
+
id: String,
|
|
19
|
+
template_id: String,
|
|
20
|
+
weight: Float,
|
|
21
|
+
?name: String
|
|
22
|
+
) -> void
|
|
23
|
+
|
|
24
|
+
def to_hash: -> {
|
|
25
|
+
id: String,
|
|
26
|
+
template_id: String,
|
|
27
|
+
weight: Float,
|
|
28
|
+
name: String
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -5,7 +5,8 @@ module Courier
|
|
|
5
5
|
message: Courier::JourneySendNode::Message,
|
|
6
6
|
type: Courier::Models::JourneySendNode::type_,
|
|
7
7
|
id: String,
|
|
8
|
-
conditions: Courier::Models::journey_conditions_field
|
|
8
|
+
conditions: Courier::Models::journey_conditions_field,
|
|
9
|
+
experiment: Courier::JourneyExperiment
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
class JourneySendNode < Courier::Internal::Type::BaseModel
|
|
@@ -23,31 +24,37 @@ module Courier
|
|
|
23
24
|
Courier::Models::journey_conditions_field
|
|
24
25
|
) -> Courier::Models::journey_conditions_field
|
|
25
26
|
|
|
27
|
+
attr_reader experiment: Courier::JourneyExperiment?
|
|
28
|
+
|
|
29
|
+
def experiment=: (
|
|
30
|
+
Courier::JourneyExperiment
|
|
31
|
+
) -> Courier::JourneyExperiment
|
|
32
|
+
|
|
26
33
|
def initialize: (
|
|
27
34
|
message: Courier::JourneySendNode::Message,
|
|
28
35
|
type: Courier::Models::JourneySendNode::type_,
|
|
29
36
|
?id: String,
|
|
30
|
-
?conditions: Courier::Models::journey_conditions_field
|
|
37
|
+
?conditions: Courier::Models::journey_conditions_field,
|
|
38
|
+
?experiment: Courier::JourneyExperiment
|
|
31
39
|
) -> void
|
|
32
40
|
|
|
33
41
|
def to_hash: -> {
|
|
34
42
|
message: Courier::JourneySendNode::Message,
|
|
35
43
|
type: Courier::Models::JourneySendNode::type_,
|
|
36
44
|
id: String,
|
|
37
|
-
conditions: Courier::Models::journey_conditions_field
|
|
45
|
+
conditions: Courier::Models::journey_conditions_field,
|
|
46
|
+
experiment: Courier::JourneyExperiment
|
|
38
47
|
}
|
|
39
48
|
|
|
40
49
|
type message =
|
|
41
50
|
{
|
|
42
|
-
template: String,
|
|
43
51
|
data: ::Hash[Symbol, top],
|
|
44
52
|
delay: Courier::JourneySendNode::Message::Delay,
|
|
53
|
+
template: String,
|
|
45
54
|
to: Courier::JourneySendNode::Message::To
|
|
46
55
|
}
|
|
47
56
|
|
|
48
57
|
class Message < Courier::Internal::Type::BaseModel
|
|
49
|
-
attr_accessor template: String
|
|
50
|
-
|
|
51
58
|
attr_reader data: ::Hash[Symbol, top]?
|
|
52
59
|
|
|
53
60
|
def data=: (::Hash[Symbol, top]) -> ::Hash[Symbol, top]
|
|
@@ -58,6 +65,10 @@ module Courier
|
|
|
58
65
|
Courier::JourneySendNode::Message::Delay
|
|
59
66
|
) -> Courier::JourneySendNode::Message::Delay
|
|
60
67
|
|
|
68
|
+
attr_reader template: String?
|
|
69
|
+
|
|
70
|
+
def template=: (String) -> String
|
|
71
|
+
|
|
61
72
|
attr_reader to: Courier::JourneySendNode::Message::To?
|
|
62
73
|
|
|
63
74
|
def to=: (
|
|
@@ -65,16 +76,16 @@ module Courier
|
|
|
65
76
|
) -> Courier::JourneySendNode::Message::To
|
|
66
77
|
|
|
67
78
|
def initialize: (
|
|
68
|
-
template: String,
|
|
69
79
|
?data: ::Hash[Symbol, top],
|
|
70
80
|
?delay: Courier::JourneySendNode::Message::Delay,
|
|
81
|
+
?template: String,
|
|
71
82
|
?to: Courier::JourneySendNode::Message::To
|
|
72
83
|
) -> void
|
|
73
84
|
|
|
74
85
|
def to_hash: -> {
|
|
75
|
-
template: String,
|
|
76
86
|
data: ::Hash[Symbol, top],
|
|
77
87
|
delay: Courier::JourneySendNode::Message::Delay,
|
|
88
|
+
template: String,
|
|
78
89
|
to: Courier::JourneySendNode::Message::To
|
|
79
90
|
}
|
|
80
91
|
|
data/sig/courier/models.rbs
CHANGED
|
@@ -83,6 +83,10 @@ module Courier
|
|
|
83
83
|
|
|
84
84
|
class BulkRunJobParams = Courier::Models::BulkRunJobParams
|
|
85
85
|
|
|
86
|
+
module CancelJourneyRequest = Courier::Models::CancelJourneyRequest
|
|
87
|
+
|
|
88
|
+
module CancelJourneyResponse = Courier::Models::CancelJourneyResponse
|
|
89
|
+
|
|
86
90
|
class Channel = Courier::Models::Channel
|
|
87
91
|
|
|
88
92
|
module ChannelClassification = Courier::Models::ChannelClassification
|
|
@@ -167,6 +171,8 @@ module Courier
|
|
|
167
171
|
|
|
168
172
|
class JourneyArchiveParams = Courier::Models::JourneyArchiveParams
|
|
169
173
|
|
|
174
|
+
class JourneyCancelParams = Courier::Models::JourneyCancelParams
|
|
175
|
+
|
|
170
176
|
JourneyConditionAtom: Courier::Internal::Type::Converter
|
|
171
177
|
|
|
172
178
|
class JourneyConditionGroup = Courier::Models::JourneyConditionGroup
|
|
@@ -183,6 +189,10 @@ module Courier
|
|
|
183
189
|
|
|
184
190
|
class JourneyExitNode = Courier::Models::JourneyExitNode
|
|
185
191
|
|
|
192
|
+
class JourneyExperiment = Courier::Models::JourneyExperiment
|
|
193
|
+
|
|
194
|
+
class JourneyExperimentVariant = Courier::Models::JourneyExperimentVariant
|
|
195
|
+
|
|
186
196
|
class JourneyFetchGetDeleteNode = Courier::Models::JourneyFetchGetDeleteNode
|
|
187
197
|
|
|
188
198
|
class JourneyFetchPostPutNode = Courier::Models::JourneyFetchPostPutNode
|
|
@@ -28,6 +28,11 @@ module Courier
|
|
|
28
28
|
?request_options: Courier::request_opts
|
|
29
29
|
) -> nil
|
|
30
30
|
|
|
31
|
+
def cancel: (
|
|
32
|
+
cancel_journey_request: Courier::Models::cancel_journey_request,
|
|
33
|
+
?request_options: Courier::request_opts
|
|
34
|
+
) -> Courier::Models::cancel_journey_response
|
|
35
|
+
|
|
31
36
|
def invoke: (
|
|
32
37
|
String template_id,
|
|
33
38
|
?data: ::Hash[Symbol, top],
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trycourier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.18.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Courier
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06
|
|
11
|
+
date: 2026-07-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: cgi
|
|
@@ -121,6 +121,8 @@ files:
|
|
|
121
121
|
- lib/courier/models/bulk_retrieve_job_params.rb
|
|
122
122
|
- lib/courier/models/bulk_retrieve_job_response.rb
|
|
123
123
|
- lib/courier/models/bulk_run_job_params.rb
|
|
124
|
+
- lib/courier/models/cancel_journey_request.rb
|
|
125
|
+
- lib/courier/models/cancel_journey_response.rb
|
|
124
126
|
- lib/courier/models/channel.rb
|
|
125
127
|
- lib/courier/models/channel_classification.rb
|
|
126
128
|
- lib/courier/models/channel_metadata.rb
|
|
@@ -165,6 +167,7 @@ files:
|
|
|
165
167
|
- lib/courier/models/journey_ai_node.rb
|
|
166
168
|
- lib/courier/models/journey_api_invoke_trigger_node.rb
|
|
167
169
|
- lib/courier/models/journey_archive_params.rb
|
|
170
|
+
- lib/courier/models/journey_cancel_params.rb
|
|
168
171
|
- lib/courier/models/journey_condition_atom.rb
|
|
169
172
|
- lib/courier/models/journey_condition_group.rb
|
|
170
173
|
- lib/courier/models/journey_condition_nested_group.rb
|
|
@@ -173,6 +176,8 @@ files:
|
|
|
173
176
|
- lib/courier/models/journey_delay_duration_node.rb
|
|
174
177
|
- lib/courier/models/journey_delay_until_node.rb
|
|
175
178
|
- lib/courier/models/journey_exit_node.rb
|
|
179
|
+
- lib/courier/models/journey_experiment.rb
|
|
180
|
+
- lib/courier/models/journey_experiment_variant.rb
|
|
176
181
|
- lib/courier/models/journey_fetch_get_delete_node.rb
|
|
177
182
|
- lib/courier/models/journey_fetch_post_put_node.rb
|
|
178
183
|
- lib/courier/models/journey_invoke_params.rb
|
|
@@ -537,6 +542,8 @@ files:
|
|
|
537
542
|
- rbi/courier/models/bulk_retrieve_job_params.rbi
|
|
538
543
|
- rbi/courier/models/bulk_retrieve_job_response.rbi
|
|
539
544
|
- rbi/courier/models/bulk_run_job_params.rbi
|
|
545
|
+
- rbi/courier/models/cancel_journey_request.rbi
|
|
546
|
+
- rbi/courier/models/cancel_journey_response.rbi
|
|
540
547
|
- rbi/courier/models/channel.rbi
|
|
541
548
|
- rbi/courier/models/channel_classification.rbi
|
|
542
549
|
- rbi/courier/models/channel_metadata.rbi
|
|
@@ -581,6 +588,7 @@ files:
|
|
|
581
588
|
- rbi/courier/models/journey_ai_node.rbi
|
|
582
589
|
- rbi/courier/models/journey_api_invoke_trigger_node.rbi
|
|
583
590
|
- rbi/courier/models/journey_archive_params.rbi
|
|
591
|
+
- rbi/courier/models/journey_cancel_params.rbi
|
|
584
592
|
- rbi/courier/models/journey_condition_atom.rbi
|
|
585
593
|
- rbi/courier/models/journey_condition_group.rbi
|
|
586
594
|
- rbi/courier/models/journey_condition_nested_group.rbi
|
|
@@ -589,6 +597,8 @@ files:
|
|
|
589
597
|
- rbi/courier/models/journey_delay_duration_node.rbi
|
|
590
598
|
- rbi/courier/models/journey_delay_until_node.rbi
|
|
591
599
|
- rbi/courier/models/journey_exit_node.rbi
|
|
600
|
+
- rbi/courier/models/journey_experiment.rbi
|
|
601
|
+
- rbi/courier/models/journey_experiment_variant.rbi
|
|
592
602
|
- rbi/courier/models/journey_fetch_get_delete_node.rbi
|
|
593
603
|
- rbi/courier/models/journey_fetch_post_put_node.rbi
|
|
594
604
|
- rbi/courier/models/journey_invoke_params.rbi
|
|
@@ -952,6 +962,8 @@ files:
|
|
|
952
962
|
- sig/courier/models/bulk_retrieve_job_params.rbs
|
|
953
963
|
- sig/courier/models/bulk_retrieve_job_response.rbs
|
|
954
964
|
- sig/courier/models/bulk_run_job_params.rbs
|
|
965
|
+
- sig/courier/models/cancel_journey_request.rbs
|
|
966
|
+
- sig/courier/models/cancel_journey_response.rbs
|
|
955
967
|
- sig/courier/models/channel.rbs
|
|
956
968
|
- sig/courier/models/channel_classification.rbs
|
|
957
969
|
- sig/courier/models/channel_metadata.rbs
|
|
@@ -996,6 +1008,7 @@ files:
|
|
|
996
1008
|
- sig/courier/models/journey_ai_node.rbs
|
|
997
1009
|
- sig/courier/models/journey_api_invoke_trigger_node.rbs
|
|
998
1010
|
- sig/courier/models/journey_archive_params.rbs
|
|
1011
|
+
- sig/courier/models/journey_cancel_params.rbs
|
|
999
1012
|
- sig/courier/models/journey_condition_atom.rbs
|
|
1000
1013
|
- sig/courier/models/journey_condition_group.rbs
|
|
1001
1014
|
- sig/courier/models/journey_condition_nested_group.rbs
|
|
@@ -1004,6 +1017,8 @@ files:
|
|
|
1004
1017
|
- sig/courier/models/journey_delay_duration_node.rbs
|
|
1005
1018
|
- sig/courier/models/journey_delay_until_node.rbs
|
|
1006
1019
|
- sig/courier/models/journey_exit_node.rbs
|
|
1020
|
+
- sig/courier/models/journey_experiment.rbs
|
|
1021
|
+
- sig/courier/models/journey_experiment_variant.rbs
|
|
1007
1022
|
- sig/courier/models/journey_fetch_get_delete_node.rbs
|
|
1008
1023
|
- sig/courier/models/journey_fetch_post_put_node.rbs
|
|
1009
1024
|
- sig/courier/models/journey_invoke_params.rbs
|