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,27 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyCreateParams < 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::JourneyCreateParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: Courier::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: Courier::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,146 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyDelayDurationNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyDelayDurationNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :duration
13
+
14
+ sig { returns(Courier::JourneyDelayDurationNode::Mode::OrSymbol) }
15
+ attr_accessor :mode
16
+
17
+ sig { returns(Courier::JourneyDelayDurationNode::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
+ # Pause the journey run for a fixed `duration`.
55
+ sig do
56
+ params(
57
+ duration: String,
58
+ mode: Courier::JourneyDelayDurationNode::Mode::OrSymbol,
59
+ type: Courier::JourneyDelayDurationNode::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
+ duration:,
71
+ mode:,
72
+ type:,
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
+ duration: String,
85
+ mode: Courier::JourneyDelayDurationNode::Mode::OrSymbol,
86
+ type: Courier::JourneyDelayDurationNode::Type::OrSymbol,
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 do
105
+ T.all(Symbol, Courier::JourneyDelayDurationNode::Mode)
106
+ end
107
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
108
+
109
+ DURATION =
110
+ T.let(
111
+ :duration,
112
+ Courier::JourneyDelayDurationNode::Mode::TaggedSymbol
113
+ )
114
+
115
+ sig do
116
+ override.returns(
117
+ T::Array[Courier::JourneyDelayDurationNode::Mode::TaggedSymbol]
118
+ )
119
+ end
120
+ def self.values
121
+ end
122
+ end
123
+
124
+ module Type
125
+ extend Courier::Internal::Type::Enum
126
+
127
+ TaggedSymbol =
128
+ T.type_alias do
129
+ T.all(Symbol, Courier::JourneyDelayDurationNode::Type)
130
+ end
131
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
132
+
133
+ DELAY =
134
+ T.let(:delay, Courier::JourneyDelayDurationNode::Type::TaggedSymbol)
135
+
136
+ sig do
137
+ override.returns(
138
+ T::Array[Courier::JourneyDelayDurationNode::Type::TaggedSymbol]
139
+ )
140
+ end
141
+ def self.values
142
+ end
143
+ end
144
+ end
145
+ end
146
+ end
@@ -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