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,139 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyDelayUntilNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyDelayUntilNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Courier::JourneyDelayUntilNode::Mode::OrSymbol) }
12
+ attr_accessor :mode
13
+
14
+ sig { returns(Courier::JourneyDelayUntilNode::Type::OrSymbol) }
15
+ attr_accessor :type
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :until_
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
+ # Pause the journey run `until` a specific time.
55
+ sig do
56
+ params(
57
+ mode: Courier::JourneyDelayUntilNode::Mode::OrSymbol,
58
+ type: Courier::JourneyDelayUntilNode::Type::OrSymbol,
59
+ until_: String,
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
+ mode:,
71
+ type:,
72
+ until_:,
73
+ id: nil,
74
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
75
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
76
+ # express "no conditions".
77
+ conditions: nil
78
+ )
79
+ end
80
+
81
+ sig do
82
+ override.returns(
83
+ {
84
+ mode: Courier::JourneyDelayUntilNode::Mode::OrSymbol,
85
+ type: Courier::JourneyDelayUntilNode::Type::OrSymbol,
86
+ until_: String,
87
+ id: String,
88
+ conditions:
89
+ T.any(
90
+ T::Array[String],
91
+ Courier::JourneyConditionGroup,
92
+ Courier::JourneyConditionNestedGroup
93
+ )
94
+ }
95
+ )
96
+ end
97
+ def to_hash
98
+ end
99
+
100
+ module Mode
101
+ extend Courier::Internal::Type::Enum
102
+
103
+ TaggedSymbol =
104
+ T.type_alias { T.all(Symbol, Courier::JourneyDelayUntilNode::Mode) }
105
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
106
+
107
+ UNTIL =
108
+ T.let(:until, Courier::JourneyDelayUntilNode::Mode::TaggedSymbol)
109
+
110
+ sig do
111
+ override.returns(
112
+ T::Array[Courier::JourneyDelayUntilNode::Mode::TaggedSymbol]
113
+ )
114
+ end
115
+ def self.values
116
+ end
117
+ end
118
+
119
+ module Type
120
+ extend Courier::Internal::Type::Enum
121
+
122
+ TaggedSymbol =
123
+ T.type_alias { T.all(Symbol, Courier::JourneyDelayUntilNode::Type) }
124
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
125
+
126
+ DELAY =
127
+ T.let(:delay, Courier::JourneyDelayUntilNode::Type::TaggedSymbol)
128
+
129
+ sig do
130
+ override.returns(
131
+ T::Array[Courier::JourneyDelayUntilNode::Type::TaggedSymbol]
132
+ )
133
+ end
134
+ def self.values
135
+ end
136
+ end
137
+ end
138
+ end
139
+ end
@@ -0,0 +1,57 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyExitNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyExitNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Courier::JourneyExitNode::Type::OrSymbol) }
12
+ attr_accessor :type
13
+
14
+ sig { returns(T.nilable(String)) }
15
+ attr_reader :id
16
+
17
+ sig { params(id: String).void }
18
+ attr_writer :id
19
+
20
+ # Terminate the journey run.
21
+ sig do
22
+ params(
23
+ type: Courier::JourneyExitNode::Type::OrSymbol,
24
+ id: String
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(type:, id: nil)
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { type: Courier::JourneyExitNode::Type::OrSymbol, id: String }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+
38
+ module Type
39
+ extend Courier::Internal::Type::Enum
40
+
41
+ TaggedSymbol =
42
+ T.type_alias { T.all(Symbol, Courier::JourneyExitNode::Type) }
43
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
44
+
45
+ EXIT = T.let(:exit, Courier::JourneyExitNode::Type::TaggedSymbol)
46
+
47
+ sig do
48
+ override.returns(
49
+ T::Array[Courier::JourneyExitNode::Type::TaggedSymbol]
50
+ )
51
+ end
52
+ def self.values
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,186 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyFetchGetDeleteNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyFetchGetDeleteNode, 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::JourneyFetchGetDeleteNode::Method::OrSymbol) }
16
+ attr_accessor :method_
17
+
18
+ sig { returns(Courier::JourneyFetchGetDeleteNode::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
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
31
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
32
+ # express "no conditions".
33
+ sig do
34
+ returns(
35
+ T.nilable(
36
+ T.any(
37
+ T::Array[String],
38
+ Courier::JourneyConditionGroup,
39
+ Courier::JourneyConditionNestedGroup
40
+ )
41
+ )
42
+ )
43
+ end
44
+ attr_reader :conditions
45
+
46
+ sig do
47
+ params(
48
+ conditions:
49
+ T.any(
50
+ T::Array[String],
51
+ Courier::JourneyConditionGroup::OrHash,
52
+ Courier::JourneyConditionNestedGroup::OrHash
53
+ )
54
+ ).void
55
+ end
56
+ attr_writer :conditions
57
+
58
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
59
+ attr_reader :headers
60
+
61
+ sig { params(headers: T::Hash[Symbol, String]).void }
62
+ attr_writer :headers
63
+
64
+ sig { returns(T.nilable(T::Hash[Symbol, String])) }
65
+ attr_reader :query_params
66
+
67
+ sig { params(query_params: T::Hash[Symbol, String]).void }
68
+ attr_writer :query_params
69
+
70
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
71
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
72
+ attr_reader :response_schema
73
+
74
+ sig { params(response_schema: T::Hash[Symbol, T.anything]).void }
75
+ attr_writer :response_schema
76
+
77
+ # Issue an HTTP GET or DELETE request and merge the response into the journey
78
+ # state per `merge_strategy`.
79
+ sig do
80
+ params(
81
+ merge_strategy: Courier::JourneyMergeStrategy::OrSymbol,
82
+ method_: Courier::JourneyFetchGetDeleteNode::Method::OrSymbol,
83
+ type: Courier::JourneyFetchGetDeleteNode::Type::OrSymbol,
84
+ url: String,
85
+ id: String,
86
+ conditions:
87
+ T.any(
88
+ T::Array[String],
89
+ Courier::JourneyConditionGroup::OrHash,
90
+ Courier::JourneyConditionNestedGroup::OrHash
91
+ ),
92
+ headers: T::Hash[Symbol, String],
93
+ query_params: T::Hash[Symbol, String],
94
+ response_schema: T::Hash[Symbol, T.anything]
95
+ ).returns(T.attached_class)
96
+ end
97
+ def self.new(
98
+ # Strategy for merging a fetch response into the journey run state.
99
+ merge_strategy:,
100
+ method_:,
101
+ type:,
102
+ url:,
103
+ id: nil,
104
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
105
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
106
+ # express "no conditions".
107
+ conditions: nil,
108
+ headers: nil,
109
+ query_params: nil,
110
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
111
+ response_schema: nil
112
+ )
113
+ end
114
+
115
+ sig do
116
+ override.returns(
117
+ {
118
+ merge_strategy: Courier::JourneyMergeStrategy::OrSymbol,
119
+ method_: Courier::JourneyFetchGetDeleteNode::Method::OrSymbol,
120
+ type: Courier::JourneyFetchGetDeleteNode::Type::OrSymbol,
121
+ url: String,
122
+ id: String,
123
+ conditions:
124
+ T.any(
125
+ T::Array[String],
126
+ Courier::JourneyConditionGroup,
127
+ Courier::JourneyConditionNestedGroup
128
+ ),
129
+ headers: T::Hash[Symbol, String],
130
+ query_params: T::Hash[Symbol, String],
131
+ response_schema: T::Hash[Symbol, T.anything]
132
+ }
133
+ )
134
+ end
135
+ def to_hash
136
+ end
137
+
138
+ module Method
139
+ extend Courier::Internal::Type::Enum
140
+
141
+ TaggedSymbol =
142
+ T.type_alias do
143
+ T.all(Symbol, Courier::JourneyFetchGetDeleteNode::Method)
144
+ end
145
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
146
+
147
+ GET =
148
+ T.let(:get, Courier::JourneyFetchGetDeleteNode::Method::TaggedSymbol)
149
+ DELETE =
150
+ T.let(
151
+ :delete,
152
+ Courier::JourneyFetchGetDeleteNode::Method::TaggedSymbol
153
+ )
154
+
155
+ sig do
156
+ override.returns(
157
+ T::Array[Courier::JourneyFetchGetDeleteNode::Method::TaggedSymbol]
158
+ )
159
+ end
160
+ def self.values
161
+ end
162
+ end
163
+
164
+ module Type
165
+ extend Courier::Internal::Type::Enum
166
+
167
+ TaggedSymbol =
168
+ T.type_alias do
169
+ T.all(Symbol, Courier::JourneyFetchGetDeleteNode::Type)
170
+ end
171
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
172
+
173
+ FETCH =
174
+ T.let(:fetch, Courier::JourneyFetchGetDeleteNode::Type::TaggedSymbol)
175
+
176
+ sig do
177
+ override.returns(
178
+ T::Array[Courier::JourneyFetchGetDeleteNode::Type::TaggedSymbol]
179
+ )
180
+ end
181
+ def self.values
182
+ end
183
+ end
184
+ end
185
+ end
186
+ end
@@ -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