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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c653d07cd54be88e8b8328788188c56e6d62e7308f6bccf582769bd38b5e413
4
- data.tar.gz: 9a025d1497b0e9383686ba5c849d2784be1195c7c21a52ba24d2491f6e5ebe71
3
+ metadata.gz: 07ec887deae40e31444ee6401c3b00061e0bbc4156700f5ff1361e1366fab649
4
+ data.tar.gz: 9167f8538d2652a8cd9e6723ab309f331f7487e1a96f69fa72abea27e4d76c25
5
5
  SHA512:
6
- metadata.gz: ee312a1f98ddfd71c03692e23047237cd1205465687890e3d0dea3bd675acb6ed1ba30b340e67a85e9cd3d73017c09c29e5ef0a3946c4b6e2ccb806e7af29392
7
- data.tar.gz: ac1e5417c4e7400965fc5efc5074e40cff4e5e4b5a4427795884cdba02869dbc54185252d2653c9599fe745b8a78e2fd0793675bf9a08b6a9d5d3903ee0139c8
6
+ metadata.gz: bdd2bb582d89b2d3c4ebaa5f7d2c70a6cfb72ca9c2288322cb4ce8d21f14deafe67e6546a1d1dd7b007910e5b1fcff183b41336a6ac11fe7eee3706b2104e415
7
+ data.tar.gz: 98365664a918844655cd990b7195323dc6c60185b5efcaf9a667e12a81d40ec35fc426fbdd98920cfc6f34299101c8b7d6e7e27b1f765698158260ab94c3fa42
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.11.0 (2026-05-19)
4
+
5
+ Full Changelog: [v4.10.2...v4.11.0](https://github.com/trycourier/courier-ruby/compare/v4.10.2...v4.11.0)
6
+
7
+ ### Features
8
+
9
+ * [C-18380] Journeys API reference: copy + naming cleanup ([5930853](https://github.com/trycourier/courier-ruby/commit/5930853b36e87fc434a5f316d5144459d8a5156c))
10
+ * [SUP-607] Add DELETE endpoint for Courier Create tenant templates ([72df650](https://github.com/trycourier/courier-ruby/commit/72df650b8e3e6bde00a5a8f047c16e77f2c97ac3))
11
+ * **api:** add journey CRUD/templates/versioning endpoints, journey node/condition types ([30bc8f6](https://github.com/trycourier/courier-ruby/commit/30bc8f6ad778a9ca44ed7ccbfa743e23170192b4))
12
+ * support setting headers via env ([6f99d29](https://github.com/trycourier/courier-ruby/commit/6f99d290cad4006de8f84b22cbac6694d314a3aa))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * **client:** elide content type header on requests without body ([5f06485](https://github.com/trycourier/courier-ruby/commit/5f0648580bf65a97989fbb1f6583ef7166c43c2f))
18
+
19
+
20
+ ### Chores
21
+
22
+ * **internal:** more robust bootstrap script ([91e8fd1](https://github.com/trycourier/courier-ruby/commit/91e8fd1ecdd6d10def9215f53a73248b754b5386))
23
+
3
24
  ## 4.10.2 (2026-04-14)
4
25
 
5
26
  Full Changelog: [v4.10.1...v4.10.2](https://github.com/trycourier/courier-ruby/compare/v4.10.1...v4.10.2)
@@ -112,6 +112,19 @@ module Courier
112
112
  raise ArgumentError.new("api_key is required, and can be set via environ: \"COURIER_API_KEY\"")
113
113
  end
114
114
 
115
+ headers = {}
116
+ custom_headers_env = ENV["COURIER_CUSTOM_HEADERS"]
117
+ unless custom_headers_env.nil?
118
+ parsed = {}
119
+ custom_headers_env.split("\n").each do |line|
120
+ colon = line.index(":")
121
+ unless colon.nil?
122
+ parsed[line[0...colon].strip] = line[(colon + 1)..].strip
123
+ end
124
+ end
125
+ headers = parsed.merge(headers)
126
+ end
127
+
115
128
  @api_key = api_key.to_s
116
129
 
117
130
  super(
@@ -119,7 +132,8 @@ module Courier
119
132
  timeout: timeout,
120
133
  max_retries: max_retries,
121
134
  initial_retry_delay: initial_retry_delay,
122
- max_retry_delay: max_retry_delay
135
+ max_retry_delay: max_retry_delay,
136
+ headers: headers
123
137
  )
124
138
 
125
139
  @send_ = Courier::Resources::Send.new(client: self)
@@ -306,6 +306,8 @@ module Courier
306
306
  Courier::Internal::Util.deep_merge(*[req[:body], opts[:extra_body]].compact)
307
307
  end
308
308
 
309
+ headers.delete("content-type") if body.nil?
310
+
309
311
  url = Courier::Internal::Util.join_parsed_uri(
310
312
  @base_url_components,
311
313
  {**req, path: path, query: query}
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class CreateJourneyRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute name
7
+ #
8
+ # @return [String]
9
+ required :name, String
10
+
11
+ # @!attribute nodes
12
+ #
13
+ # @return [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
14
+ required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
15
+
16
+ # @!attribute enabled
17
+ #
18
+ # @return [Boolean, nil]
19
+ optional :enabled, Courier::Internal::Type::Boolean
20
+
21
+ # @!attribute state
22
+ # Lifecycle state of a journey.
23
+ #
24
+ # @return [Symbol, Courier::Models::JourneyState, nil]
25
+ optional :state, enum: -> { Courier::JourneyState }
26
+
27
+ # @!method initialize(name:, nodes:, enabled: nil, state: nil)
28
+ # Request body for creating a journey.
29
+ #
30
+ # @param name [String]
31
+ #
32
+ # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
33
+ #
34
+ # @param enabled [Boolean]
35
+ #
36
+ # @param state [Symbol, Courier::Models::JourneyState] Lifecycle state of a journey.
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyAINode < Courier::Internal::Type::BaseModel
6
+ # @!attribute output_schema
7
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
8
+ #
9
+ # @return [Hash{Symbol=>Object}]
10
+ required :output_schema, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
11
+
12
+ # @!attribute type
13
+ #
14
+ # @return [Symbol, Courier::Models::JourneyAINode::Type]
15
+ required :type, enum: -> { Courier::JourneyAINode::Type }
16
+
17
+ # @!attribute id
18
+ #
19
+ # @return [String, nil]
20
+ optional :id, String
21
+
22
+ # @!attribute conditions
23
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
24
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
25
+ # express "no conditions".
26
+ #
27
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
28
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
29
+
30
+ # @!attribute model
31
+ #
32
+ # @return [String, nil]
33
+ optional :model, String
34
+
35
+ # @!attribute user_prompt
36
+ #
37
+ # @return [String, nil]
38
+ optional :user_prompt, String
39
+
40
+ # @!attribute web_search
41
+ #
42
+ # @return [Boolean, nil]
43
+ optional :web_search, Courier::Internal::Type::Boolean
44
+
45
+ # @!method initialize(output_schema:, type:, id: nil, conditions: nil, model: nil, user_prompt: nil, web_search: nil)
46
+ # Some parameter documentations has been truncated, see
47
+ # {Courier::Models::JourneyAINode} for more details.
48
+ #
49
+ # Invoke an AI step with `user_prompt` and optional `web_search`. Returns a
50
+ # structured response conforming to `output_schema`.
51
+ #
52
+ # @param output_schema [Hash{Symbol=>Object}] A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
53
+ #
54
+ # @param type [Symbol, Courier::Models::JourneyAINode::Type]
55
+ #
56
+ # @param id [String]
57
+ #
58
+ # @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
59
+ #
60
+ # @param model [String]
61
+ #
62
+ # @param user_prompt [String]
63
+ #
64
+ # @param web_search [Boolean]
65
+
66
+ # @see Courier::Models::JourneyAINode#type
67
+ module Type
68
+ extend Courier::Internal::Type::Enum
69
+
70
+ AI = :ai
71
+
72
+ # @!method self.values
73
+ # @return [Array<Symbol>]
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyAPIInvokeTriggerNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute trigger_type
7
+ #
8
+ # @return [Symbol, Courier::Models::JourneyAPIInvokeTriggerNode::TriggerType]
9
+ required :trigger_type, enum: -> { Courier::JourneyAPIInvokeTriggerNode::TriggerType }
10
+
11
+ # @!attribute type
12
+ #
13
+ # @return [Symbol, Courier::Models::JourneyAPIInvokeTriggerNode::Type]
14
+ required :type, enum: -> { Courier::JourneyAPIInvokeTriggerNode::Type }
15
+
16
+ # @!attribute id
17
+ #
18
+ # @return [String, nil]
19
+ optional :id, String
20
+
21
+ # @!attribute conditions
22
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
23
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
24
+ # express "no conditions".
25
+ #
26
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
27
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
28
+
29
+ # @!attribute schema
30
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
31
+ #
32
+ # @return [Hash{Symbol=>Object}, nil]
33
+ optional :schema, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
34
+
35
+ # @!method initialize(trigger_type:, type:, id: nil, conditions: nil, schema: nil)
36
+ # Some parameter documentations has been truncated, see
37
+ # {Courier::Models::JourneyAPIInvokeTriggerNode} for more details.
38
+ #
39
+ # Trigger fired when the journey is invoked via the API. The optional `schema`
40
+ # field is a JSON Schema that validates the invocation payload.
41
+ #
42
+ # @param trigger_type [Symbol, Courier::Models::JourneyAPIInvokeTriggerNode::TriggerType]
43
+ #
44
+ # @param type [Symbol, Courier::Models::JourneyAPIInvokeTriggerNode::Type]
45
+ #
46
+ # @param id [String]
47
+ #
48
+ # @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
49
+ #
50
+ # @param schema [Hash{Symbol=>Object}] A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
51
+
52
+ # @see Courier::Models::JourneyAPIInvokeTriggerNode#trigger_type
53
+ module TriggerType
54
+ extend Courier::Internal::Type::Enum
55
+
56
+ API_INVOKE = :"api-invoke"
57
+
58
+ # @!method self.values
59
+ # @return [Array<Symbol>]
60
+ end
61
+
62
+ # @see Courier::Models::JourneyAPIInvokeTriggerNode#type
63
+ module Type
64
+ extend Courier::Internal::Type::Enum
65
+
66
+ TRIGGER = :trigger
67
+
68
+ # @!method self.values
69
+ # @return [Array<Symbol>]
70
+ end
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#archive
6
+ class JourneyArchiveParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!attribute template_id
11
+ #
12
+ # @return [String]
13
+ required :template_id, String
14
+
15
+ # @!method initialize(template_id:, request_options: {})
16
+ # @param template_id [String]
17
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @type [Courier::Internal::Type::Converter]
6
+ JourneyConditionAtom = Courier::Internal::Type::ArrayOf[String]
7
+ end
8
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyConditionGroup < Courier::Internal::Type::BaseModel
6
+ # @!attribute and_
7
+ #
8
+ # @return [Array<Array<String>>, nil]
9
+ optional :and_,
10
+ Courier::Internal::Type::ArrayOf[Courier::Internal::Type::ArrayOf[String]],
11
+ api_name: :AND
12
+
13
+ # @!attribute or_
14
+ #
15
+ # @return [Array<Array<String>>, nil]
16
+ optional :or_, Courier::Internal::Type::ArrayOf[Courier::Internal::Type::ArrayOf[String]], api_name: :OR
17
+
18
+ # @!method initialize(and_: nil, or_: nil)
19
+ # A leaf condition group. Exactly one of `AND` or `OR` must be present at runtime;
20
+ # each is a list of `JourneyConditionAtom` tuples.
21
+ #
22
+ # @param and_ [Array<Array<String>>]
23
+ # @param or_ [Array<Array<String>>]
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyConditionNestedGroup < Courier::Internal::Type::BaseModel
6
+ # @!attribute and_
7
+ #
8
+ # @return [Array<Courier::Models::JourneyConditionGroup>, nil]
9
+ optional :and_, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyConditionGroup] }, api_name: :AND
10
+
11
+ # @!attribute or_
12
+ #
13
+ # @return [Array<Courier::Models::JourneyConditionGroup>, nil]
14
+ optional :or_, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyConditionGroup] }, api_name: :OR
15
+
16
+ # @!method initialize(and_: nil, or_: nil)
17
+ # A nested condition group. Exactly one of `AND` or `OR` must be present at
18
+ # runtime; each is a list of `JourneyConditionGroup` items.
19
+ #
20
+ # @param and_ [Array<Courier::Models::JourneyConditionGroup>]
21
+ # @param or_ [Array<Courier::Models::JourneyConditionGroup>]
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
6
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
7
+ # express "no conditions".
8
+ module JourneyConditionsField
9
+ extend Courier::Internal::Type::Union
10
+
11
+ # A single condition expressed as a positional tuple of strings.
12
+ # - Binary form (3 elements): `[path, operator, value]` where `operator`
13
+ # is one of `is equal`, `is not equal`, `contains`, `does not contain`,
14
+ # `starts with`, `ends with`, `greater than`, `greater than or equal`,
15
+ # `less than`, `less than or equal`.
16
+ #
17
+ # Example: `["user.tier", "is equal", "gold"]`.
18
+ #
19
+ # - Unary form (2 elements): `[path, operator]` where `operator` is
20
+ # one of `exists`, `does not exist`.
21
+ #
22
+ # Example: `["user.email", "exists"]`.
23
+ #
24
+ # The first element is a non-empty dot-path. The second element is the operator (must come from one of the two operator sets above). For the binary form, the third element is the comparison value (string). Runtime validation of the operator value and arity is performed by the backend; SDKs surface this as a string list.
25
+ variant -> { Courier::JourneyConditionAtom }
26
+
27
+ # A leaf condition group. Exactly one of `AND` or `OR` must be present at runtime; each is a list of `JourneyConditionAtom` tuples.
28
+ variant -> { Courier::JourneyConditionGroup }
29
+
30
+ # A nested condition group. Exactly one of `AND` or `OR` must be present at runtime; each is a list of `JourneyConditionGroup` items.
31
+ variant -> { Courier::JourneyConditionNestedGroup }
32
+
33
+ # @!method self.variants
34
+ # @return [Array(Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup)]
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#create
6
+ class JourneyCreateParams < Courier::Models::CreateJourneyRequest
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyDelayDurationNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute duration
7
+ #
8
+ # @return [String]
9
+ required :duration, String
10
+
11
+ # @!attribute mode
12
+ #
13
+ # @return [Symbol, Courier::Models::JourneyDelayDurationNode::Mode]
14
+ required :mode, enum: -> { Courier::JourneyDelayDurationNode::Mode }
15
+
16
+ # @!attribute type
17
+ #
18
+ # @return [Symbol, Courier::Models::JourneyDelayDurationNode::Type]
19
+ required :type, enum: -> { Courier::JourneyDelayDurationNode::Type }
20
+
21
+ # @!attribute id
22
+ #
23
+ # @return [String, nil]
24
+ optional :id, String
25
+
26
+ # @!attribute conditions
27
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
28
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
29
+ # express "no conditions".
30
+ #
31
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
32
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
33
+
34
+ # @!method initialize(duration:, mode:, type:, id: nil, conditions: nil)
35
+ # Some parameter documentations has been truncated, see
36
+ # {Courier::Models::JourneyDelayDurationNode} for more details.
37
+ #
38
+ # Pause the journey run for a fixed `duration`.
39
+ #
40
+ # @param duration [String]
41
+ #
42
+ # @param mode [Symbol, Courier::Models::JourneyDelayDurationNode::Mode]
43
+ #
44
+ # @param type [Symbol, Courier::Models::JourneyDelayDurationNode::Type]
45
+ #
46
+ # @param id [String]
47
+ #
48
+ # @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
49
+
50
+ # @see Courier::Models::JourneyDelayDurationNode#mode
51
+ module Mode
52
+ extend Courier::Internal::Type::Enum
53
+
54
+ DURATION = :duration
55
+
56
+ # @!method self.values
57
+ # @return [Array<Symbol>]
58
+ end
59
+
60
+ # @see Courier::Models::JourneyDelayDurationNode#type
61
+ module Type
62
+ extend Courier::Internal::Type::Enum
63
+
64
+ DELAY = :delay
65
+
66
+ # @!method self.values
67
+ # @return [Array<Symbol>]
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,71 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyDelayUntilNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute mode
7
+ #
8
+ # @return [Symbol, Courier::Models::JourneyDelayUntilNode::Mode]
9
+ required :mode, enum: -> { Courier::JourneyDelayUntilNode::Mode }
10
+
11
+ # @!attribute type
12
+ #
13
+ # @return [Symbol, Courier::Models::JourneyDelayUntilNode::Type]
14
+ required :type, enum: -> { Courier::JourneyDelayUntilNode::Type }
15
+
16
+ # @!attribute until_
17
+ #
18
+ # @return [String]
19
+ required :until_, String, api_name: :until
20
+
21
+ # @!attribute id
22
+ #
23
+ # @return [String, nil]
24
+ optional :id, String
25
+
26
+ # @!attribute conditions
27
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
28
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
29
+ # express "no conditions".
30
+ #
31
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
32
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
33
+
34
+ # @!method initialize(mode:, type:, until_:, id: nil, conditions: nil)
35
+ # Some parameter documentations has been truncated, see
36
+ # {Courier::Models::JourneyDelayUntilNode} for more details.
37
+ #
38
+ # Pause the journey run `until` a specific time.
39
+ #
40
+ # @param mode [Symbol, Courier::Models::JourneyDelayUntilNode::Mode]
41
+ #
42
+ # @param type [Symbol, Courier::Models::JourneyDelayUntilNode::Type]
43
+ #
44
+ # @param until_ [String]
45
+ #
46
+ # @param id [String]
47
+ #
48
+ # @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
49
+
50
+ # @see Courier::Models::JourneyDelayUntilNode#mode
51
+ module Mode
52
+ extend Courier::Internal::Type::Enum
53
+
54
+ UNTIL = :until
55
+
56
+ # @!method self.values
57
+ # @return [Array<Symbol>]
58
+ end
59
+
60
+ # @see Courier::Models::JourneyDelayUntilNode#type
61
+ module Type
62
+ extend Courier::Internal::Type::Enum
63
+
64
+ DELAY = :delay
65
+
66
+ # @!method self.values
67
+ # @return [Array<Symbol>]
68
+ end
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyExitNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute type
7
+ #
8
+ # @return [Symbol, Courier::Models::JourneyExitNode::Type]
9
+ required :type, enum: -> { Courier::JourneyExitNode::Type }
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String, nil]
14
+ optional :id, String
15
+
16
+ # @!method initialize(type:, id: nil)
17
+ # Terminate the journey run.
18
+ #
19
+ # @param type [Symbol, Courier::Models::JourneyExitNode::Type]
20
+ # @param id [String]
21
+
22
+ # @see Courier::Models::JourneyExitNode#type
23
+ module Type
24
+ extend Courier::Internal::Type::Enum
25
+
26
+ EXIT = :exit
27
+
28
+ # @!method self.values
29
+ # @return [Array<Symbol>]
30
+ end
31
+ end
32
+ end
33
+ end