trycourier 5.0.0 → 6.1.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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +1 -1
  4. data/lib/courier/internal/type/union.rb +7 -7
  5. data/lib/courier/models/apn.rb +19 -0
  6. data/lib/courier/models/automation_run_list_item.rb +57 -0
  7. data/lib/courier/models/automation_run_list_response.rb +25 -0
  8. data/lib/courier/models/automation_run_step.rb +64 -0
  9. data/lib/courier/models/automation_run_steps_response.rb +17 -0
  10. data/lib/courier/models/automations/run_list_params.rb +71 -0
  11. data/lib/courier/models/automations/run_list_steps_params.rb +22 -0
  12. data/lib/courier/models/create_journey_request.rb +2 -2
  13. data/lib/courier/models/expo.rb +1 -0
  14. data/lib/courier/models/journey_audience_trigger_node.rb +77 -0
  15. data/lib/courier/models/journey_node.rb +8 -2
  16. data/lib/courier/models/journey_response.rb +2 -2
  17. data/lib/courier/models/journey_run.rb +66 -0
  18. data/lib/courier/models/journey_run_list_item.rb +50 -0
  19. data/lib/courier/models/journey_run_list_response.rb +33 -0
  20. data/lib/courier/models/journey_run_response.rb +22 -0
  21. data/lib/courier/models/journey_run_step.rb +65 -0
  22. data/lib/courier/models/journey_run_steps_response.rb +17 -0
  23. data/lib/courier/models/journey_segment_trigger_node.rb +5 -1
  24. data/lib/courier/models/journey_webhook_trigger_node.rb +85 -0
  25. data/lib/courier/models/journeys/run_list_params.rb +71 -0
  26. data/lib/courier/models/journeys/run_list_steps_params.rb +22 -0
  27. data/lib/courier/models/journeys/run_retrieve_params.rb +22 -0
  28. data/lib/courier/models/multiple_tokens.rb +26 -3
  29. data/lib/courier/models/user_profile.rb +8 -4
  30. data/lib/courier/models/users/topic_preference.rb +21 -1
  31. data/lib/courier/models.rb +26 -2
  32. data/lib/courier/resources/automations/runs.rb +80 -0
  33. data/lib/courier/resources/automations.rb +6 -0
  34. data/lib/courier/resources/journeys/runs.rb +104 -0
  35. data/lib/courier/resources/journeys.rb +8 -2
  36. data/lib/courier/resources/notifications.rb +0 -22
  37. data/lib/courier/version.rb +1 -1
  38. data/lib/courier.rb +20 -1
  39. data/rbi/courier/models/apn.rbi +18 -0
  40. data/rbi/courier/models/automation_run_list_item.rbi +87 -0
  41. data/rbi/courier/models/automation_run_list_response.rbi +47 -0
  42. data/rbi/courier/models/automation_run_step.rbi +96 -0
  43. data/rbi/courier/models/automation_run_steps_response.rbi +28 -0
  44. data/rbi/courier/models/automations/run_list_params.rbi +114 -0
  45. data/rbi/courier/models/automations/run_list_steps_params.rbi +40 -0
  46. data/rbi/courier/models/create_journey_request.rbi +6 -0
  47. data/rbi/courier/models/expo.rbi +1 -0
  48. data/rbi/courier/models/journey_audience_trigger_node.rbi +162 -0
  49. data/rbi/courier/models/journey_node.rbi +2 -0
  50. data/rbi/courier/models/journey_response.rbi +2 -0
  51. data/rbi/courier/models/journey_run.rbi +97 -0
  52. data/rbi/courier/models/journey_run_list_item.rbi +79 -0
  53. data/rbi/courier/models/journey_run_list_response.rbi +58 -0
  54. data/rbi/courier/models/journey_run_response.rbi +33 -0
  55. data/rbi/courier/models/journey_run_step.rbi +97 -0
  56. data/rbi/courier/models/journey_run_steps_response.rbi +28 -0
  57. data/rbi/courier/models/journey_segment_trigger_node.rbi +9 -1
  58. data/rbi/courier/models/journey_webhook_trigger_node.rbi +174 -0
  59. data/rbi/courier/models/journeys/run_list_params.rbi +111 -0
  60. data/rbi/courier/models/journeys/run_list_steps_params.rbi +40 -0
  61. data/rbi/courier/models/journeys/run_retrieve_params.rbi +40 -0
  62. data/rbi/courier/models/multiple_tokens.rbi +32 -4
  63. data/rbi/courier/models/user_profile.rbi +14 -3
  64. data/rbi/courier/models/users/topic_preference.rbi +33 -3
  65. data/rbi/courier/models.rbi +26 -2
  66. data/rbi/courier/resources/automations/runs.rbi +69 -0
  67. data/rbi/courier/resources/automations.rbi +5 -0
  68. data/rbi/courier/resources/journeys/runs.rbi +87 -0
  69. data/rbi/courier/resources/journeys.rbi +9 -0
  70. data/rbi/courier/resources/notifications.rbi +0 -16
  71. data/sig/courier/models/apn.rbs +11 -0
  72. data/sig/courier/models/automation_run_list_item.rbs +46 -0
  73. data/sig/courier/models/automation_run_list_response.rbs +24 -0
  74. data/sig/courier/models/automation_run_step.rbs +53 -0
  75. data/sig/courier/models/automation_run_steps_response.rbs +14 -0
  76. data/sig/courier/models/automations/run_list_params.rbs +65 -0
  77. data/sig/courier/models/automations/run_list_steps_params.rbs +22 -0
  78. data/sig/courier/models/journey_audience_trigger_node.rbs +66 -0
  79. data/sig/courier/models/journey_node.rbs +2 -0
  80. data/sig/courier/models/journey_run.rbs +53 -0
  81. data/sig/courier/models/journey_run_list_item.rbs +46 -0
  82. data/sig/courier/models/journey_run_list_response.rbs +34 -0
  83. data/sig/courier/models/journey_run_response.rbs +13 -0
  84. data/sig/courier/models/journey_run_step.rbs +53 -0
  85. data/sig/courier/models/journey_run_steps_response.rbs +14 -0
  86. data/sig/courier/models/journey_segment_trigger_node.rbs +2 -1
  87. data/sig/courier/models/journey_webhook_trigger_node.rbs +73 -0
  88. data/sig/courier/models/journeys/run_list_params.rbs +65 -0
  89. data/sig/courier/models/journeys/run_list_steps_params.rbs +25 -0
  90. data/sig/courier/models/journeys/run_retrieve_params.rbs +25 -0
  91. data/sig/courier/models/multiple_tokens.rbs +14 -4
  92. data/sig/courier/models/user_profile.rbs +4 -4
  93. data/sig/courier/models/users/topic_preference.rbs +17 -3
  94. data/sig/courier/models.rbs +26 -2
  95. data/sig/courier/resources/automations/runs.rbs +24 -0
  96. data/sig/courier/resources/automations.rbs +2 -0
  97. data/sig/courier/resources/journeys/runs.rbs +29 -0
  98. data/sig/courier/resources/journeys.rbs +2 -0
  99. data/sig/courier/resources/notifications.rbs +0 -5
  100. metadata +62 -5
  101. data/lib/courier/models/notification_duplicate_params.rb +0 -20
  102. data/rbi/courier/models/notification_duplicate_params.rbi +0 -38
  103. data/sig/courier/models/notification_duplicate_params.rbs +0 -20
@@ -0,0 +1,174 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyWebhookTriggerNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyWebhookTriggerNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # The provider key the webhook URL is minted for. Required, and must not contain a
12
+ # forward slash.
13
+ sig { returns(String) }
14
+ attr_accessor :event_source
15
+
16
+ sig { returns(Courier::JourneyWebhookTriggerNode::TriggerType::OrSymbol) }
17
+ attr_accessor :trigger_type
18
+
19
+ sig { returns(Courier::JourneyWebhookTriggerNode::Type::OrSymbol) }
20
+ attr_accessor :type
21
+
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :id
24
+
25
+ sig { params(id: String).void }
26
+ attr_writer :id
27
+
28
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
29
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
30
+ # express "no conditions".
31
+ sig do
32
+ returns(
33
+ T.nilable(
34
+ T.any(
35
+ T::Array[String],
36
+ Courier::JourneyConditionGroup,
37
+ Courier::JourneyConditionNestedGroup
38
+ )
39
+ )
40
+ )
41
+ end
42
+ attr_reader :conditions
43
+
44
+ sig do
45
+ params(
46
+ conditions:
47
+ T.any(
48
+ T::Array[String],
49
+ Courier::JourneyConditionGroup::OrHash,
50
+ Courier::JourneyConditionNestedGroup::OrHash
51
+ )
52
+ ).void
53
+ end
54
+ attr_writer :conditions
55
+
56
+ # An optional event filter, matched against the payload's `event` field. A sender
57
+ # that supplies no `event` matches the literal `custom`. Must not contain a
58
+ # forward slash. Omit to accept every event delivered to the URL.
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :event_id
61
+
62
+ sig { params(event_id: String).void }
63
+ attr_writer :event_id
64
+
65
+ # Trigger fired when an external system POSTs to the webhook URL minted for
66
+ # `event_source`. Narrow it to one event with `event_id`, or omit `event_id` to
67
+ # accept every event delivered to the URL.
68
+ sig do
69
+ params(
70
+ event_source: String,
71
+ trigger_type:
72
+ Courier::JourneyWebhookTriggerNode::TriggerType::OrSymbol,
73
+ type: Courier::JourneyWebhookTriggerNode::Type::OrSymbol,
74
+ id: String,
75
+ conditions:
76
+ T.any(
77
+ T::Array[String],
78
+ Courier::JourneyConditionGroup::OrHash,
79
+ Courier::JourneyConditionNestedGroup::OrHash
80
+ ),
81
+ event_id: String
82
+ ).returns(T.attached_class)
83
+ end
84
+ def self.new(
85
+ # The provider key the webhook URL is minted for. Required, and must not contain a
86
+ # forward slash.
87
+ event_source:,
88
+ trigger_type:,
89
+ type:,
90
+ id: nil,
91
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
92
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
93
+ # express "no conditions".
94
+ conditions: nil,
95
+ # An optional event filter, matched against the payload's `event` field. A sender
96
+ # that supplies no `event` matches the literal `custom`. Must not contain a
97
+ # forward slash. Omit to accept every event delivered to the URL.
98
+ event_id: nil
99
+ )
100
+ end
101
+
102
+ sig do
103
+ override.returns(
104
+ {
105
+ event_source: String,
106
+ trigger_type:
107
+ Courier::JourneyWebhookTriggerNode::TriggerType::OrSymbol,
108
+ type: Courier::JourneyWebhookTriggerNode::Type::OrSymbol,
109
+ id: String,
110
+ conditions:
111
+ T.any(
112
+ T::Array[String],
113
+ Courier::JourneyConditionGroup,
114
+ Courier::JourneyConditionNestedGroup
115
+ ),
116
+ event_id: String
117
+ }
118
+ )
119
+ end
120
+ def to_hash
121
+ end
122
+
123
+ module TriggerType
124
+ extend Courier::Internal::Type::Enum
125
+
126
+ TaggedSymbol =
127
+ T.type_alias do
128
+ T.all(Symbol, Courier::JourneyWebhookTriggerNode::TriggerType)
129
+ end
130
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
131
+
132
+ WEBHOOK =
133
+ T.let(
134
+ :webhook,
135
+ Courier::JourneyWebhookTriggerNode::TriggerType::TaggedSymbol
136
+ )
137
+
138
+ sig do
139
+ override.returns(
140
+ T::Array[
141
+ Courier::JourneyWebhookTriggerNode::TriggerType::TaggedSymbol
142
+ ]
143
+ )
144
+ end
145
+ def self.values
146
+ end
147
+ end
148
+
149
+ module Type
150
+ extend Courier::Internal::Type::Enum
151
+
152
+ TaggedSymbol =
153
+ T.type_alias do
154
+ T.all(Symbol, Courier::JourneyWebhookTriggerNode::Type)
155
+ end
156
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
157
+
158
+ TRIGGER =
159
+ T.let(
160
+ :trigger,
161
+ Courier::JourneyWebhookTriggerNode::Type::TaggedSymbol
162
+ )
163
+
164
+ sig do
165
+ override.returns(
166
+ T::Array[Courier::JourneyWebhookTriggerNode::Type::TaggedSymbol]
167
+ )
168
+ end
169
+ def self.values
170
+ end
171
+ end
172
+ end
173
+ end
174
+ end
@@ -0,0 +1,111 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ class RunListParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(Courier::Journeys::RunListParams, Courier::Internal::AnyHash)
13
+ end
14
+
15
+ # A cursor token for pagination. Use the `next_cursor` from the previous response
16
+ # to fetch the next page of results. Treat it as opaque.
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :cursor
19
+
20
+ sig { params(cursor: String).void }
21
+ attr_writer :cursor
22
+
23
+ # An inclusive upper bound on `created_at`, in the same format as `start_date`.
24
+ sig { returns(T.nilable(String)) }
25
+ attr_reader :end_date
26
+
27
+ sig { params(end_date: String).void }
28
+ attr_writer :end_date
29
+
30
+ # The number of runs to return per page, between `1` and `50`. Defaults to `20`.
31
+ # Values outside the range are clamped, and a non-numeric value falls back to
32
+ # `20`.
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :limit
35
+
36
+ sig { params(limit: String).void }
37
+ attr_writer :limit
38
+
39
+ # An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
40
+ # `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`.
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :start_date
43
+
44
+ sig { params(start_date: String).void }
45
+ attr_writer :start_date
46
+
47
+ # A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
48
+ sig { returns(T.nilable(String)) }
49
+ attr_reader :status
50
+
51
+ sig { params(status: String).void }
52
+ attr_writer :status
53
+
54
+ # A comma-separated list of Journey ids to filter on.
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :template_id
57
+
58
+ sig { params(template_id: String).void }
59
+ attr_writer :template_id
60
+
61
+ sig do
62
+ params(
63
+ cursor: String,
64
+ end_date: String,
65
+ limit: String,
66
+ start_date: String,
67
+ status: String,
68
+ template_id: String,
69
+ request_options: Courier::RequestOptions::OrHash
70
+ ).returns(T.attached_class)
71
+ end
72
+ def self.new(
73
+ # A cursor token for pagination. Use the `next_cursor` from the previous response
74
+ # to fetch the next page of results. Treat it as opaque.
75
+ cursor: nil,
76
+ # An inclusive upper bound on `created_at`, in the same format as `start_date`.
77
+ end_date: nil,
78
+ # The number of runs to return per page, between `1` and `50`. Defaults to `20`.
79
+ # Values outside the range are clamped, and a non-numeric value falls back to
80
+ # `20`.
81
+ limit: nil,
82
+ # An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
83
+ # `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`.
84
+ start_date: nil,
85
+ # A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
86
+ status: nil,
87
+ # A comma-separated list of Journey ids to filter on.
88
+ template_id: nil,
89
+ request_options: {}
90
+ )
91
+ end
92
+
93
+ sig do
94
+ override.returns(
95
+ {
96
+ cursor: String,
97
+ end_date: String,
98
+ limit: String,
99
+ start_date: String,
100
+ status: String,
101
+ template_id: String,
102
+ request_options: Courier::RequestOptions
103
+ }
104
+ )
105
+ end
106
+ def to_hash
107
+ end
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ class RunListStepsParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Journeys::RunListStepsParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :run_id
20
+
21
+ sig do
22
+ params(
23
+ run_id: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(run_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { run_id: String, request_options: Courier::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Journeys
6
+ class RunRetrieveParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Journeys::RunRetrieveParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :run_id
20
+
21
+ sig do
22
+ params(
23
+ run_id: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(run_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { run_id: String, request_options: Courier::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -8,20 +8,48 @@ module Courier
8
8
  T.any(Courier::MultipleTokens, Courier::Internal::AnyHash)
9
9
  end
10
10
 
11
- sig { returns(T::Array[Courier::Token]) }
11
+ # One device token, or an array of them. The values are the token strings
12
+ # themselves — not objects.
13
+ sig { returns(Courier::MultipleTokens::Tokens::Variants) }
12
14
  attr_accessor :tokens
13
15
 
14
16
  sig do
15
- params(tokens: T::Array[Courier::Token::OrHash]).returns(
17
+ params(tokens: Courier::MultipleTokens::Tokens::Variants).returns(
16
18
  T.attached_class
17
19
  )
18
20
  end
19
- def self.new(tokens:)
21
+ def self.new(
22
+ # One device token, or an array of them. The values are the token strings
23
+ # themselves — not objects.
24
+ tokens:
25
+ )
20
26
  end
21
27
 
22
- sig { override.returns({ tokens: T::Array[Courier::Token] }) }
28
+ sig do
29
+ override.returns({ tokens: Courier::MultipleTokens::Tokens::Variants })
30
+ end
23
31
  def to_hash
24
32
  end
33
+
34
+ # One device token, or an array of them. The values are the token strings
35
+ # themselves — not objects.
36
+ module Tokens
37
+ extend Courier::Internal::Type::Union
38
+
39
+ Variants = T.type_alias { T.any(String, T::Array[String]) }
40
+
41
+ sig do
42
+ override.returns(T::Array[Courier::MultipleTokens::Tokens::Variants])
43
+ end
44
+ def self.variants
45
+ end
46
+
47
+ StringArray =
48
+ T.let(
49
+ Courier::Internal::Type::ArrayOf[String],
50
+ Courier::Internal::Type::Converter
51
+ )
52
+ end
25
53
  end
26
54
  end
27
55
  end
@@ -20,7 +20,10 @@ module Courier
20
20
  sig { params(airship: T.nilable(Courier::AirshipProfile::OrHash)).void }
21
21
  attr_writer :airship
22
22
 
23
- sig { returns(T.nilable(String)) }
23
+ # Apple Push Notification device tokens. Supply either a single `token` or a
24
+ # `tokens` value. A bare string is rejected by the provider — the token must be
25
+ # wrapped in this object.
26
+ sig { returns(T.nilable(T.any(Courier::Token, Courier::MultipleTokens))) }
24
27
  attr_accessor :apn
25
28
 
26
29
  # Routes a push notification through the AWS SNS provider. The target ARN must be
@@ -53,6 +56,7 @@ module Courier
53
56
  sig { returns(T.nilable(T::Boolean)) }
54
57
  attr_accessor :email_verified
55
58
 
59
+ # Expo push tokens. Supply either a single `token` or a `tokens` value.
56
60
  sig { returns(T.nilable(T.any(Courier::Token, Courier::MultipleTokens))) }
57
61
  attr_accessor :expo
58
62
 
@@ -148,7 +152,10 @@ module Courier
148
152
  params(
149
153
  address: T.nilable(Courier::UserProfile::Address::OrHash),
150
154
  airship: T.nilable(Courier::AirshipProfile::OrHash),
151
- apn: T.nilable(String),
155
+ apn:
156
+ T.nilable(
157
+ T.any(Courier::Token::OrHash, Courier::MultipleTokens::OrHash)
158
+ ),
152
159
  aws_sns: T.nilable(Courier::AwsSns::OrHash),
153
160
  birthdate: T.nilable(String),
154
161
  custom: T.nilable(T::Hash[Symbol, T.anything]),
@@ -208,6 +215,9 @@ module Courier
208
215
  def self.new(
209
216
  address: nil,
210
217
  airship: nil,
218
+ # Apple Push Notification device tokens. Supply either a single `token` or a
219
+ # `tokens` value. A bare string is rejected by the provider — the token must be
220
+ # wrapped in this object.
211
221
  apn: nil,
212
222
  # Routes a push notification through the AWS SNS provider. The target ARN must be
213
223
  # nested under `aws_sns` — a top-level `target_arn` on the profile is ignored by
@@ -220,6 +230,7 @@ module Courier
220
230
  discord: nil,
221
231
  email: nil,
222
232
  email_verified: nil,
233
+ # Expo push tokens. Supply either a single `token` or a `tokens` value.
223
234
  expo: nil,
224
235
  facebook_psid: nil,
225
236
  family_name: nil,
@@ -250,7 +261,7 @@ module Courier
250
261
  {
251
262
  address: T.nilable(Courier::UserProfile::Address),
252
263
  airship: T.nilable(Courier::AirshipProfile),
253
- apn: T.nilable(String),
264
+ apn: T.nilable(T.any(Courier::Token, Courier::MultipleTokens)),
254
265
  aws_sns: T.nilable(Courier::AwsSns),
255
266
  birthdate: T.nilable(String),
256
267
  custom: T.nilable(T::Hash[Symbol, T.anything]),
@@ -43,6 +43,24 @@ module Courier
43
43
  sig { returns(T.nilable(T::Boolean)) }
44
44
  attr_accessor :has_custom_routing
45
45
 
46
+ # The unique identifier of the section this topic belongs to. Always present when
47
+ # listing a user's preferences; omitted by the single-topic read when the topic
48
+ # has no resolvable section.
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :section_id
51
+
52
+ sig { params(section_id: String).void }
53
+ attr_writer :section_id
54
+
55
+ # The display name of the section this topic belongs to. Always present when
56
+ # listing a user's preferences; omitted by the single-topic read when the topic
57
+ # has no resolvable section.
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :section_name
60
+
61
+ sig { params(section_name: String).void }
62
+ attr_writer :section_name
63
+
46
64
  sig do
47
65
  params(
48
66
  default_status: Courier::PreferenceStatus::OrSymbol,
@@ -51,7 +69,9 @@ module Courier
51
69
  topic_name: String,
52
70
  custom_routing:
53
71
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
54
- has_custom_routing: T.nilable(T::Boolean)
72
+ has_custom_routing: T.nilable(T::Boolean),
73
+ section_id: String,
74
+ section_name: String
55
75
  ).returns(T.attached_class)
56
76
  end
57
77
  def self.new(
@@ -72,7 +92,15 @@ module Courier
72
92
  custom_routing: nil,
73
93
  # Whether the user has chosen specific delivery channels for this topic (listed in
74
94
  # custom_routing) rather than the topic's default routing.
75
- has_custom_routing: nil
95
+ has_custom_routing: nil,
96
+ # The unique identifier of the section this topic belongs to. Always present when
97
+ # listing a user's preferences; omitted by the single-topic read when the topic
98
+ # has no resolvable section.
99
+ section_id: nil,
100
+ # The display name of the section this topic belongs to. Always present when
101
+ # listing a user's preferences; omitted by the single-topic read when the topic
102
+ # has no resolvable section.
103
+ section_name: nil
76
104
  )
77
105
  end
78
106
 
@@ -87,7 +115,9 @@ module Courier
87
115
  T.nilable(
88
116
  T::Array[Courier::ChannelClassification::TaggedSymbol]
89
117
  ),
90
- has_custom_routing: T.nilable(T::Boolean)
118
+ has_custom_routing: T.nilable(T::Boolean),
119
+ section_id: String,
120
+ section_name: String
91
121
  }
92
122
  )
93
123
  end
@@ -7,6 +7,8 @@ module Courier
7
7
 
8
8
  Alignment = Courier::Models::Alignment
9
9
 
10
+ Apn = Courier::Models::Apn
11
+
10
12
  AssociatedNotificationListResponse =
11
13
  Courier::Models::AssociatedNotificationListResponse
12
14
 
@@ -40,6 +42,14 @@ module Courier
40
42
 
41
43
  AutomationListParams = Courier::Models::AutomationListParams
42
44
 
45
+ AutomationRunListItem = Courier::Models::AutomationRunListItem
46
+
47
+ AutomationRunListResponse = Courier::Models::AutomationRunListResponse
48
+
49
+ AutomationRunStep = Courier::Models::AutomationRunStep
50
+
51
+ AutomationRunStepsResponse = Courier::Models::AutomationRunStepsResponse
52
+
43
53
  Automations = Courier::Models::Automations
44
54
 
45
55
  AutomationTemplate = Courier::Models::AutomationTemplate
@@ -208,6 +218,8 @@ module Courier
208
218
 
209
219
  JourneyArchiveParams = Courier::Models::JourneyArchiveParams
210
220
 
221
+ JourneyAudienceTriggerNode = Courier::Models::JourneyAudienceTriggerNode
222
+
211
223
  JourneyCancelParams = Courier::Models::JourneyCancelParams
212
224
 
213
225
  JourneyConditionAtom =
@@ -258,6 +270,18 @@ module Courier
258
270
 
259
271
  JourneyRetrieveParams = Courier::Models::JourneyRetrieveParams
260
272
 
273
+ JourneyRun = Courier::Models::JourneyRun
274
+
275
+ JourneyRunListItem = Courier::Models::JourneyRunListItem
276
+
277
+ JourneyRunListResponse = Courier::Models::JourneyRunListResponse
278
+
279
+ JourneyRunResponse = Courier::Models::JourneyRunResponse
280
+
281
+ JourneyRunStep = Courier::Models::JourneyRunStep
282
+
283
+ JourneyRunStepsResponse = Courier::Models::JourneyRunStepsResponse
284
+
261
285
  Journeys = Courier::Models::Journeys
262
286
 
263
287
  JourneySegmentTriggerNode = Courier::Models::JourneySegmentTriggerNode
@@ -292,6 +316,8 @@ module Courier
292
316
 
293
317
  JourneyVersionsListResponse = Courier::Models::JourneyVersionsListResponse
294
318
 
319
+ JourneyWebhookTriggerNode = Courier::Models::JourneyWebhookTriggerNode
320
+
295
321
  ListDeleteParams = Courier::Models::ListDeleteParams
296
322
 
297
323
  ListFilter = Courier::Models::ListFilter
@@ -362,8 +388,6 @@ module Courier
362
388
 
363
389
  NotificationCreateParams = Courier::Models::NotificationCreateParams
364
390
 
365
- NotificationDuplicateParams = Courier::Models::NotificationDuplicateParams
366
-
367
391
  NotificationElementPutRequest = Courier::Models::NotificationElementPutRequest
368
392
 
369
393
  NotificationGetContent = Courier::Models::NotificationGetContent
@@ -0,0 +1,69 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Resources
5
+ class Automations
6
+ # Invoke a stored automation template or an ad hoc automation defined in the
7
+ # request.
8
+ class Runs
9
+ # List runs of the workspace's v2 Automations, newest first, filtered by status,
10
+ # Template, or date range and paged by cursor. Journey (v3) runs are listed by
11
+ # `GET /journeys/runs` instead — the two surfaces never return each other's runs.
12
+ # Runs are retained for 95 days.
13
+ sig do
14
+ params(
15
+ cursor: String,
16
+ end_date: String,
17
+ limit: String,
18
+ start_date: String,
19
+ status: String,
20
+ template_id: String,
21
+ request_options: Courier::RequestOptions::OrHash
22
+ ).returns(Courier::AutomationRunListResponse)
23
+ end
24
+ def list(
25
+ # A cursor token for pagination. Use the `next_cursor` from the previous response
26
+ # to fetch the next page of results. Treat it as opaque.
27
+ cursor: nil,
28
+ # An inclusive upper bound on `created_at`, in the same format as `start_date`.
29
+ end_date: nil,
30
+ # The number of runs to return per page, between `1` and `50`. Defaults to `20`.
31
+ # Values outside the range are clamped, and a non-numeric value falls back to
32
+ # `20`.
33
+ limit: nil,
34
+ # An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
35
+ # `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`.
36
+ start_date: nil,
37
+ # A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
38
+ status: nil,
39
+ # A comma-separated list of Automation Template ids to filter on.
40
+ template_id: nil,
41
+ request_options: {}
42
+ )
43
+ end
44
+
45
+ # List the per-step state of one Automation run, in full — this endpoint is not
46
+ # paginated. `message_id` is present on send steps that produced a message; follow
47
+ # it to `GET /messages/{message_id}` for delivery status. A send to a List or an
48
+ # Audience yields one `message_id` for the request, not one per recipient.
49
+ sig do
50
+ params(
51
+ id: String,
52
+ request_options: Courier::RequestOptions::OrHash
53
+ ).returns(Courier::AutomationRunStepsResponse)
54
+ end
55
+ def list_steps(
56
+ # A unique identifier representing the Automation run.
57
+ id,
58
+ request_options: {}
59
+ )
60
+ end
61
+
62
+ # @api private
63
+ sig { params(client: Courier::Client).returns(T.attached_class) }
64
+ def self.new(client:)
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -10,6 +10,11 @@ module Courier
10
10
  sig { returns(Courier::Resources::Automations::Invoke) }
11
11
  attr_reader :invoke
12
12
 
13
+ # Invoke a stored automation template or an ad hoc automation defined in the
14
+ # request.
15
+ sig { returns(Courier::Resources::Automations::Runs) }
16
+ attr_reader :runs
17
+
13
18
  # Lists the workspace's saved automation templates, each with its id and a cursor
14
19
  # for paging to the next page of results.
15
20
  sig do