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,254 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneySendNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneySendNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Courier::JourneySendNode::Message) }
12
+ attr_reader :message
13
+
14
+ sig { params(message: Courier::JourneySendNode::Message::OrHash).void }
15
+ attr_writer :message
16
+
17
+ sig { returns(Courier::JourneySendNode::Type::OrSymbol) }
18
+ attr_accessor :type
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :id
22
+
23
+ sig { params(id: String).void }
24
+ attr_writer :id
25
+
26
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
27
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
28
+ # express "no conditions".
29
+ sig do
30
+ returns(
31
+ T.nilable(
32
+ T.any(
33
+ T::Array[String],
34
+ Courier::JourneyConditionGroup,
35
+ Courier::JourneyConditionNestedGroup
36
+ )
37
+ )
38
+ )
39
+ end
40
+ attr_reader :conditions
41
+
42
+ sig do
43
+ params(
44
+ conditions:
45
+ T.any(
46
+ T::Array[String],
47
+ Courier::JourneyConditionGroup::OrHash,
48
+ Courier::JourneyConditionNestedGroup::OrHash
49
+ )
50
+ ).void
51
+ end
52
+ attr_writer :conditions
53
+
54
+ # Send a notification template to the recipient. Optionally override the recipient
55
+ # address, delay the send, or attach `data`.
56
+ sig do
57
+ params(
58
+ message: Courier::JourneySendNode::Message::OrHash,
59
+ type: Courier::JourneySendNode::Type::OrSymbol,
60
+ id: String,
61
+ conditions:
62
+ T.any(
63
+ T::Array[String],
64
+ Courier::JourneyConditionGroup::OrHash,
65
+ Courier::JourneyConditionNestedGroup::OrHash
66
+ )
67
+ ).returns(T.attached_class)
68
+ end
69
+ def self.new(
70
+ message:,
71
+ type:,
72
+ id: nil,
73
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
74
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
75
+ # express "no conditions".
76
+ conditions: nil
77
+ )
78
+ end
79
+
80
+ sig do
81
+ override.returns(
82
+ {
83
+ message: Courier::JourneySendNode::Message,
84
+ type: Courier::JourneySendNode::Type::OrSymbol,
85
+ id: String,
86
+ conditions:
87
+ T.any(
88
+ T::Array[String],
89
+ Courier::JourneyConditionGroup,
90
+ Courier::JourneyConditionNestedGroup
91
+ )
92
+ }
93
+ )
94
+ end
95
+ def to_hash
96
+ end
97
+
98
+ class Message < Courier::Internal::Type::BaseModel
99
+ OrHash =
100
+ T.type_alias do
101
+ T.any(Courier::JourneySendNode::Message, Courier::Internal::AnyHash)
102
+ end
103
+
104
+ sig { returns(String) }
105
+ attr_accessor :template
106
+
107
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
108
+ attr_reader :data
109
+
110
+ sig { params(data: T::Hash[Symbol, T.anything]).void }
111
+ attr_writer :data
112
+
113
+ sig { returns(T.nilable(Courier::JourneySendNode::Message::Delay)) }
114
+ attr_reader :delay
115
+
116
+ sig do
117
+ params(delay: Courier::JourneySendNode::Message::Delay::OrHash).void
118
+ end
119
+ attr_writer :delay
120
+
121
+ sig { returns(T.nilable(Courier::JourneySendNode::Message::To)) }
122
+ attr_reader :to
123
+
124
+ sig { params(to: Courier::JourneySendNode::Message::To::OrHash).void }
125
+ attr_writer :to
126
+
127
+ sig do
128
+ params(
129
+ template: String,
130
+ data: T::Hash[Symbol, T.anything],
131
+ delay: Courier::JourneySendNode::Message::Delay::OrHash,
132
+ to: Courier::JourneySendNode::Message::To::OrHash
133
+ ).returns(T.attached_class)
134
+ end
135
+ def self.new(template:, data: nil, delay: nil, to: nil)
136
+ end
137
+
138
+ sig do
139
+ override.returns(
140
+ {
141
+ template: String,
142
+ data: T::Hash[Symbol, T.anything],
143
+ delay: Courier::JourneySendNode::Message::Delay,
144
+ to: Courier::JourneySendNode::Message::To
145
+ }
146
+ )
147
+ end
148
+ def to_hash
149
+ end
150
+
151
+ class Delay < Courier::Internal::Type::BaseModel
152
+ OrHash =
153
+ T.type_alias do
154
+ T.any(
155
+ Courier::JourneySendNode::Message::Delay,
156
+ Courier::Internal::AnyHash
157
+ )
158
+ end
159
+
160
+ sig { returns(String) }
161
+ attr_accessor :until_
162
+
163
+ sig { returns(T.nilable(String)) }
164
+ attr_reader :timezone
165
+
166
+ sig { params(timezone: String).void }
167
+ attr_writer :timezone
168
+
169
+ sig do
170
+ params(until_: String, timezone: String).returns(T.attached_class)
171
+ end
172
+ def self.new(until_:, timezone: nil)
173
+ end
174
+
175
+ sig { override.returns({ until_: String, timezone: String }) }
176
+ def to_hash
177
+ end
178
+ end
179
+
180
+ class To < Courier::Internal::Type::BaseModel
181
+ OrHash =
182
+ T.type_alias do
183
+ T.any(
184
+ Courier::JourneySendNode::Message::To,
185
+ Courier::Internal::AnyHash
186
+ )
187
+ end
188
+
189
+ sig { returns(T.nilable(String)) }
190
+ attr_reader :email_override
191
+
192
+ sig { params(email_override: String).void }
193
+ attr_writer :email_override
194
+
195
+ sig { returns(T.nilable(String)) }
196
+ attr_reader :phone_number_override
197
+
198
+ sig { params(phone_number_override: String).void }
199
+ attr_writer :phone_number_override
200
+
201
+ sig { returns(T.nilable(String)) }
202
+ attr_reader :user_id_override
203
+
204
+ sig { params(user_id_override: String).void }
205
+ attr_writer :user_id_override
206
+
207
+ sig do
208
+ params(
209
+ email_override: String,
210
+ phone_number_override: String,
211
+ user_id_override: String
212
+ ).returns(T.attached_class)
213
+ end
214
+ def self.new(
215
+ email_override: nil,
216
+ phone_number_override: nil,
217
+ user_id_override: nil
218
+ )
219
+ end
220
+
221
+ sig do
222
+ override.returns(
223
+ {
224
+ email_override: String,
225
+ phone_number_override: String,
226
+ user_id_override: String
227
+ }
228
+ )
229
+ end
230
+ def to_hash
231
+ end
232
+ end
233
+ end
234
+
235
+ module Type
236
+ extend Courier::Internal::Type::Enum
237
+
238
+ TaggedSymbol =
239
+ T.type_alias { T.all(Symbol, Courier::JourneySendNode::Type) }
240
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
241
+
242
+ SEND = T.let(:send, Courier::JourneySendNode::Type::TaggedSymbol)
243
+
244
+ sig do
245
+ override.returns(
246
+ T::Array[Courier::JourneySendNode::Type::TaggedSymbol]
247
+ )
248
+ end
249
+ def self.values
250
+ end
251
+ end
252
+ end
253
+ end
254
+ end
@@ -0,0 +1,20 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ # Lifecycle state of a journey.
6
+ module JourneyState
7
+ extend Courier::Internal::Type::Enum
8
+
9
+ TaggedSymbol = T.type_alias { T.all(Symbol, Courier::JourneyState) }
10
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
11
+
12
+ DRAFT = T.let(:DRAFT, Courier::JourneyState::TaggedSymbol)
13
+ PUBLISHED = T.let(:PUBLISHED, Courier::JourneyState::TaggedSymbol)
14
+
15
+ sig { override.returns(T::Array[Courier::JourneyState::TaggedSymbol]) }
16
+ def self.values
17
+ end
18
+ end
19
+ end
20
+ end
@@ -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