trycourier 4.10.2 → 4.11.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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/lib/courier/client.rb +15 -1
  4. data/lib/courier/internal/transport/base_client.rb +2 -0
  5. data/lib/courier/models/create_journey_request.rb +39 -0
  6. data/lib/courier/models/journey_ai_node.rb +77 -0
  7. data/lib/courier/models/journey_api_invoke_trigger_node.rb +73 -0
  8. data/lib/courier/models/journey_archive_params.rb +20 -0
  9. data/lib/courier/models/journey_condition_atom.rb +8 -0
  10. data/lib/courier/models/journey_condition_group.rb +26 -0
  11. data/lib/courier/models/journey_condition_nested_group.rb +24 -0
  12. data/lib/courier/models/journey_conditions_field.rb +37 -0
  13. data/lib/courier/models/journey_create_params.rb +14 -0
  14. data/lib/courier/models/journey_delay_duration_node.rb +71 -0
  15. data/lib/courier/models/journey_delay_until_node.rb +71 -0
  16. data/lib/courier/models/journey_exit_node.rb +33 -0
  17. data/lib/courier/models/journey_fetch_get_delete_node.rb +103 -0
  18. data/lib/courier/models/journey_fetch_post_put_node.rb +110 -0
  19. data/lib/courier/models/journey_list_versions_params.rb +20 -0
  20. data/lib/courier/models/journey_merge_strategy.rb +18 -0
  21. data/lib/courier/models/journey_node.rb +139 -0
  22. data/lib/courier/models/journey_publish_params.rb +20 -0
  23. data/lib/courier/models/journey_publish_request.rb +18 -0
  24. data/lib/courier/models/journey_replace_params.rb +20 -0
  25. data/lib/courier/models/journey_response.rb +82 -0
  26. data/lib/courier/models/journey_retrieve_params.rb +29 -0
  27. data/lib/courier/models/journey_segment_trigger_node.rb +90 -0
  28. data/lib/courier/models/journey_send_node.rb +124 -0
  29. data/lib/courier/models/journey_state.rb +16 -0
  30. data/lib/courier/models/journey_template_create_request.rb +138 -0
  31. data/lib/courier/models/journey_template_get_response.rb +154 -0
  32. data/lib/courier/models/journey_template_list_response.rb +23 -0
  33. data/lib/courier/models/journey_template_publish_request.rb +18 -0
  34. data/lib/courier/models/journey_template_replace_request.rb +126 -0
  35. data/lib/courier/models/journey_template_summary.rb +60 -0
  36. data/lib/courier/models/journey_throttle_dynamic_node.rb +86 -0
  37. data/lib/courier/models/journey_throttle_static_node.rb +80 -0
  38. data/lib/courier/models/journey_version_item.rb +41 -0
  39. data/lib/courier/models/journey_versions_list_response.rb +24 -0
  40. data/lib/courier/models/journeys/template_archive_params.rb +28 -0
  41. data/lib/courier/models/journeys/template_create_params.rb +22 -0
  42. data/lib/courier/models/journeys/template_list_params.rb +39 -0
  43. data/lib/courier/models/journeys/template_list_versions_params.rb +28 -0
  44. data/lib/courier/models/journeys/template_publish_params.rb +28 -0
  45. data/lib/courier/models/journeys/template_replace_params.rb +28 -0
  46. data/lib/courier/models/journeys/template_retrieve_params.rb +28 -0
  47. data/lib/courier/models/tenants/template_delete_params.rb +28 -0
  48. data/lib/courier/models.rb +73 -0
  49. data/lib/courier/resources/journeys/templates.rb +224 -0
  50. data/lib/courier/resources/journeys.rb +167 -2
  51. data/lib/courier/resources/tenants/templates.rb +32 -0
  52. data/lib/courier/version.rb +1 -1
  53. data/lib/courier.rb +44 -0
  54. data/rbi/courier/models/create_journey_request.rbi +113 -0
  55. data/rbi/courier/models/journey_ai_node.rbi +141 -0
  56. data/rbi/courier/models/journey_api_invoke_trigger_node.rbi +164 -0
  57. data/rbi/courier/models/journey_archive_params.rbi +35 -0
  58. data/rbi/courier/models/journey_condition_atom.rbi +11 -0
  59. data/rbi/courier/models/journey_condition_group.rbi +43 -0
  60. data/rbi/courier/models/journey_condition_nested_group.rbi +51 -0
  61. data/rbi/courier/models/journey_conditions_field.rbi +27 -0
  62. data/rbi/courier/models/journey_create_params.rbi +27 -0
  63. data/rbi/courier/models/journey_delay_duration_node.rbi +146 -0
  64. data/rbi/courier/models/journey_delay_until_node.rbi +139 -0
  65. data/rbi/courier/models/journey_exit_node.rbi +57 -0
  66. data/rbi/courier/models/journey_fetch_get_delete_node.rbi +186 -0
  67. data/rbi/courier/models/journey_fetch_post_put_node.rbi +190 -0
  68. data/rbi/courier/models/journey_list_versions_params.rbi +35 -0
  69. data/rbi/courier/models/journey_merge_strategy.rbi +26 -0
  70. data/rbi/courier/models/journey_node.rbi +227 -0
  71. data/rbi/courier/models/journey_publish_params.rbi +35 -0
  72. data/rbi/courier/models/journey_publish_request.rbi +28 -0
  73. data/rbi/courier/models/journey_replace_params.rbi +35 -0
  74. data/rbi/courier/models/journey_response.rbi +108 -0
  75. data/rbi/courier/models/journey_retrieve_params.rbi +52 -0
  76. data/rbi/courier/models/journey_segment_trigger_node.rbi +200 -0
  77. data/rbi/courier/models/journey_send_node.rbi +254 -0
  78. data/rbi/courier/models/journey_state.rbi +20 -0
  79. data/rbi/courier/models/journey_template_create_request.rbi +381 -0
  80. data/rbi/courier/models/journey_template_get_response.rbi +334 -0
  81. data/rbi/courier/models/journey_template_list_response.rbi +45 -0
  82. data/rbi/courier/models/journey_template_publish_request.rbi +31 -0
  83. data/rbi/courier/models/journey_template_replace_request.rbi +368 -0
  84. data/rbi/courier/models/journey_template_summary.rbi +85 -0
  85. data/rbi/courier/models/journey_throttle_dynamic_node.rbi +162 -0
  86. data/rbi/courier/models/journey_throttle_static_node.rbi +158 -0
  87. data/rbi/courier/models/journey_version_item.rbi +54 -0
  88. data/rbi/courier/models/journey_versions_list_response.rbi +45 -0
  89. data/rbi/courier/models/journeys/template_archive_params.rbi +48 -0
  90. data/rbi/courier/models/journeys/template_create_params.rbi +40 -0
  91. data/rbi/courier/models/journeys/template_list_params.rbi +68 -0
  92. data/rbi/courier/models/journeys/template_list_versions_params.rbi +48 -0
  93. data/rbi/courier/models/journeys/template_publish_params.rbi +48 -0
  94. data/rbi/courier/models/journeys/template_replace_params.rbi +48 -0
  95. data/rbi/courier/models/journeys/template_retrieve_params.rbi +48 -0
  96. data/rbi/courier/models/tenants/template_delete_params.rbi +48 -0
  97. data/rbi/courier/models.rbi +76 -0
  98. data/rbi/courier/resources/journeys/templates.rbi +160 -0
  99. data/rbi/courier/resources/journeys.rbi +156 -3
  100. data/rbi/courier/resources/tenants/templates.rbi +22 -0
  101. data/sig/courier/models/create_journey_request.rbs +41 -0
  102. data/sig/courier/models/journey_ai_node.rbs +72 -0
  103. data/sig/courier/models/journey_api_invoke_trigger_node.rbs +68 -0
  104. data/sig/courier/models/journey_archive_params.rbs +23 -0
  105. data/sig/courier/models/journey_condition_atom.rbs +7 -0
  106. data/sig/courier/models/journey_condition_group.rbs +33 -0
  107. data/sig/courier/models/journey_condition_nested_group.rbs +33 -0
  108. data/sig/courier/models/journey_conditions_field.rbs +14 -0
  109. data/sig/courier/models/journey_create_params.rbs +15 -0
  110. data/sig/courier/models/journey_delay_duration_node.rbs +66 -0
  111. data/sig/courier/models/journey_delay_until_node.rbs +66 -0
  112. data/sig/courier/models/journey_exit_node.rbs +34 -0
  113. data/sig/courier/models/journey_fetch_get_delete_node.rbs +93 -0
  114. data/sig/courier/models/journey_fetch_post_put_node.rbs +100 -0
  115. data/sig/courier/models/journey_list_versions_params.rbs +23 -0
  116. data/sig/courier/models/journey_merge_strategy.rbs +16 -0
  117. data/sig/courier/models/journey_node.rbs +117 -0
  118. data/sig/courier/models/journey_publish_params.rbs +25 -0
  119. data/sig/courier/models/journey_publish_request.rbs +15 -0
  120. data/sig/courier/models/journey_replace_params.rbs +25 -0
  121. data/sig/courier/models/journey_response.rbs +65 -0
  122. data/sig/courier/models/journey_retrieve_params.rbs +30 -0
  123. data/sig/courier/models/journey_segment_trigger_node.rbs +85 -0
  124. data/sig/courier/models/journey_send_node.rbs +140 -0
  125. data/sig/courier/models/journey_state.rbs +14 -0
  126. data/sig/courier/models/journey_template_create_request.rbs +148 -0
  127. data/sig/courier/models/journey_template_get_response.rbs +157 -0
  128. data/sig/courier/models/journey_template_list_response.rbs +25 -0
  129. data/sig/courier/models/journey_template_publish_request.rbs +15 -0
  130. data/sig/courier/models/journey_template_replace_request.rbs +136 -0
  131. data/sig/courier/models/journey_template_summary.rbs +59 -0
  132. data/sig/courier/models/journey_throttle_dynamic_node.rbs +76 -0
  133. data/sig/courier/models/journey_throttle_static_node.rbs +72 -0
  134. data/sig/courier/models/journey_version_item.rbs +40 -0
  135. data/sig/courier/models/journey_versions_list_response.rbs +22 -0
  136. data/sig/courier/models/journeys/template_archive_params.rbs +30 -0
  137. data/sig/courier/models/journeys/template_create_params.rbs +27 -0
  138. data/sig/courier/models/journeys/template_list_params.rbs +38 -0
  139. data/sig/courier/models/journeys/template_list_versions_params.rbs +30 -0
  140. data/sig/courier/models/journeys/template_publish_params.rbs +34 -0
  141. data/sig/courier/models/journeys/template_replace_params.rbs +34 -0
  142. data/sig/courier/models/journeys/template_retrieve_params.rbs +30 -0
  143. data/sig/courier/models/tenants/template_delete_params.rbs +30 -0
  144. data/sig/courier/models.rbs +72 -0
  145. data/sig/courier/resources/journeys/templates.rbs +58 -0
  146. data/sig/courier/resources/journeys.rbs +41 -0
  147. data/sig/courier/resources/tenants/templates.rbs +6 -0
  148. metadata +134 -2
@@ -0,0 +1,368 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyTemplateReplaceRequest < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::JourneyTemplateReplaceRequest,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(Courier::JourneyTemplateReplaceRequest::Notification) }
15
+ attr_reader :notification
16
+
17
+ sig do
18
+ params(
19
+ notification:
20
+ Courier::JourneyTemplateReplaceRequest::Notification::OrHash
21
+ ).void
22
+ end
23
+ attr_writer :notification
24
+
25
+ sig { returns(T.nilable(String)) }
26
+ attr_reader :state
27
+
28
+ sig { params(state: String).void }
29
+ attr_writer :state
30
+
31
+ # Request body for replacing a journey-scoped notification template draft.
32
+ sig do
33
+ params(
34
+ notification:
35
+ Courier::JourneyTemplateReplaceRequest::Notification::OrHash,
36
+ state: String
37
+ ).returns(T.attached_class)
38
+ end
39
+ def self.new(notification:, state: nil)
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ {
45
+ notification: Courier::JourneyTemplateReplaceRequest::Notification,
46
+ state: String
47
+ }
48
+ )
49
+ end
50
+ def to_hash
51
+ end
52
+
53
+ class Notification < Courier::Internal::Type::BaseModel
54
+ OrHash =
55
+ T.type_alias do
56
+ T.any(
57
+ Courier::JourneyTemplateReplaceRequest::Notification,
58
+ Courier::Internal::AnyHash
59
+ )
60
+ end
61
+
62
+ sig do
63
+ returns(
64
+ T.nilable(
65
+ Courier::JourneyTemplateReplaceRequest::Notification::Brand
66
+ )
67
+ )
68
+ end
69
+ attr_reader :brand
70
+
71
+ sig do
72
+ params(
73
+ brand:
74
+ T.nilable(
75
+ Courier::JourneyTemplateReplaceRequest::Notification::Brand::OrHash
76
+ )
77
+ ).void
78
+ end
79
+ attr_writer :brand
80
+
81
+ sig do
82
+ returns(Courier::JourneyTemplateReplaceRequest::Notification::Content)
83
+ end
84
+ attr_reader :content
85
+
86
+ sig do
87
+ params(
88
+ content:
89
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::OrHash
90
+ ).void
91
+ end
92
+ attr_writer :content
93
+
94
+ sig { returns(String) }
95
+ attr_accessor :name
96
+
97
+ sig do
98
+ returns(
99
+ T.nilable(
100
+ Courier::JourneyTemplateReplaceRequest::Notification::Subscription
101
+ )
102
+ )
103
+ end
104
+ attr_reader :subscription
105
+
106
+ sig do
107
+ params(
108
+ subscription:
109
+ T.nilable(
110
+ Courier::JourneyTemplateReplaceRequest::Notification::Subscription::OrHash
111
+ )
112
+ ).void
113
+ end
114
+ attr_writer :subscription
115
+
116
+ sig { returns(T::Array[String]) }
117
+ attr_accessor :tags
118
+
119
+ sig do
120
+ params(
121
+ brand:
122
+ T.nilable(
123
+ Courier::JourneyTemplateReplaceRequest::Notification::Brand::OrHash
124
+ ),
125
+ content:
126
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::OrHash,
127
+ name: String,
128
+ subscription:
129
+ T.nilable(
130
+ Courier::JourneyTemplateReplaceRequest::Notification::Subscription::OrHash
131
+ ),
132
+ tags: T::Array[String]
133
+ ).returns(T.attached_class)
134
+ end
135
+ def self.new(brand:, content:, name:, subscription:, tags:)
136
+ end
137
+
138
+ sig do
139
+ override.returns(
140
+ {
141
+ brand:
142
+ T.nilable(
143
+ Courier::JourneyTemplateReplaceRequest::Notification::Brand
144
+ ),
145
+ content:
146
+ Courier::JourneyTemplateReplaceRequest::Notification::Content,
147
+ name: String,
148
+ subscription:
149
+ T.nilable(
150
+ Courier::JourneyTemplateReplaceRequest::Notification::Subscription
151
+ ),
152
+ tags: T::Array[String]
153
+ }
154
+ )
155
+ end
156
+ def to_hash
157
+ end
158
+
159
+ class Brand < Courier::Internal::Type::BaseModel
160
+ OrHash =
161
+ T.type_alias do
162
+ T.any(
163
+ Courier::JourneyTemplateReplaceRequest::Notification::Brand,
164
+ Courier::Internal::AnyHash
165
+ )
166
+ end
167
+
168
+ sig { returns(String) }
169
+ attr_accessor :id
170
+
171
+ sig { params(id: String).returns(T.attached_class) }
172
+ def self.new(id:)
173
+ end
174
+
175
+ sig { override.returns({ id: String }) }
176
+ def to_hash
177
+ end
178
+ end
179
+
180
+ class Content < Courier::Internal::Type::BaseModel
181
+ OrHash =
182
+ T.type_alias do
183
+ T.any(
184
+ Courier::JourneyTemplateReplaceRequest::Notification::Content,
185
+ Courier::Internal::AnyHash
186
+ )
187
+ end
188
+
189
+ sig do
190
+ returns(
191
+ T::Array[
192
+ T.any(
193
+ Courier::ElementalTextNodeWithType,
194
+ Courier::ElementalMetaNodeWithType,
195
+ Courier::ElementalChannelNodeWithType,
196
+ Courier::ElementalImageNodeWithType,
197
+ Courier::ElementalActionNodeWithType,
198
+ Courier::ElementalDividerNodeWithType,
199
+ Courier::ElementalQuoteNodeWithType,
200
+ Courier::ElementalHTMLNodeWithType
201
+ )
202
+ ]
203
+ )
204
+ end
205
+ attr_accessor :elements
206
+
207
+ sig do
208
+ returns(
209
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Version::OrSymbol
210
+ )
211
+ end
212
+ attr_accessor :version
213
+
214
+ sig do
215
+ returns(
216
+ T.nilable(
217
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope::OrSymbol
218
+ )
219
+ )
220
+ end
221
+ attr_reader :scope
222
+
223
+ sig do
224
+ params(
225
+ scope:
226
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope::OrSymbol
227
+ ).void
228
+ end
229
+ attr_writer :scope
230
+
231
+ sig do
232
+ params(
233
+ elements:
234
+ T::Array[
235
+ T.any(
236
+ Courier::ElementalTextNodeWithType::OrHash,
237
+ Courier::ElementalMetaNodeWithType::OrHash,
238
+ Courier::ElementalChannelNodeWithType::OrHash,
239
+ Courier::ElementalImageNodeWithType::OrHash,
240
+ Courier::ElementalActionNodeWithType::OrHash,
241
+ Courier::ElementalDividerNodeWithType::OrHash,
242
+ Courier::ElementalQuoteNodeWithType::OrHash,
243
+ Courier::ElementalHTMLNodeWithType::OrHash
244
+ )
245
+ ],
246
+ version:
247
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Version::OrSymbol,
248
+ scope:
249
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope::OrSymbol
250
+ ).returns(T.attached_class)
251
+ end
252
+ def self.new(elements:, version:, scope: nil)
253
+ end
254
+
255
+ sig do
256
+ override.returns(
257
+ {
258
+ elements:
259
+ T::Array[
260
+ T.any(
261
+ Courier::ElementalTextNodeWithType,
262
+ Courier::ElementalMetaNodeWithType,
263
+ Courier::ElementalChannelNodeWithType,
264
+ Courier::ElementalImageNodeWithType,
265
+ Courier::ElementalActionNodeWithType,
266
+ Courier::ElementalDividerNodeWithType,
267
+ Courier::ElementalQuoteNodeWithType,
268
+ Courier::ElementalHTMLNodeWithType
269
+ )
270
+ ],
271
+ version:
272
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Version::OrSymbol,
273
+ scope:
274
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope::OrSymbol
275
+ }
276
+ )
277
+ end
278
+ def to_hash
279
+ end
280
+
281
+ module Version
282
+ extend Courier::Internal::Type::Enum
283
+
284
+ TaggedSymbol =
285
+ T.type_alias do
286
+ T.all(
287
+ Symbol,
288
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Version
289
+ )
290
+ end
291
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
292
+
293
+ VERSION_2022_01_01 =
294
+ T.let(
295
+ :"2022-01-01",
296
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Version::TaggedSymbol
297
+ )
298
+
299
+ sig do
300
+ override.returns(
301
+ T::Array[
302
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Version::TaggedSymbol
303
+ ]
304
+ )
305
+ end
306
+ def self.values
307
+ end
308
+ end
309
+
310
+ module Scope
311
+ extend Courier::Internal::Type::Enum
312
+
313
+ TaggedSymbol =
314
+ T.type_alias do
315
+ T.all(
316
+ Symbol,
317
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope
318
+ )
319
+ end
320
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
321
+
322
+ DEFAULT =
323
+ T.let(
324
+ :default,
325
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope::TaggedSymbol
326
+ )
327
+ STRICT =
328
+ T.let(
329
+ :strict,
330
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope::TaggedSymbol
331
+ )
332
+
333
+ sig do
334
+ override.returns(
335
+ T::Array[
336
+ Courier::JourneyTemplateReplaceRequest::Notification::Content::Scope::TaggedSymbol
337
+ ]
338
+ )
339
+ end
340
+ def self.values
341
+ end
342
+ end
343
+ end
344
+
345
+ class Subscription < Courier::Internal::Type::BaseModel
346
+ OrHash =
347
+ T.type_alias do
348
+ T.any(
349
+ Courier::JourneyTemplateReplaceRequest::Notification::Subscription,
350
+ Courier::Internal::AnyHash
351
+ )
352
+ end
353
+
354
+ sig { returns(String) }
355
+ attr_accessor :topic_id
356
+
357
+ sig { params(topic_id: String).returns(T.attached_class) }
358
+ def self.new(topic_id:)
359
+ end
360
+
361
+ sig { override.returns({ topic_id: String }) }
362
+ def to_hash
363
+ end
364
+ end
365
+ end
366
+ end
367
+ end
368
+ end
@@ -0,0 +1,85 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyTemplateSummary < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyTemplateSummary, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :id
13
+
14
+ sig { returns(Integer) }
15
+ attr_accessor :created
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :creator
19
+
20
+ sig { returns(String) }
21
+ attr_accessor :name
22
+
23
+ sig { returns(String) }
24
+ attr_accessor :state
25
+
26
+ sig { returns(T::Array[String]) }
27
+ attr_accessor :tags
28
+
29
+ sig { returns(T.nilable(Integer)) }
30
+ attr_reader :updated
31
+
32
+ sig { params(updated: Integer).void }
33
+ attr_writer :updated
34
+
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :updater
37
+
38
+ sig { params(updater: String).void }
39
+ attr_writer :updater
40
+
41
+ # Summary fields of a journey-scoped notification template returned in list
42
+ # responses.
43
+ sig do
44
+ params(
45
+ id: String,
46
+ created: Integer,
47
+ creator: String,
48
+ name: String,
49
+ state: String,
50
+ tags: T::Array[String],
51
+ updated: Integer,
52
+ updater: String
53
+ ).returns(T.attached_class)
54
+ end
55
+ def self.new(
56
+ id:,
57
+ created:,
58
+ creator:,
59
+ name:,
60
+ state:,
61
+ tags:,
62
+ updated: nil,
63
+ updater: nil
64
+ )
65
+ end
66
+
67
+ sig do
68
+ override.returns(
69
+ {
70
+ id: String,
71
+ created: Integer,
72
+ creator: String,
73
+ name: String,
74
+ state: String,
75
+ tags: T::Array[String],
76
+ updated: Integer,
77
+ updater: String
78
+ }
79
+ )
80
+ end
81
+ def to_hash
82
+ end
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,162 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyThrottleDynamicNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyThrottleDynamicNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Integer) }
12
+ attr_accessor :max_allowed
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :period
16
+
17
+ sig { returns(Courier::JourneyThrottleDynamicNode::Scope::OrSymbol) }
18
+ attr_accessor :scope
19
+
20
+ sig { returns(String) }
21
+ attr_accessor :throttle_key
22
+
23
+ sig { returns(Courier::JourneyThrottleDynamicNode::Type::OrSymbol) }
24
+ attr_accessor :type
25
+
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :id
28
+
29
+ sig { params(id: String).void }
30
+ attr_writer :id
31
+
32
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
33
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
34
+ # express "no conditions".
35
+ sig do
36
+ returns(
37
+ T.nilable(
38
+ T.any(
39
+ T::Array[String],
40
+ Courier::JourneyConditionGroup,
41
+ Courier::JourneyConditionNestedGroup
42
+ )
43
+ )
44
+ )
45
+ end
46
+ attr_reader :conditions
47
+
48
+ sig do
49
+ params(
50
+ conditions:
51
+ T.any(
52
+ T::Array[String],
53
+ Courier::JourneyConditionGroup::OrHash,
54
+ Courier::JourneyConditionNestedGroup::OrHash
55
+ )
56
+ ).void
57
+ end
58
+ attr_writer :conditions
59
+
60
+ # Throttle the journey by a dynamic `throttle_key`, allowing at most `max_allowed`
61
+ # invocations per `period`.
62
+ sig do
63
+ params(
64
+ max_allowed: Integer,
65
+ period: String,
66
+ scope: Courier::JourneyThrottleDynamicNode::Scope::OrSymbol,
67
+ throttle_key: String,
68
+ type: Courier::JourneyThrottleDynamicNode::Type::OrSymbol,
69
+ id: String,
70
+ conditions:
71
+ T.any(
72
+ T::Array[String],
73
+ Courier::JourneyConditionGroup::OrHash,
74
+ Courier::JourneyConditionNestedGroup::OrHash
75
+ )
76
+ ).returns(T.attached_class)
77
+ end
78
+ def self.new(
79
+ max_allowed:,
80
+ period:,
81
+ scope:,
82
+ throttle_key:,
83
+ type:,
84
+ id: nil,
85
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
86
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
87
+ # express "no conditions".
88
+ conditions: nil
89
+ )
90
+ end
91
+
92
+ sig do
93
+ override.returns(
94
+ {
95
+ max_allowed: Integer,
96
+ period: String,
97
+ scope: Courier::JourneyThrottleDynamicNode::Scope::OrSymbol,
98
+ throttle_key: String,
99
+ type: Courier::JourneyThrottleDynamicNode::Type::OrSymbol,
100
+ id: String,
101
+ conditions:
102
+ T.any(
103
+ T::Array[String],
104
+ Courier::JourneyConditionGroup,
105
+ Courier::JourneyConditionNestedGroup
106
+ )
107
+ }
108
+ )
109
+ end
110
+ def to_hash
111
+ end
112
+
113
+ module Scope
114
+ extend Courier::Internal::Type::Enum
115
+
116
+ TaggedSymbol =
117
+ T.type_alias do
118
+ T.all(Symbol, Courier::JourneyThrottleDynamicNode::Scope)
119
+ end
120
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
121
+
122
+ DYNAMIC =
123
+ T.let(
124
+ :dynamic,
125
+ Courier::JourneyThrottleDynamicNode::Scope::TaggedSymbol
126
+ )
127
+
128
+ sig do
129
+ override.returns(
130
+ T::Array[Courier::JourneyThrottleDynamicNode::Scope::TaggedSymbol]
131
+ )
132
+ end
133
+ def self.values
134
+ end
135
+ end
136
+
137
+ module Type
138
+ extend Courier::Internal::Type::Enum
139
+
140
+ TaggedSymbol =
141
+ T.type_alias do
142
+ T.all(Symbol, Courier::JourneyThrottleDynamicNode::Type)
143
+ end
144
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
145
+
146
+ THROTTLE =
147
+ T.let(
148
+ :throttle,
149
+ Courier::JourneyThrottleDynamicNode::Type::TaggedSymbol
150
+ )
151
+
152
+ sig do
153
+ override.returns(
154
+ T::Array[Courier::JourneyThrottleDynamicNode::Type::TaggedSymbol]
155
+ )
156
+ end
157
+ def self.values
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end