trycourier 4.11.0 → 4.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 07ec887deae40e31444ee6401c3b00061e0bbc4156700f5ff1361e1366fab649
4
- data.tar.gz: 9167f8538d2652a8cd9e6723ab309f331f7487e1a96f69fa72abea27e4d76c25
3
+ metadata.gz: e902cf56c5a1bbfd1efeb490133b4cbbd036913b9565d146a4e2a61cf016561e
4
+ data.tar.gz: d8776360739874f39e33d8ce8a2161910808db4a0dbcc2062c8054ad6a840ee2
5
5
  SHA512:
6
- metadata.gz: bdd2bb582d89b2d3c4ebaa5f7d2c70a6cfb72ca9c2288322cb4ce8d21f14deafe67e6546a1d1dd7b007910e5b1fcff183b41336a6ac11fe7eee3706b2104e415
7
- data.tar.gz: 98365664a918844655cd990b7195323dc6c60185b5efcaf9a667e12a81d40ec35fc426fbdd98920cfc6f34299101c8b7d6e7e27b1f765698158260ab94c3fa42
6
+ metadata.gz: 9e25bc1935feedf5a3779307ebd3405b64dd491ba0cec9d0df81b68d4f9707fc0b019979a3933e53e68715b419debed4ea7b9c8553312983ee495a95ef82ca5b
7
+ data.tar.gz: a611de89bb3b2907b6b3997a9b0815c9fd9e4558005046c77ed59eb05ccf21b1898a06856913c606767337b67f1296531e2e66212f6785fb0f002e0d839b13de
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.12.0 (2026-05-28)
4
+
5
+ Full Changelog: [v4.11.0...v4.12.0](https://github.com/trycourier/courier-ruby/compare/v4.11.0...v4.12.0)
6
+
7
+ ### Features
8
+
9
+ * C-18612 Add Journeys `batch` node variant to OpenAPI spec ([046a5de](https://github.com/trycourier/courier-ruby/commit/046a5de8a353a40c44f3901313151bf62105c19c))
10
+ * Mark `settings` as required on POST /brands ([72fb020](https://github.com/trycourier/courier-ruby/commit/72fb020cc45f9c4b5384d7492fb8908ac3e82379))
11
+
3
12
  ## 4.11.0 (2026-05-19)
4
13
 
5
14
  Full Changelog: [v4.10.2...v4.11.0](https://github.com/trycourier/courier-ruby/compare/v4.10.2...v4.11.0)
@@ -12,25 +12,25 @@ module Courier
12
12
  # @return [String]
13
13
  required :name, String
14
14
 
15
+ # @!attribute settings
16
+ #
17
+ # @return [Courier::Models::BrandSettings]
18
+ required :settings, -> { Courier::BrandSettings }
19
+
15
20
  # @!attribute id
16
21
  #
17
22
  # @return [String, nil]
18
23
  optional :id, String, nil?: true
19
24
 
20
- # @!attribute settings
21
- #
22
- # @return [Courier::Models::BrandSettings, nil]
23
- optional :settings, -> { Courier::BrandSettings }, nil?: true
24
-
25
25
  # @!attribute snippets
26
26
  #
27
27
  # @return [Courier::Models::BrandSnippets, nil]
28
28
  optional :snippets, -> { Courier::BrandSnippets }, nil?: true
29
29
 
30
- # @!method initialize(name:, id: nil, settings: nil, snippets: nil, request_options: {})
30
+ # @!method initialize(name:, settings:, id: nil, snippets: nil, request_options: {})
31
31
  # @param name [String]
32
+ # @param settings [Courier::Models::BrandSettings]
32
33
  # @param id [String, nil]
33
- # @param settings [Courier::Models::BrandSettings, nil]
34
34
  # @param snippets [Courier::Models::BrandSnippets, nil]
35
35
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
36
36
  end
@@ -10,7 +10,7 @@ module Courier
10
10
 
11
11
  # @!attribute nodes
12
12
  #
13
- # @return [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
13
+ # @return [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
14
14
  required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
15
15
 
16
16
  # @!attribute enabled
@@ -29,7 +29,7 @@ module Courier
29
29
  #
30
30
  # @param name [String]
31
31
  #
32
- # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
32
+ # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
33
33
  #
34
34
  # @param enabled [Boolean]
35
35
  #
@@ -38,12 +38,168 @@ module Courier
38
38
  # Throttle the journey by a dynamic `throttle_key`, allowing at most `max_allowed` invocations per `period`.
39
39
  variant -> { Courier::JourneyThrottleDynamicNode }
40
40
 
41
+ # Collect events arriving at the node into a single batch and fire one downstream step with the aggregated payload. The first event into a batch owns the run; later contributing events terminate at the batch step. The batch releases when any of `max_items` is reached, a quiet window of `wait_period` elapses, or the `max_wait_period` ceiling hits.
42
+ variant -> { Courier::JourneyNode::JourneyBatchNode }
43
+
41
44
  # Terminate the journey run.
42
45
  variant -> { Courier::JourneyExitNode }
43
46
 
44
47
  # Branch node. Routes to the first entry in `paths[]` whose `conditions` match, else falls through to `default.nodes`.
45
48
  variant -> { Courier::JourneyNode::JourneyBranchNode }
46
49
 
50
+ class JourneyBatchNode < Courier::Internal::Type::BaseModel
51
+ # @!attribute max_wait_period
52
+ # ISO 8601 duration. Hard ceiling from the first event into the batch; releases
53
+ # the batch unconditionally when it elapses.
54
+ #
55
+ # @return [String]
56
+ required :max_wait_period, String
57
+
58
+ # @!attribute retain
59
+ # How to select which collected events to retain in the aggregated payload when
60
+ # the batch releases.
61
+ #
62
+ # @return [Courier::Models::JourneyNode::JourneyBatchNode::Retain]
63
+ required :retain, -> { Courier::JourneyNode::JourneyBatchNode::Retain }
64
+
65
+ # @!attribute scope
66
+ #
67
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Scope]
68
+ required :scope, enum: -> { Courier::JourneyNode::JourneyBatchNode::Scope }
69
+
70
+ # @!attribute type
71
+ #
72
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Type]
73
+ required :type, enum: -> { Courier::JourneyNode::JourneyBatchNode::Type }
74
+
75
+ # @!attribute wait_period
76
+ # ISO 8601 duration. Quiet window that releases the batch when it elapses with no
77
+ # new contributing events. Must be less than `max_wait_period`.
78
+ #
79
+ # @return [String]
80
+ required :wait_period, String
81
+
82
+ # @!attribute id
83
+ #
84
+ # @return [String, nil]
85
+ optional :id, String
86
+
87
+ # @!attribute category_key
88
+ # Optional partition key. Events with the same `category_key` are batched
89
+ # together; events with different values are batched separately.
90
+ #
91
+ # @return [String, nil]
92
+ optional :category_key, String
93
+
94
+ # @!attribute conditions
95
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
96
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
97
+ # express "no conditions".
98
+ #
99
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
100
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
101
+
102
+ # @!attribute max_items
103
+ # Releases the batch once this many events have been collected.
104
+ #
105
+ # @return [Integer, nil]
106
+ optional :max_items, Integer
107
+
108
+ # @!method initialize(max_wait_period:, retain:, scope:, type:, wait_period:, id: nil, category_key: nil, conditions: nil, max_items: nil)
109
+ # Some parameter documentations has been truncated, see
110
+ # {Courier::Models::JourneyNode::JourneyBatchNode} for more details.
111
+ #
112
+ # Collect events arriving at the node into a single batch and fire one downstream
113
+ # step with the aggregated payload. The first event into a batch owns the run;
114
+ # later contributing events terminate at the batch step. The batch releases when
115
+ # any of `max_items` is reached, a quiet window of `wait_period` elapses, or the
116
+ # `max_wait_period` ceiling hits.
117
+ #
118
+ # @param max_wait_period [String] ISO 8601 duration. Hard ceiling from the first event into the batch; releases th
119
+ #
120
+ # @param retain [Courier::Models::JourneyNode::JourneyBatchNode::Retain] How to select which collected events to retain in the aggregated payload when th
121
+ #
122
+ # @param scope [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Scope]
123
+ #
124
+ # @param type [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Type]
125
+ #
126
+ # @param wait_period [String] ISO 8601 duration. Quiet window that releases the batch when it elapses with no
127
+ #
128
+ # @param id [String]
129
+ #
130
+ # @param category_key [String] Optional partition key. Events with the same `category_key` are batched together
131
+ #
132
+ # @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
133
+ #
134
+ # @param max_items [Integer] Releases the batch once this many events have been collected.
135
+
136
+ # @see Courier::Models::JourneyNode::JourneyBatchNode#retain
137
+ class Retain < Courier::Internal::Type::BaseModel
138
+ # @!attribute count
139
+ #
140
+ # @return [Integer]
141
+ required :count, Integer
142
+
143
+ # @!attribute type
144
+ #
145
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Retain::Type]
146
+ required :type, enum: -> { Courier::JourneyNode::JourneyBatchNode::Retain::Type }
147
+
148
+ # @!attribute sort_key
149
+ # Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
150
+ # `highest` or `lowest`.
151
+ #
152
+ # @return [String, nil]
153
+ optional :sort_key, String
154
+
155
+ # @!method initialize(count:, type:, sort_key: nil)
156
+ # Some parameter documentations has been truncated, see
157
+ # {Courier::Models::JourneyNode::JourneyBatchNode::Retain} for more details.
158
+ #
159
+ # How to select which collected events to retain in the aggregated payload when
160
+ # the batch releases.
161
+ #
162
+ # @param count [Integer]
163
+ #
164
+ # @param type [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Retain::Type]
165
+ #
166
+ # @param sort_key [String] Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
167
+
168
+ # @see Courier::Models::JourneyNode::JourneyBatchNode::Retain#type
169
+ module Type
170
+ extend Courier::Internal::Type::Enum
171
+
172
+ FIRST = :first
173
+ LAST = :last
174
+ HIGHEST = :highest
175
+ LOWEST = :lowest
176
+
177
+ # @!method self.values
178
+ # @return [Array<Symbol>]
179
+ end
180
+ end
181
+
182
+ # @see Courier::Models::JourneyNode::JourneyBatchNode#scope
183
+ module Scope
184
+ extend Courier::Internal::Type::Enum
185
+
186
+ USER = :user
187
+
188
+ # @!method self.values
189
+ # @return [Array<Symbol>]
190
+ end
191
+
192
+ # @see Courier::Models::JourneyNode::JourneyBatchNode#type
193
+ module Type
194
+ extend Courier::Internal::Type::Enum
195
+
196
+ BATCH = :batch
197
+
198
+ # @!method self.values
199
+ # @return [Array<Symbol>]
200
+ end
201
+ end
202
+
47
203
  class JourneyBranchNode < Courier::Internal::Type::BaseModel
48
204
  # @!attribute default
49
205
  #
@@ -133,7 +289,7 @@ module Courier
133
289
  end
134
290
 
135
291
  # @!method self.variants
136
- # @return [Array(Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode)]
292
+ # @return [Array(Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode)]
137
293
  end
138
294
  end
139
295
  end
@@ -31,7 +31,7 @@ module Courier
31
31
 
32
32
  # @!attribute nodes
33
33
  #
34
- # @return [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
34
+ # @return [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
35
35
  required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
36
36
 
37
37
  # @!attribute published
@@ -68,7 +68,7 @@ module Courier
68
68
  #
69
69
  # @param name [String]
70
70
  #
71
- # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
71
+ # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
72
72
  #
73
73
  # @param published [Integer, nil]
74
74
  #
@@ -3,13 +3,14 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Brands
6
- # Create a new brand
6
+ # Create a new brand. Requires `name` and `settings` (with at least
7
+ # `colors.primary` and `colors.secondary`).
7
8
  #
8
- # @overload create(name:, id: nil, settings: nil, snippets: nil, request_options: {})
9
+ # @overload create(name:, settings:, id: nil, snippets: nil, request_options: {})
9
10
  #
10
11
  # @param name [String]
12
+ # @param settings [Courier::Models::BrandSettings]
11
13
  # @param id [String, nil]
12
- # @param settings [Courier::Models::BrandSettings, nil]
13
14
  # @param snippets [Courier::Models::BrandSnippets, nil]
14
15
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
15
16
  #
@@ -17,7 +17,7 @@ module Courier
17
17
  #
18
18
  # @param name [String]
19
19
  #
20
- # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
20
+ # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
21
21
  #
22
22
  # @param enabled [Boolean]
23
23
  #
@@ -204,7 +204,7 @@ module Courier
204
204
  #
205
205
  # @param name [String]
206
206
  #
207
- # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
207
+ # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
208
208
  #
209
209
  # @param enabled [Boolean]
210
210
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.11.0"
4
+ VERSION = "4.12.0"
5
5
  end
@@ -14,15 +14,15 @@ module Courier
14
14
  sig { returns(String) }
15
15
  attr_accessor :name
16
16
 
17
- sig { returns(T.nilable(String)) }
18
- attr_accessor :id
19
-
20
- sig { returns(T.nilable(Courier::BrandSettings)) }
17
+ sig { returns(Courier::BrandSettings) }
21
18
  attr_reader :settings
22
19
 
23
- sig { params(settings: T.nilable(Courier::BrandSettings::OrHash)).void }
20
+ sig { params(settings: Courier::BrandSettings::OrHash).void }
24
21
  attr_writer :settings
25
22
 
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :id
25
+
26
26
  sig { returns(T.nilable(Courier::BrandSnippets)) }
27
27
  attr_reader :snippets
28
28
 
@@ -32,16 +32,16 @@ module Courier
32
32
  sig do
33
33
  params(
34
34
  name: String,
35
+ settings: Courier::BrandSettings::OrHash,
35
36
  id: T.nilable(String),
36
- settings: T.nilable(Courier::BrandSettings::OrHash),
37
37
  snippets: T.nilable(Courier::BrandSnippets::OrHash),
38
38
  request_options: Courier::RequestOptions::OrHash
39
39
  ).returns(T.attached_class)
40
40
  end
41
41
  def self.new(
42
42
  name:,
43
+ settings:,
43
44
  id: nil,
44
- settings: nil,
45
45
  snippets: nil,
46
46
  request_options: {}
47
47
  )
@@ -51,8 +51,8 @@ module Courier
51
51
  override.returns(
52
52
  {
53
53
  name: String,
54
+ settings: Courier::BrandSettings,
54
55
  id: T.nilable(String),
55
- settings: T.nilable(Courier::BrandSettings),
56
56
  snippets: T.nilable(Courier::BrandSnippets),
57
57
  request_options: Courier::RequestOptions
58
58
  }
@@ -25,6 +25,7 @@ module Courier
25
25
  Courier::JourneyAINode,
26
26
  Courier::JourneyThrottleStaticNode,
27
27
  Courier::JourneyThrottleDynamicNode,
28
+ Courier::JourneyNode::JourneyBatchNode,
28
29
  Courier::JourneyExitNode,
29
30
  Courier::JourneyNode::JourneyBranchNode
30
31
  )
@@ -63,6 +64,7 @@ module Courier
63
64
  Courier::JourneyAINode::OrHash,
64
65
  Courier::JourneyThrottleStaticNode::OrHash,
65
66
  Courier::JourneyThrottleDynamicNode::OrHash,
67
+ Courier::JourneyNode::JourneyBatchNode::OrHash,
66
68
  Courier::JourneyExitNode::OrHash,
67
69
  Courier::JourneyNode::JourneyBranchNode::OrHash
68
70
  )
@@ -97,6 +99,7 @@ module Courier
97
99
  Courier::JourneyAINode,
98
100
  Courier::JourneyThrottleStaticNode,
99
101
  Courier::JourneyThrottleDynamicNode,
102
+ Courier::JourneyNode::JourneyBatchNode,
100
103
  Courier::JourneyExitNode,
101
104
  Courier::JourneyNode::JourneyBranchNode
102
105
  )
@@ -21,11 +21,326 @@ module Courier
21
21
  Courier::JourneyAINode,
22
22
  Courier::JourneyThrottleStaticNode,
23
23
  Courier::JourneyThrottleDynamicNode,
24
+ Courier::JourneyNode::JourneyBatchNode,
24
25
  Courier::JourneyExitNode,
25
26
  Courier::JourneyNode::JourneyBranchNode
26
27
  )
27
28
  end
28
29
 
30
+ class JourneyBatchNode < Courier::Internal::Type::BaseModel
31
+ OrHash =
32
+ T.type_alias do
33
+ T.any(
34
+ Courier::JourneyNode::JourneyBatchNode,
35
+ Courier::Internal::AnyHash
36
+ )
37
+ end
38
+
39
+ # ISO 8601 duration. Hard ceiling from the first event into the batch; releases
40
+ # the batch unconditionally when it elapses.
41
+ sig { returns(String) }
42
+ attr_accessor :max_wait_period
43
+
44
+ # How to select which collected events to retain in the aggregated payload when
45
+ # the batch releases.
46
+ sig { returns(Courier::JourneyNode::JourneyBatchNode::Retain) }
47
+ attr_reader :retain
48
+
49
+ sig do
50
+ params(
51
+ retain: Courier::JourneyNode::JourneyBatchNode::Retain::OrHash
52
+ ).void
53
+ end
54
+ attr_writer :retain
55
+
56
+ sig { returns(Courier::JourneyNode::JourneyBatchNode::Scope::OrSymbol) }
57
+ attr_accessor :scope
58
+
59
+ sig { returns(Courier::JourneyNode::JourneyBatchNode::Type::OrSymbol) }
60
+ attr_accessor :type
61
+
62
+ # ISO 8601 duration. Quiet window that releases the batch when it elapses with no
63
+ # new contributing events. Must be less than `max_wait_period`.
64
+ sig { returns(String) }
65
+ attr_accessor :wait_period
66
+
67
+ sig { returns(T.nilable(String)) }
68
+ attr_reader :id
69
+
70
+ sig { params(id: String).void }
71
+ attr_writer :id
72
+
73
+ # Optional partition key. Events with the same `category_key` are batched
74
+ # together; events with different values are batched separately.
75
+ sig { returns(T.nilable(String)) }
76
+ attr_reader :category_key
77
+
78
+ sig { params(category_key: String).void }
79
+ attr_writer :category_key
80
+
81
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
82
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
83
+ # express "no conditions".
84
+ sig do
85
+ returns(
86
+ T.nilable(
87
+ T.any(
88
+ T::Array[String],
89
+ Courier::JourneyConditionGroup,
90
+ Courier::JourneyConditionNestedGroup
91
+ )
92
+ )
93
+ )
94
+ end
95
+ attr_reader :conditions
96
+
97
+ sig do
98
+ params(
99
+ conditions:
100
+ T.any(
101
+ T::Array[String],
102
+ Courier::JourneyConditionGroup::OrHash,
103
+ Courier::JourneyConditionNestedGroup::OrHash
104
+ )
105
+ ).void
106
+ end
107
+ attr_writer :conditions
108
+
109
+ # Releases the batch once this many events have been collected.
110
+ sig { returns(T.nilable(Integer)) }
111
+ attr_reader :max_items
112
+
113
+ sig { params(max_items: Integer).void }
114
+ attr_writer :max_items
115
+
116
+ # Collect events arriving at the node into a single batch and fire one downstream
117
+ # step with the aggregated payload. The first event into a batch owns the run;
118
+ # later contributing events terminate at the batch step. The batch releases when
119
+ # any of `max_items` is reached, a quiet window of `wait_period` elapses, or the
120
+ # `max_wait_period` ceiling hits.
121
+ sig do
122
+ params(
123
+ max_wait_period: String,
124
+ retain: Courier::JourneyNode::JourneyBatchNode::Retain::OrHash,
125
+ scope: Courier::JourneyNode::JourneyBatchNode::Scope::OrSymbol,
126
+ type: Courier::JourneyNode::JourneyBatchNode::Type::OrSymbol,
127
+ wait_period: String,
128
+ id: String,
129
+ category_key: String,
130
+ conditions:
131
+ T.any(
132
+ T::Array[String],
133
+ Courier::JourneyConditionGroup::OrHash,
134
+ Courier::JourneyConditionNestedGroup::OrHash
135
+ ),
136
+ max_items: Integer
137
+ ).returns(T.attached_class)
138
+ end
139
+ def self.new(
140
+ # ISO 8601 duration. Hard ceiling from the first event into the batch; releases
141
+ # the batch unconditionally when it elapses.
142
+ max_wait_period:,
143
+ # How to select which collected events to retain in the aggregated payload when
144
+ # the batch releases.
145
+ retain:,
146
+ scope:,
147
+ type:,
148
+ # ISO 8601 duration. Quiet window that releases the batch when it elapses with no
149
+ # new contributing events. Must be less than `max_wait_period`.
150
+ wait_period:,
151
+ id: nil,
152
+ # Optional partition key. Events with the same `category_key` are batched
153
+ # together; events with different values are batched separately.
154
+ category_key: nil,
155
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
156
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
157
+ # express "no conditions".
158
+ conditions: nil,
159
+ # Releases the batch once this many events have been collected.
160
+ max_items: nil
161
+ )
162
+ end
163
+
164
+ sig do
165
+ override.returns(
166
+ {
167
+ max_wait_period: String,
168
+ retain: Courier::JourneyNode::JourneyBatchNode::Retain,
169
+ scope: Courier::JourneyNode::JourneyBatchNode::Scope::OrSymbol,
170
+ type: Courier::JourneyNode::JourneyBatchNode::Type::OrSymbol,
171
+ wait_period: String,
172
+ id: String,
173
+ category_key: String,
174
+ conditions:
175
+ T.any(
176
+ T::Array[String],
177
+ Courier::JourneyConditionGroup,
178
+ Courier::JourneyConditionNestedGroup
179
+ ),
180
+ max_items: Integer
181
+ }
182
+ )
183
+ end
184
+ def to_hash
185
+ end
186
+
187
+ class Retain < Courier::Internal::Type::BaseModel
188
+ OrHash =
189
+ T.type_alias do
190
+ T.any(
191
+ Courier::JourneyNode::JourneyBatchNode::Retain,
192
+ Courier::Internal::AnyHash
193
+ )
194
+ end
195
+
196
+ sig { returns(Integer) }
197
+ attr_accessor :count
198
+
199
+ sig do
200
+ returns(
201
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::OrSymbol
202
+ )
203
+ end
204
+ attr_accessor :type
205
+
206
+ # Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
207
+ # `highest` or `lowest`.
208
+ sig { returns(T.nilable(String)) }
209
+ attr_reader :sort_key
210
+
211
+ sig { params(sort_key: String).void }
212
+ attr_writer :sort_key
213
+
214
+ # How to select which collected events to retain in the aggregated payload when
215
+ # the batch releases.
216
+ sig do
217
+ params(
218
+ count: Integer,
219
+ type:
220
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::OrSymbol,
221
+ sort_key: String
222
+ ).returns(T.attached_class)
223
+ end
224
+ def self.new(
225
+ count:,
226
+ type:,
227
+ # Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
228
+ # `highest` or `lowest`.
229
+ sort_key: nil
230
+ )
231
+ end
232
+
233
+ sig do
234
+ override.returns(
235
+ {
236
+ count: Integer,
237
+ type:
238
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::OrSymbol,
239
+ sort_key: String
240
+ }
241
+ )
242
+ end
243
+ def to_hash
244
+ end
245
+
246
+ module Type
247
+ extend Courier::Internal::Type::Enum
248
+
249
+ TaggedSymbol =
250
+ T.type_alias do
251
+ T.all(
252
+ Symbol,
253
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type
254
+ )
255
+ end
256
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
257
+
258
+ FIRST =
259
+ T.let(
260
+ :first,
261
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::TaggedSymbol
262
+ )
263
+ LAST =
264
+ T.let(
265
+ :last,
266
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::TaggedSymbol
267
+ )
268
+ HIGHEST =
269
+ T.let(
270
+ :highest,
271
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::TaggedSymbol
272
+ )
273
+ LOWEST =
274
+ T.let(
275
+ :lowest,
276
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::TaggedSymbol
277
+ )
278
+
279
+ sig do
280
+ override.returns(
281
+ T::Array[
282
+ Courier::JourneyNode::JourneyBatchNode::Retain::Type::TaggedSymbol
283
+ ]
284
+ )
285
+ end
286
+ def self.values
287
+ end
288
+ end
289
+ end
290
+
291
+ module Scope
292
+ extend Courier::Internal::Type::Enum
293
+
294
+ TaggedSymbol =
295
+ T.type_alias do
296
+ T.all(Symbol, Courier::JourneyNode::JourneyBatchNode::Scope)
297
+ end
298
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
299
+
300
+ USER =
301
+ T.let(
302
+ :user,
303
+ Courier::JourneyNode::JourneyBatchNode::Scope::TaggedSymbol
304
+ )
305
+
306
+ sig do
307
+ override.returns(
308
+ T::Array[
309
+ Courier::JourneyNode::JourneyBatchNode::Scope::TaggedSymbol
310
+ ]
311
+ )
312
+ end
313
+ def self.values
314
+ end
315
+ end
316
+
317
+ module Type
318
+ extend Courier::Internal::Type::Enum
319
+
320
+ TaggedSymbol =
321
+ T.type_alias do
322
+ T.all(Symbol, Courier::JourneyNode::JourneyBatchNode::Type)
323
+ end
324
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
325
+
326
+ BATCH =
327
+ T.let(
328
+ :batch,
329
+ Courier::JourneyNode::JourneyBatchNode::Type::TaggedSymbol
330
+ )
331
+
332
+ sig do
333
+ override.returns(
334
+ T::Array[
335
+ Courier::JourneyNode::JourneyBatchNode::Type::TaggedSymbol
336
+ ]
337
+ )
338
+ end
339
+ def self.values
340
+ end
341
+ end
342
+ end
343
+
29
344
  class JourneyBranchNode < Courier::Internal::Type::BaseModel
30
345
  OrHash =
31
346
  T.type_alias do
@@ -60,6 +60,7 @@ module Courier
60
60
  Courier::JourneyAINode::OrHash,
61
61
  Courier::JourneyThrottleStaticNode::OrHash,
62
62
  Courier::JourneyThrottleDynamicNode::OrHash,
63
+ Courier::JourneyNode::JourneyBatchNode::OrHash,
63
64
  Courier::JourneyExitNode::OrHash,
64
65
  Courier::JourneyNode::JourneyBranchNode::OrHash
65
66
  )
@@ -3,23 +3,18 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Brands
6
- # Create a new brand
6
+ # Create a new brand. Requires `name` and `settings` (with at least
7
+ # `colors.primary` and `colors.secondary`).
7
8
  sig do
8
9
  params(
9
10
  name: String,
11
+ settings: Courier::BrandSettings::OrHash,
10
12
  id: T.nilable(String),
11
- settings: T.nilable(Courier::BrandSettings::OrHash),
12
13
  snippets: T.nilable(Courier::BrandSnippets::OrHash),
13
14
  request_options: Courier::RequestOptions::OrHash
14
15
  ).returns(Courier::Brand)
15
16
  end
16
- def create(
17
- name:,
18
- id: nil,
19
- settings: nil,
20
- snippets: nil,
21
- request_options: {}
22
- )
17
+ def create(name:, settings:, id: nil, snippets: nil, request_options: {})
23
18
  end
24
19
 
25
20
  # Fetch a specific brand by brand ID.
@@ -28,6 +28,7 @@ module Courier
28
28
  Courier::JourneyAINode::OrHash,
29
29
  Courier::JourneyThrottleStaticNode::OrHash,
30
30
  Courier::JourneyThrottleDynamicNode::OrHash,
31
+ Courier::JourneyNode::JourneyBatchNode::OrHash,
31
32
  Courier::JourneyExitNode::OrHash,
32
33
  Courier::JourneyNode::JourneyBranchNode::OrHash
33
34
  )
@@ -187,6 +188,7 @@ module Courier
187
188
  Courier::JourneyAINode::OrHash,
188
189
  Courier::JourneyThrottleStaticNode::OrHash,
189
190
  Courier::JourneyThrottleDynamicNode::OrHash,
191
+ Courier::JourneyNode::JourneyBatchNode::OrHash,
190
192
  Courier::JourneyExitNode::OrHash,
191
193
  Courier::JourneyNode::JourneyBranchNode::OrHash
192
194
  )
@@ -3,8 +3,8 @@ module Courier
3
3
  type brand_create_params =
4
4
  {
5
5
  name: String,
6
+ settings: Courier::BrandSettings,
6
7
  id: String?,
7
- settings: Courier::BrandSettings?,
8
8
  snippets: Courier::BrandSnippets?
9
9
  }
10
10
  & Courier::Internal::Type::request_parameters
@@ -15,24 +15,24 @@ module Courier
15
15
 
16
16
  attr_accessor name: String
17
17
 
18
- attr_accessor id: String?
18
+ attr_accessor settings: Courier::BrandSettings
19
19
 
20
- attr_accessor settings: Courier::BrandSettings?
20
+ attr_accessor id: String?
21
21
 
22
22
  attr_accessor snippets: Courier::BrandSnippets?
23
23
 
24
24
  def initialize: (
25
25
  name: String,
26
+ settings: Courier::BrandSettings,
26
27
  ?id: String?,
27
- ?settings: Courier::BrandSettings?,
28
28
  ?snippets: Courier::BrandSnippets?,
29
29
  ?request_options: Courier::request_opts
30
30
  ) -> void
31
31
 
32
32
  def to_hash: -> {
33
33
  name: String,
34
+ settings: Courier::BrandSettings,
34
35
  id: String?,
35
- settings: Courier::BrandSettings?,
36
36
  snippets: Courier::BrandSnippets?,
37
37
  request_options: Courier::RequestOptions
38
38
  }
@@ -11,12 +11,142 @@ module Courier
11
11
  | Courier::JourneyAINode
12
12
  | Courier::JourneyThrottleStaticNode
13
13
  | Courier::JourneyThrottleDynamicNode
14
+ | Courier::JourneyNode::JourneyBatchNode
14
15
  | Courier::JourneyExitNode
15
16
  | Courier::JourneyNode::JourneyBranchNode
16
17
 
17
18
  module JourneyNode
18
19
  extend Courier::Internal::Type::Union
19
20
 
21
+ type journey_batch_node =
22
+ {
23
+ max_wait_period: String,
24
+ retain: Courier::JourneyNode::JourneyBatchNode::Retain,
25
+ scope: Courier::Models::JourneyNode::JourneyBatchNode::scope,
26
+ type: Courier::Models::JourneyNode::JourneyBatchNode::type_,
27
+ wait_period: String,
28
+ id: String,
29
+ category_key: String,
30
+ conditions: Courier::Models::journey_conditions_field,
31
+ max_items: Integer
32
+ }
33
+
34
+ class JourneyBatchNode < Courier::Internal::Type::BaseModel
35
+ attr_accessor max_wait_period: String
36
+
37
+ attr_accessor retain: Courier::JourneyNode::JourneyBatchNode::Retain
38
+
39
+ attr_accessor scope: Courier::Models::JourneyNode::JourneyBatchNode::scope
40
+
41
+ attr_accessor type: Courier::Models::JourneyNode::JourneyBatchNode::type_
42
+
43
+ attr_accessor wait_period: String
44
+
45
+ attr_reader id: String?
46
+
47
+ def id=: (String) -> String
48
+
49
+ attr_reader category_key: String?
50
+
51
+ def category_key=: (String) -> String
52
+
53
+ attr_reader conditions: Courier::Models::journey_conditions_field?
54
+
55
+ def conditions=: (
56
+ Courier::Models::journey_conditions_field
57
+ ) -> Courier::Models::journey_conditions_field
58
+
59
+ attr_reader max_items: Integer?
60
+
61
+ def max_items=: (Integer) -> Integer
62
+
63
+ def initialize: (
64
+ max_wait_period: String,
65
+ retain: Courier::JourneyNode::JourneyBatchNode::Retain,
66
+ scope: Courier::Models::JourneyNode::JourneyBatchNode::scope,
67
+ type: Courier::Models::JourneyNode::JourneyBatchNode::type_,
68
+ wait_period: String,
69
+ ?id: String,
70
+ ?category_key: String,
71
+ ?conditions: Courier::Models::journey_conditions_field,
72
+ ?max_items: Integer
73
+ ) -> void
74
+
75
+ def to_hash: -> {
76
+ max_wait_period: String,
77
+ retain: Courier::JourneyNode::JourneyBatchNode::Retain,
78
+ scope: Courier::Models::JourneyNode::JourneyBatchNode::scope,
79
+ type: Courier::Models::JourneyNode::JourneyBatchNode::type_,
80
+ wait_period: String,
81
+ id: String,
82
+ category_key: String,
83
+ conditions: Courier::Models::journey_conditions_field,
84
+ max_items: Integer
85
+ }
86
+
87
+ type retain =
88
+ {
89
+ count: Integer,
90
+ type: Courier::Models::JourneyNode::JourneyBatchNode::Retain::type_,
91
+ sort_key: String
92
+ }
93
+
94
+ class Retain < Courier::Internal::Type::BaseModel
95
+ attr_accessor count: Integer
96
+
97
+ attr_accessor type: Courier::Models::JourneyNode::JourneyBatchNode::Retain::type_
98
+
99
+ attr_reader sort_key: String?
100
+
101
+ def sort_key=: (String) -> String
102
+
103
+ def initialize: (
104
+ count: Integer,
105
+ type: Courier::Models::JourneyNode::JourneyBatchNode::Retain::type_,
106
+ ?sort_key: String
107
+ ) -> void
108
+
109
+ def to_hash: -> {
110
+ count: Integer,
111
+ type: Courier::Models::JourneyNode::JourneyBatchNode::Retain::type_,
112
+ sort_key: String
113
+ }
114
+
115
+ type type_ = :first | :last | :highest | :lowest
116
+
117
+ module Type
118
+ extend Courier::Internal::Type::Enum
119
+
120
+ FIRST: :first
121
+ LAST: :last
122
+ HIGHEST: :highest
123
+ LOWEST: :lowest
124
+
125
+ def self?.values: -> ::Array[Courier::Models::JourneyNode::JourneyBatchNode::Retain::type_]
126
+ end
127
+ end
128
+
129
+ type scope = :user
130
+
131
+ module Scope
132
+ extend Courier::Internal::Type::Enum
133
+
134
+ USER: :user
135
+
136
+ def self?.values: -> ::Array[Courier::Models::JourneyNode::JourneyBatchNode::scope]
137
+ end
138
+
139
+ type type_ = :batch
140
+
141
+ module Type
142
+ extend Courier::Internal::Type::Enum
143
+
144
+ BATCH: :batch
145
+
146
+ def self?.values: -> ::Array[Courier::Models::JourneyNode::JourneyBatchNode::type_]
147
+ end
148
+ end
149
+
20
150
  type journey_branch_node =
21
151
  {
22
152
  default: Courier::JourneyNode::JourneyBranchNode::Default,
@@ -3,8 +3,8 @@ module Courier
3
3
  class Brands
4
4
  def create: (
5
5
  name: String,
6
+ settings: Courier::BrandSettings,
6
7
  ?id: String?,
7
- ?settings: Courier::BrandSettings?,
8
8
  ?snippets: Courier::BrandSnippets?,
9
9
  ?request_options: Courier::request_opts
10
10
  ) -> Courier::Brand
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.11.0
4
+ version: 4.12.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-05-19 00:00:00.000000000 Z
11
+ date: 2026-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi