trycourier 4.17.1 → 4.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +28 -0
- data/lib/courier/models/audience.rb +5 -3
- data/lib/courier/models/audience_filter_config.rb +29 -1
- data/lib/courier/models/audience_update_params.rb +7 -3
- 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/audiences.rb +1 -1
- 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/audience.rbi +6 -3
- data/rbi/courier/models/audience_filter_config.rbi +54 -5
- data/rbi/courier/models/audience_update_params.rbi +9 -3
- 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/audiences.rbi +3 -1
- data/rbi/courier/resources/journeys.rbi +25 -0
- data/sig/courier/models/audience_filter_config.rbs +30 -3
- 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
|
@@ -31,7 +31,9 @@ module Courier
|
|
|
31
31
|
sig { returns(T.nilable(String)) }
|
|
32
32
|
attr_accessor :name
|
|
33
33
|
|
|
34
|
-
# The logical operator (AND/OR)
|
|
34
|
+
# The logical operator (AND/OR) combining the top-level `filter.filters`.
|
|
35
|
+
# Convenience alias for `filter.operator`: if set, it is applied to the top-level
|
|
36
|
+
# filter group. Prefer setting `operator` directly inside `filter`.
|
|
35
37
|
sig do
|
|
36
38
|
returns(T.nilable(Courier::AudienceUpdateParams::Operator::OrSymbol))
|
|
37
39
|
end
|
|
@@ -56,7 +58,9 @@ module Courier
|
|
|
56
58
|
filter: nil,
|
|
57
59
|
# The name of the audience
|
|
58
60
|
name: nil,
|
|
59
|
-
# The logical operator (AND/OR)
|
|
61
|
+
# The logical operator (AND/OR) combining the top-level `filter.filters`.
|
|
62
|
+
# Convenience alias for `filter.operator`: if set, it is applied to the top-level
|
|
63
|
+
# filter group. Prefer setting `operator` directly inside `filter`.
|
|
60
64
|
operator: nil,
|
|
61
65
|
request_options: {}
|
|
62
66
|
)
|
|
@@ -78,7 +82,9 @@ module Courier
|
|
|
78
82
|
def to_hash
|
|
79
83
|
end
|
|
80
84
|
|
|
81
|
-
# The logical operator (AND/OR)
|
|
85
|
+
# The logical operator (AND/OR) combining the top-level `filter.filters`.
|
|
86
|
+
# Convenience alias for `filter.operator`: if set, it is applied to the top-level
|
|
87
|
+
# filter group. Prefer setting `operator` directly inside `filter`.
|
|
82
88
|
module Operator
|
|
83
89
|
extend Courier::Internal::Type::Enum
|
|
84
90
|
|
|
@@ -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
|
|
@@ -38,7 +38,9 @@ module Courier
|
|
|
38
38
|
filter: nil,
|
|
39
39
|
# The name of the audience
|
|
40
40
|
name: nil,
|
|
41
|
-
# The logical operator (AND/OR)
|
|
41
|
+
# The logical operator (AND/OR) combining the top-level `filter.filters`.
|
|
42
|
+
# Convenience alias for `filter.operator`: if set, it is applied to the top-level
|
|
43
|
+
# filter group. Prefer setting `operator` directly inside `filter`.
|
|
42
44
|
operator: nil,
|
|
43
45
|
request_options: {}
|
|
44
46
|
)
|
|
@@ -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
|
|
@@ -1,13 +1,40 @@
|
|
|
1
1
|
module Courier
|
|
2
2
|
module Models
|
|
3
|
-
type audience_filter_config =
|
|
3
|
+
type audience_filter_config =
|
|
4
|
+
{
|
|
5
|
+
filters: ::Array[Courier::FilterConfig],
|
|
6
|
+
operator: Courier::Models::AudienceFilterConfig::operator
|
|
7
|
+
}
|
|
4
8
|
|
|
5
9
|
class AudienceFilterConfig < Courier::Internal::Type::BaseModel
|
|
6
10
|
attr_accessor filters: ::Array[Courier::FilterConfig]
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
attr_reader operator: Courier::Models::AudienceFilterConfig::operator?
|
|
9
13
|
|
|
10
|
-
def
|
|
14
|
+
def operator=: (
|
|
15
|
+
Courier::Models::AudienceFilterConfig::operator
|
|
16
|
+
) -> Courier::Models::AudienceFilterConfig::operator
|
|
17
|
+
|
|
18
|
+
def initialize: (
|
|
19
|
+
filters: ::Array[Courier::FilterConfig],
|
|
20
|
+
?operator: Courier::Models::AudienceFilterConfig::operator
|
|
21
|
+
) -> void
|
|
22
|
+
|
|
23
|
+
def to_hash: -> {
|
|
24
|
+
filters: ::Array[Courier::FilterConfig],
|
|
25
|
+
operator: Courier::Models::AudienceFilterConfig::operator
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type operator = :AND | :OR
|
|
29
|
+
|
|
30
|
+
module Operator
|
|
31
|
+
extend Courier::Internal::Type::Enum
|
|
32
|
+
|
|
33
|
+
AND: :AND
|
|
34
|
+
OR: :OR
|
|
35
|
+
|
|
36
|
+
def self?.values: -> ::Array[Courier::Models::AudienceFilterConfig::operator]
|
|
37
|
+
end
|
|
11
38
|
end
|
|
12
39
|
end
|
|
13
40
|
end
|
|
@@ -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
|