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