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,190 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyFetchPostPutNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyFetchPostPutNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # Strategy for merging a fetch response into the journey run state.
12
+ sig { returns(Courier::JourneyMergeStrategy::OrSymbol) }
13
+ attr_accessor :merge_strategy
14
+
15
+ sig { returns(Courier::JourneyFetchPostPutNode::Method::OrSymbol) }
16
+ attr_accessor :method_
17
+
18
+ sig { returns(Courier::JourneyFetchPostPutNode::Type::OrSymbol) }
19
+ attr_accessor :type
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :url
23
+
24
+ sig { returns(T.nilable(String)) }
25
+ attr_reader :id
26
+
27
+ sig { params(id: String).void }
28
+ attr_writer :id
29
+
30
+ sig { returns(T.nilable(String)) }
31
+ attr_reader :body
32
+
33
+ sig { params(body: String).void }
34
+ attr_writer :body
35
+
36
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
37
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
38
+ # express "no conditions".
39
+ sig do
40
+ returns(
41
+ T.nilable(
42
+ T.any(
43
+ T::Array[String],
44
+ Courier::JourneyConditionGroup,
45
+ Courier::JourneyConditionNestedGroup
46
+ )
47
+ )
48
+ )
49
+ end
50
+ attr_reader :conditions
51
+
52
+ sig do
53
+ params(
54
+ conditions:
55
+ T.any(
56
+ T::Array[String],
57
+ Courier::JourneyConditionGroup::OrHash,
58
+ Courier::JourneyConditionNestedGroup::OrHash
59
+ )
60
+ ).void
61
+ end
62
+ attr_writer :conditions
63
+
64
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
65
+ attr_reader :headers
66
+
67
+ sig { params(headers: T::Hash[Symbol, String]).void }
68
+ attr_writer :headers
69
+
70
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
71
+ attr_reader :query_params
72
+
73
+ sig { params(query_params: T::Hash[Symbol, String]).void }
74
+ attr_writer :query_params
75
+
76
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
77
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
78
+ attr_reader :response_schema
79
+
80
+ sig { params(response_schema: T::Hash[Symbol, T.anything]).void }
81
+ attr_writer :response_schema
82
+
83
+ # Issue an HTTP POST or PUT request with a `body` and merge the response into the
84
+ # journey state per `merge_strategy`.
85
+ sig do
86
+ params(
87
+ merge_strategy: Courier::JourneyMergeStrategy::OrSymbol,
88
+ method_: Courier::JourneyFetchPostPutNode::Method::OrSymbol,
89
+ type: Courier::JourneyFetchPostPutNode::Type::OrSymbol,
90
+ url: String,
91
+ id: String,
92
+ body: String,
93
+ conditions:
94
+ T.any(
95
+ T::Array[String],
96
+ Courier::JourneyConditionGroup::OrHash,
97
+ Courier::JourneyConditionNestedGroup::OrHash
98
+ ),
99
+ headers: T::Hash[Symbol, String],
100
+ query_params: T::Hash[Symbol, String],
101
+ response_schema: T::Hash[Symbol, T.anything]
102
+ ).returns(T.attached_class)
103
+ end
104
+ def self.new(
105
+ # Strategy for merging a fetch response into the journey run state.
106
+ merge_strategy:,
107
+ method_:,
108
+ type:,
109
+ url:,
110
+ id: nil,
111
+ body: nil,
112
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
113
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
114
+ # express "no conditions".
115
+ conditions: nil,
116
+ headers: nil,
117
+ query_params: nil,
118
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
119
+ response_schema: nil
120
+ )
121
+ end
122
+
123
+ sig do
124
+ override.returns(
125
+ {
126
+ merge_strategy: Courier::JourneyMergeStrategy::OrSymbol,
127
+ method_: Courier::JourneyFetchPostPutNode::Method::OrSymbol,
128
+ type: Courier::JourneyFetchPostPutNode::Type::OrSymbol,
129
+ url: String,
130
+ id: String,
131
+ body: String,
132
+ conditions:
133
+ T.any(
134
+ T::Array[String],
135
+ Courier::JourneyConditionGroup,
136
+ Courier::JourneyConditionNestedGroup
137
+ ),
138
+ headers: T::Hash[Symbol, String],
139
+ query_params: T::Hash[Symbol, String],
140
+ response_schema: T::Hash[Symbol, T.anything]
141
+ }
142
+ )
143
+ end
144
+ def to_hash
145
+ end
146
+
147
+ module Method
148
+ extend Courier::Internal::Type::Enum
149
+
150
+ TaggedSymbol =
151
+ T.type_alias do
152
+ T.all(Symbol, Courier::JourneyFetchPostPutNode::Method)
153
+ end
154
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
155
+
156
+ POST =
157
+ T.let(:post, Courier::JourneyFetchPostPutNode::Method::TaggedSymbol)
158
+ PUT =
159
+ T.let(:put, Courier::JourneyFetchPostPutNode::Method::TaggedSymbol)
160
+
161
+ sig do
162
+ override.returns(
163
+ T::Array[Courier::JourneyFetchPostPutNode::Method::TaggedSymbol]
164
+ )
165
+ end
166
+ def self.values
167
+ end
168
+ end
169
+
170
+ module Type
171
+ extend Courier::Internal::Type::Enum
172
+
173
+ TaggedSymbol =
174
+ T.type_alias { T.all(Symbol, Courier::JourneyFetchPostPutNode::Type) }
175
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
176
+
177
+ FETCH =
178
+ T.let(:fetch, Courier::JourneyFetchPostPutNode::Type::TaggedSymbol)
179
+
180
+ sig do
181
+ override.returns(
182
+ T::Array[Courier::JourneyFetchPostPutNode::Type::TaggedSymbol]
183
+ )
184
+ end
185
+ def self.values
186
+ end
187
+ end
188
+ end
189
+ end
190
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyListVersionsParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::JourneyListVersionsParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :template_id
16
+
17
+ sig do
18
+ params(
19
+ template_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(template_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { template_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ # Strategy for merging a fetch response into the journey run state.
6
+ module JourneyMergeStrategy
7
+ extend Courier::Internal::Type::Enum
8
+
9
+ TaggedSymbol =
10
+ T.type_alias { T.all(Symbol, Courier::JourneyMergeStrategy) }
11
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
12
+
13
+ OVERWRITE = T.let(:overwrite, Courier::JourneyMergeStrategy::TaggedSymbol)
14
+ SOFT_MERGE =
15
+ T.let(:"soft-merge", Courier::JourneyMergeStrategy::TaggedSymbol)
16
+ REPLACE = T.let(:replace, Courier::JourneyMergeStrategy::TaggedSymbol)
17
+ NONE = T.let(:none, Courier::JourneyMergeStrategy::TaggedSymbol)
18
+
19
+ sig do
20
+ override.returns(T::Array[Courier::JourneyMergeStrategy::TaggedSymbol])
21
+ end
22
+ def self.values
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,227 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ # A single node in a journey DAG. Discriminated by `type`, with a secondary
6
+ # discriminator on some variants (`trigger_type` for trigger, `mode` for delay,
7
+ # `method` for fetch, `scope` for throttle).
8
+ module JourneyNode
9
+ extend Courier::Internal::Type::Union
10
+
11
+ Variants =
12
+ T.type_alias do
13
+ T.any(
14
+ Courier::JourneyAPIInvokeTriggerNode,
15
+ Courier::JourneySegmentTriggerNode,
16
+ Courier::JourneySendNode,
17
+ Courier::JourneyDelayDurationNode,
18
+ Courier::JourneyDelayUntilNode,
19
+ Courier::JourneyFetchGetDeleteNode,
20
+ Courier::JourneyFetchPostPutNode,
21
+ Courier::JourneyAINode,
22
+ Courier::JourneyThrottleStaticNode,
23
+ Courier::JourneyThrottleDynamicNode,
24
+ Courier::JourneyExitNode,
25
+ Courier::JourneyNode::JourneyBranchNode
26
+ )
27
+ end
28
+
29
+ class JourneyBranchNode < Courier::Internal::Type::BaseModel
30
+ OrHash =
31
+ T.type_alias do
32
+ T.any(
33
+ Courier::JourneyNode::JourneyBranchNode,
34
+ Courier::Internal::AnyHash
35
+ )
36
+ end
37
+
38
+ sig { returns(Courier::JourneyNode::JourneyBranchNode::Default) }
39
+ attr_reader :default
40
+
41
+ sig do
42
+ params(
43
+ default: Courier::JourneyNode::JourneyBranchNode::Default::OrHash
44
+ ).void
45
+ end
46
+ attr_writer :default
47
+
48
+ sig { returns(T::Array[Courier::JourneyNode::JourneyBranchNode::Path]) }
49
+ attr_accessor :paths
50
+
51
+ sig { returns(Courier::JourneyNode::JourneyBranchNode::Type::OrSymbol) }
52
+ attr_accessor :type
53
+
54
+ sig { returns(T.nilable(String)) }
55
+ attr_reader :id
56
+
57
+ sig { params(id: String).void }
58
+ attr_writer :id
59
+
60
+ # Branch node. Routes to the first entry in `paths[]` whose `conditions` match,
61
+ # else falls through to `default.nodes`.
62
+ sig do
63
+ params(
64
+ default: Courier::JourneyNode::JourneyBranchNode::Default::OrHash,
65
+ paths:
66
+ T::Array[Courier::JourneyNode::JourneyBranchNode::Path::OrHash],
67
+ type: Courier::JourneyNode::JourneyBranchNode::Type::OrSymbol,
68
+ id: String
69
+ ).returns(T.attached_class)
70
+ end
71
+ def self.new(default:, paths:, type:, id: nil)
72
+ end
73
+
74
+ sig do
75
+ override.returns(
76
+ {
77
+ default: Courier::JourneyNode::JourneyBranchNode::Default,
78
+ paths: T::Array[Courier::JourneyNode::JourneyBranchNode::Path],
79
+ type: Courier::JourneyNode::JourneyBranchNode::Type::OrSymbol,
80
+ id: String
81
+ }
82
+ )
83
+ end
84
+ def to_hash
85
+ end
86
+
87
+ class Default < Courier::Internal::Type::BaseModel
88
+ OrHash =
89
+ T.type_alias do
90
+ T.any(
91
+ Courier::JourneyNode::JourneyBranchNode::Default,
92
+ Courier::Internal::AnyHash
93
+ )
94
+ end
95
+
96
+ sig { returns(T::Array[Courier::JourneyNode]) }
97
+ attr_accessor :nodes
98
+
99
+ sig { returns(T.nilable(String)) }
100
+ attr_reader :label
101
+
102
+ sig { params(label: String).void }
103
+ attr_writer :label
104
+
105
+ sig do
106
+ params(
107
+ nodes: T::Array[Courier::JourneyNode],
108
+ label: String
109
+ ).returns(T.attached_class)
110
+ end
111
+ def self.new(nodes:, label: nil)
112
+ end
113
+
114
+ sig do
115
+ override.returns(
116
+ { nodes: T::Array[Courier::JourneyNode], label: String }
117
+ )
118
+ end
119
+ def to_hash
120
+ end
121
+ end
122
+
123
+ class Path < Courier::Internal::Type::BaseModel
124
+ OrHash =
125
+ T.type_alias do
126
+ T.any(
127
+ Courier::JourneyNode::JourneyBranchNode::Path,
128
+ Courier::Internal::AnyHash
129
+ )
130
+ end
131
+
132
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
133
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
134
+ # express "no conditions".
135
+ sig do
136
+ returns(
137
+ T.any(
138
+ T::Array[String],
139
+ Courier::JourneyConditionGroup,
140
+ Courier::JourneyConditionNestedGroup
141
+ )
142
+ )
143
+ end
144
+ attr_accessor :conditions
145
+
146
+ sig { returns(T::Array[Courier::JourneyNode]) }
147
+ attr_accessor :nodes
148
+
149
+ sig { returns(T.nilable(String)) }
150
+ attr_reader :label
151
+
152
+ sig { params(label: String).void }
153
+ attr_writer :label
154
+
155
+ sig do
156
+ params(
157
+ conditions:
158
+ T.any(
159
+ T::Array[String],
160
+ Courier::JourneyConditionGroup::OrHash,
161
+ Courier::JourneyConditionNestedGroup::OrHash
162
+ ),
163
+ nodes: T::Array[Courier::JourneyNode],
164
+ label: String
165
+ ).returns(T.attached_class)
166
+ end
167
+ def self.new(
168
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
169
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
170
+ # express "no conditions".
171
+ conditions:,
172
+ nodes:,
173
+ label: nil
174
+ )
175
+ end
176
+
177
+ sig do
178
+ override.returns(
179
+ {
180
+ conditions:
181
+ T.any(
182
+ T::Array[String],
183
+ Courier::JourneyConditionGroup,
184
+ Courier::JourneyConditionNestedGroup
185
+ ),
186
+ nodes: T::Array[Courier::JourneyNode],
187
+ label: String
188
+ }
189
+ )
190
+ end
191
+ def to_hash
192
+ end
193
+ end
194
+
195
+ module Type
196
+ extend Courier::Internal::Type::Enum
197
+
198
+ TaggedSymbol =
199
+ T.type_alias do
200
+ T.all(Symbol, Courier::JourneyNode::JourneyBranchNode::Type)
201
+ end
202
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
203
+
204
+ BRANCH =
205
+ T.let(
206
+ :branch,
207
+ Courier::JourneyNode::JourneyBranchNode::Type::TaggedSymbol
208
+ )
209
+
210
+ sig do
211
+ override.returns(
212
+ T::Array[
213
+ Courier::JourneyNode::JourneyBranchNode::Type::TaggedSymbol
214
+ ]
215
+ )
216
+ end
217
+ def self.values
218
+ end
219
+ end
220
+ end
221
+
222
+ sig { override.returns(T::Array[Courier::JourneyNode::Variants]) }
223
+ def self.variants
224
+ end
225
+ end
226
+ end
227
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyPublishParams < Courier::Models::JourneyPublishRequest
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::JourneyPublishParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :template_id
16
+
17
+ sig do
18
+ params(
19
+ template_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(template_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { template_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,28 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyPublishRequest < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyPublishRequest, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T.nilable(String)) }
12
+ attr_reader :version
13
+
14
+ sig { params(version: String).void }
15
+ attr_writer :version
16
+
17
+ # Request body for publishing a journey. Pass `version` to roll back to a prior
18
+ # version; omit to publish the current draft.
19
+ sig { params(version: String).returns(T.attached_class) }
20
+ def self.new(version: nil)
21
+ end
22
+
23
+ sig { override.returns({ version: String }) }
24
+ def to_hash
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyReplaceParams < Courier::Models::CreateJourneyRequest
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::JourneyReplaceParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :template_id
16
+
17
+ sig do
18
+ params(
19
+ template_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(template_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { template_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,108 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyResponse, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :id
13
+
14
+ sig { returns(T.nilable(Integer)) }
15
+ attr_accessor :created
16
+
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :creator
19
+
20
+ sig { returns(T::Boolean) }
21
+ attr_accessor :enabled
22
+
23
+ sig { returns(String) }
24
+ attr_accessor :name
25
+
26
+ sig { returns(T::Array[Courier::JourneyNode::Variants]) }
27
+ attr_accessor :nodes
28
+
29
+ sig { returns(T.nilable(Integer)) }
30
+ attr_accessor :published
31
+
32
+ # Lifecycle state of a journey.
33
+ sig { returns(Courier::JourneyState::TaggedSymbol) }
34
+ attr_accessor :state
35
+
36
+ sig { returns(T.nilable(Integer)) }
37
+ attr_accessor :updated
38
+
39
+ sig { returns(T.nilable(String)) }
40
+ attr_accessor :updater
41
+
42
+ # A journey, with its current draft or published nodes and metadata.
43
+ sig do
44
+ params(
45
+ id: String,
46
+ created: T.nilable(Integer),
47
+ creator: T.nilable(String),
48
+ enabled: T::Boolean,
49
+ name: String,
50
+ nodes:
51
+ T::Array[
52
+ T.any(
53
+ Courier::JourneyAPIInvokeTriggerNode::OrHash,
54
+ Courier::JourneySegmentTriggerNode::OrHash,
55
+ Courier::JourneySendNode::OrHash,
56
+ Courier::JourneyDelayDurationNode::OrHash,
57
+ Courier::JourneyDelayUntilNode::OrHash,
58
+ Courier::JourneyFetchGetDeleteNode::OrHash,
59
+ Courier::JourneyFetchPostPutNode::OrHash,
60
+ Courier::JourneyAINode::OrHash,
61
+ Courier::JourneyThrottleStaticNode::OrHash,
62
+ Courier::JourneyThrottleDynamicNode::OrHash,
63
+ Courier::JourneyExitNode::OrHash,
64
+ Courier::JourneyNode::JourneyBranchNode::OrHash
65
+ )
66
+ ],
67
+ published: T.nilable(Integer),
68
+ state: Courier::JourneyState::OrSymbol,
69
+ updated: T.nilable(Integer),
70
+ updater: T.nilable(String)
71
+ ).returns(T.attached_class)
72
+ end
73
+ def self.new(
74
+ id:,
75
+ created:,
76
+ creator:,
77
+ enabled:,
78
+ name:,
79
+ nodes:,
80
+ published:,
81
+ # Lifecycle state of a journey.
82
+ state:,
83
+ updated:,
84
+ updater:
85
+ )
86
+ end
87
+
88
+ sig do
89
+ override.returns(
90
+ {
91
+ id: String,
92
+ created: T.nilable(Integer),
93
+ creator: T.nilable(String),
94
+ enabled: T::Boolean,
95
+ name: String,
96
+ nodes: T::Array[Courier::JourneyNode::Variants],
97
+ published: T.nilable(Integer),
98
+ state: Courier::JourneyState::TaggedSymbol,
99
+ updated: T.nilable(Integer),
100
+ updater: T.nilable(String)
101
+ }
102
+ )
103
+ end
104
+ def to_hash
105
+ end
106
+ end
107
+ end
108
+ end