trycourier 4.10.2 → 4.12.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 (154) 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/brand_create_params.rb +7 -7
  6. data/lib/courier/models/create_journey_request.rb +39 -0
  7. data/lib/courier/models/journey_ai_node.rb +77 -0
  8. data/lib/courier/models/journey_api_invoke_trigger_node.rb +73 -0
  9. data/lib/courier/models/journey_archive_params.rb +20 -0
  10. data/lib/courier/models/journey_condition_atom.rb +8 -0
  11. data/lib/courier/models/journey_condition_group.rb +26 -0
  12. data/lib/courier/models/journey_condition_nested_group.rb +24 -0
  13. data/lib/courier/models/journey_conditions_field.rb +37 -0
  14. data/lib/courier/models/journey_create_params.rb +14 -0
  15. data/lib/courier/models/journey_delay_duration_node.rb +71 -0
  16. data/lib/courier/models/journey_delay_until_node.rb +71 -0
  17. data/lib/courier/models/journey_exit_node.rb +33 -0
  18. data/lib/courier/models/journey_fetch_get_delete_node.rb +103 -0
  19. data/lib/courier/models/journey_fetch_post_put_node.rb +110 -0
  20. data/lib/courier/models/journey_list_versions_params.rb +20 -0
  21. data/lib/courier/models/journey_merge_strategy.rb +18 -0
  22. data/lib/courier/models/journey_node.rb +295 -0
  23. data/lib/courier/models/journey_publish_params.rb +20 -0
  24. data/lib/courier/models/journey_publish_request.rb +18 -0
  25. data/lib/courier/models/journey_replace_params.rb +20 -0
  26. data/lib/courier/models/journey_response.rb +82 -0
  27. data/lib/courier/models/journey_retrieve_params.rb +29 -0
  28. data/lib/courier/models/journey_segment_trigger_node.rb +90 -0
  29. data/lib/courier/models/journey_send_node.rb +124 -0
  30. data/lib/courier/models/journey_state.rb +16 -0
  31. data/lib/courier/models/journey_template_create_request.rb +138 -0
  32. data/lib/courier/models/journey_template_get_response.rb +154 -0
  33. data/lib/courier/models/journey_template_list_response.rb +23 -0
  34. data/lib/courier/models/journey_template_publish_request.rb +18 -0
  35. data/lib/courier/models/journey_template_replace_request.rb +126 -0
  36. data/lib/courier/models/journey_template_summary.rb +60 -0
  37. data/lib/courier/models/journey_throttle_dynamic_node.rb +86 -0
  38. data/lib/courier/models/journey_throttle_static_node.rb +80 -0
  39. data/lib/courier/models/journey_version_item.rb +41 -0
  40. data/lib/courier/models/journey_versions_list_response.rb +24 -0
  41. data/lib/courier/models/journeys/template_archive_params.rb +28 -0
  42. data/lib/courier/models/journeys/template_create_params.rb +22 -0
  43. data/lib/courier/models/journeys/template_list_params.rb +39 -0
  44. data/lib/courier/models/journeys/template_list_versions_params.rb +28 -0
  45. data/lib/courier/models/journeys/template_publish_params.rb +28 -0
  46. data/lib/courier/models/journeys/template_replace_params.rb +28 -0
  47. data/lib/courier/models/journeys/template_retrieve_params.rb +28 -0
  48. data/lib/courier/models/tenants/template_delete_params.rb +28 -0
  49. data/lib/courier/models.rb +73 -0
  50. data/lib/courier/resources/brands.rb +4 -3
  51. data/lib/courier/resources/journeys/templates.rb +224 -0
  52. data/lib/courier/resources/journeys.rb +167 -2
  53. data/lib/courier/resources/tenants/templates.rb +32 -0
  54. data/lib/courier/version.rb +1 -1
  55. data/lib/courier.rb +44 -0
  56. data/rbi/courier/models/brand_create_params.rbi +8 -8
  57. data/rbi/courier/models/create_journey_request.rbi +116 -0
  58. data/rbi/courier/models/journey_ai_node.rbi +141 -0
  59. data/rbi/courier/models/journey_api_invoke_trigger_node.rbi +164 -0
  60. data/rbi/courier/models/journey_archive_params.rbi +35 -0
  61. data/rbi/courier/models/journey_condition_atom.rbi +11 -0
  62. data/rbi/courier/models/journey_condition_group.rbi +43 -0
  63. data/rbi/courier/models/journey_condition_nested_group.rbi +51 -0
  64. data/rbi/courier/models/journey_conditions_field.rbi +27 -0
  65. data/rbi/courier/models/journey_create_params.rbi +27 -0
  66. data/rbi/courier/models/journey_delay_duration_node.rbi +146 -0
  67. data/rbi/courier/models/journey_delay_until_node.rbi +139 -0
  68. data/rbi/courier/models/journey_exit_node.rbi +57 -0
  69. data/rbi/courier/models/journey_fetch_get_delete_node.rbi +186 -0
  70. data/rbi/courier/models/journey_fetch_post_put_node.rbi +190 -0
  71. data/rbi/courier/models/journey_list_versions_params.rbi +35 -0
  72. data/rbi/courier/models/journey_merge_strategy.rbi +26 -0
  73. data/rbi/courier/models/journey_node.rbi +542 -0
  74. data/rbi/courier/models/journey_publish_params.rbi +35 -0
  75. data/rbi/courier/models/journey_publish_request.rbi +28 -0
  76. data/rbi/courier/models/journey_replace_params.rbi +35 -0
  77. data/rbi/courier/models/journey_response.rbi +109 -0
  78. data/rbi/courier/models/journey_retrieve_params.rbi +52 -0
  79. data/rbi/courier/models/journey_segment_trigger_node.rbi +200 -0
  80. data/rbi/courier/models/journey_send_node.rbi +254 -0
  81. data/rbi/courier/models/journey_state.rbi +20 -0
  82. data/rbi/courier/models/journey_template_create_request.rbi +381 -0
  83. data/rbi/courier/models/journey_template_get_response.rbi +334 -0
  84. data/rbi/courier/models/journey_template_list_response.rbi +45 -0
  85. data/rbi/courier/models/journey_template_publish_request.rbi +31 -0
  86. data/rbi/courier/models/journey_template_replace_request.rbi +368 -0
  87. data/rbi/courier/models/journey_template_summary.rbi +85 -0
  88. data/rbi/courier/models/journey_throttle_dynamic_node.rbi +162 -0
  89. data/rbi/courier/models/journey_throttle_static_node.rbi +158 -0
  90. data/rbi/courier/models/journey_version_item.rbi +54 -0
  91. data/rbi/courier/models/journey_versions_list_response.rbi +45 -0
  92. data/rbi/courier/models/journeys/template_archive_params.rbi +48 -0
  93. data/rbi/courier/models/journeys/template_create_params.rbi +40 -0
  94. data/rbi/courier/models/journeys/template_list_params.rbi +68 -0
  95. data/rbi/courier/models/journeys/template_list_versions_params.rbi +48 -0
  96. data/rbi/courier/models/journeys/template_publish_params.rbi +48 -0
  97. data/rbi/courier/models/journeys/template_replace_params.rbi +48 -0
  98. data/rbi/courier/models/journeys/template_retrieve_params.rbi +48 -0
  99. data/rbi/courier/models/tenants/template_delete_params.rbi +48 -0
  100. data/rbi/courier/models.rbi +76 -0
  101. data/rbi/courier/resources/brands.rbi +4 -9
  102. data/rbi/courier/resources/journeys/templates.rbi +160 -0
  103. data/rbi/courier/resources/journeys.rbi +158 -3
  104. data/rbi/courier/resources/tenants/templates.rbi +22 -0
  105. data/sig/courier/models/brand_create_params.rbs +5 -5
  106. data/sig/courier/models/create_journey_request.rbs +41 -0
  107. data/sig/courier/models/journey_ai_node.rbs +72 -0
  108. data/sig/courier/models/journey_api_invoke_trigger_node.rbs +68 -0
  109. data/sig/courier/models/journey_archive_params.rbs +23 -0
  110. data/sig/courier/models/journey_condition_atom.rbs +7 -0
  111. data/sig/courier/models/journey_condition_group.rbs +33 -0
  112. data/sig/courier/models/journey_condition_nested_group.rbs +33 -0
  113. data/sig/courier/models/journey_conditions_field.rbs +14 -0
  114. data/sig/courier/models/journey_create_params.rbs +15 -0
  115. data/sig/courier/models/journey_delay_duration_node.rbs +66 -0
  116. data/sig/courier/models/journey_delay_until_node.rbs +66 -0
  117. data/sig/courier/models/journey_exit_node.rbs +34 -0
  118. data/sig/courier/models/journey_fetch_get_delete_node.rbs +93 -0
  119. data/sig/courier/models/journey_fetch_post_put_node.rbs +100 -0
  120. data/sig/courier/models/journey_list_versions_params.rbs +23 -0
  121. data/sig/courier/models/journey_merge_strategy.rbs +16 -0
  122. data/sig/courier/models/journey_node.rbs +247 -0
  123. data/sig/courier/models/journey_publish_params.rbs +25 -0
  124. data/sig/courier/models/journey_publish_request.rbs +15 -0
  125. data/sig/courier/models/journey_replace_params.rbs +25 -0
  126. data/sig/courier/models/journey_response.rbs +65 -0
  127. data/sig/courier/models/journey_retrieve_params.rbs +30 -0
  128. data/sig/courier/models/journey_segment_trigger_node.rbs +85 -0
  129. data/sig/courier/models/journey_send_node.rbs +140 -0
  130. data/sig/courier/models/journey_state.rbs +14 -0
  131. data/sig/courier/models/journey_template_create_request.rbs +148 -0
  132. data/sig/courier/models/journey_template_get_response.rbs +157 -0
  133. data/sig/courier/models/journey_template_list_response.rbs +25 -0
  134. data/sig/courier/models/journey_template_publish_request.rbs +15 -0
  135. data/sig/courier/models/journey_template_replace_request.rbs +136 -0
  136. data/sig/courier/models/journey_template_summary.rbs +59 -0
  137. data/sig/courier/models/journey_throttle_dynamic_node.rbs +76 -0
  138. data/sig/courier/models/journey_throttle_static_node.rbs +72 -0
  139. data/sig/courier/models/journey_version_item.rbs +40 -0
  140. data/sig/courier/models/journey_versions_list_response.rbs +22 -0
  141. data/sig/courier/models/journeys/template_archive_params.rbs +30 -0
  142. data/sig/courier/models/journeys/template_create_params.rbs +27 -0
  143. data/sig/courier/models/journeys/template_list_params.rbs +38 -0
  144. data/sig/courier/models/journeys/template_list_versions_params.rbs +30 -0
  145. data/sig/courier/models/journeys/template_publish_params.rbs +34 -0
  146. data/sig/courier/models/journeys/template_replace_params.rbs +34 -0
  147. data/sig/courier/models/journeys/template_retrieve_params.rbs +30 -0
  148. data/sig/courier/models/tenants/template_delete_params.rbs +30 -0
  149. data/sig/courier/models.rbs +72 -0
  150. data/sig/courier/resources/brands.rbs +1 -1
  151. data/sig/courier/resources/journeys/templates.rbs +58 -0
  152. data/sig/courier/resources/journeys.rbs +41 -0
  153. data/sig/courier/resources/tenants/templates.rbs +6 -0
  154. metadata +134 -2
@@ -0,0 +1,103 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyFetchGetDeleteNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute merge_strategy
7
+ # Strategy for merging a fetch response into the journey run state.
8
+ #
9
+ # @return [Symbol, Courier::Models::JourneyMergeStrategy]
10
+ required :merge_strategy, enum: -> { Courier::JourneyMergeStrategy }
11
+
12
+ # @!attribute method_
13
+ #
14
+ # @return [Symbol, Courier::Models::JourneyFetchGetDeleteNode::Method]
15
+ required :method_, enum: -> { Courier::JourneyFetchGetDeleteNode::Method }, api_name: :method
16
+
17
+ # @!attribute type
18
+ #
19
+ # @return [Symbol, Courier::Models::JourneyFetchGetDeleteNode::Type]
20
+ required :type, enum: -> { Courier::JourneyFetchGetDeleteNode::Type }
21
+
22
+ # @!attribute url
23
+ #
24
+ # @return [String]
25
+ required :url, String
26
+
27
+ # @!attribute id
28
+ #
29
+ # @return [String, nil]
30
+ optional :id, String
31
+
32
+ # @!attribute conditions
33
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
34
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
35
+ # express "no conditions".
36
+ #
37
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
38
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
39
+
40
+ # @!attribute headers
41
+ #
42
+ # @return [Hash{Symbol=>String}, nil]
43
+ optional :headers, Courier::Internal::Type::HashOf[String]
44
+
45
+ # @!attribute query_params
46
+ #
47
+ # @return [Hash{Symbol=>String}, nil]
48
+ optional :query_params, Courier::Internal::Type::HashOf[String]
49
+
50
+ # @!attribute response_schema
51
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
52
+ #
53
+ # @return [Hash{Symbol=>Object}, nil]
54
+ optional :response_schema, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
55
+
56
+ # @!method initialize(merge_strategy:, method_:, type:, url:, id: nil, conditions: nil, headers: nil, query_params: nil, response_schema: nil)
57
+ # Some parameter documentations has been truncated, see
58
+ # {Courier::Models::JourneyFetchGetDeleteNode} for more details.
59
+ #
60
+ # Issue an HTTP GET or DELETE request and merge the response into the journey
61
+ # state per `merge_strategy`.
62
+ #
63
+ # @param merge_strategy [Symbol, Courier::Models::JourneyMergeStrategy] Strategy for merging a fetch response into the journey run state.
64
+ #
65
+ # @param method_ [Symbol, Courier::Models::JourneyFetchGetDeleteNode::Method]
66
+ #
67
+ # @param type [Symbol, Courier::Models::JourneyFetchGetDeleteNode::Type]
68
+ #
69
+ # @param url [String]
70
+ #
71
+ # @param id [String]
72
+ #
73
+ # @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
74
+ #
75
+ # @param headers [Hash{Symbol=>String}]
76
+ #
77
+ # @param query_params [Hash{Symbol=>String}]
78
+ #
79
+ # @param response_schema [Hash{Symbol=>Object}] A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
80
+
81
+ # @see Courier::Models::JourneyFetchGetDeleteNode#method_
82
+ module Method
83
+ extend Courier::Internal::Type::Enum
84
+
85
+ GET = :get
86
+ DELETE = :delete
87
+
88
+ # @!method self.values
89
+ # @return [Array<Symbol>]
90
+ end
91
+
92
+ # @see Courier::Models::JourneyFetchGetDeleteNode#type
93
+ module Type
94
+ extend Courier::Internal::Type::Enum
95
+
96
+ FETCH = :fetch
97
+
98
+ # @!method self.values
99
+ # @return [Array<Symbol>]
100
+ end
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,110 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyFetchPostPutNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute merge_strategy
7
+ # Strategy for merging a fetch response into the journey run state.
8
+ #
9
+ # @return [Symbol, Courier::Models::JourneyMergeStrategy]
10
+ required :merge_strategy, enum: -> { Courier::JourneyMergeStrategy }
11
+
12
+ # @!attribute method_
13
+ #
14
+ # @return [Symbol, Courier::Models::JourneyFetchPostPutNode::Method]
15
+ required :method_, enum: -> { Courier::JourneyFetchPostPutNode::Method }, api_name: :method
16
+
17
+ # @!attribute type
18
+ #
19
+ # @return [Symbol, Courier::Models::JourneyFetchPostPutNode::Type]
20
+ required :type, enum: -> { Courier::JourneyFetchPostPutNode::Type }
21
+
22
+ # @!attribute url
23
+ #
24
+ # @return [String]
25
+ required :url, String
26
+
27
+ # @!attribute id
28
+ #
29
+ # @return [String, nil]
30
+ optional :id, String
31
+
32
+ # @!attribute body
33
+ #
34
+ # @return [String, nil]
35
+ optional :body, String
36
+
37
+ # @!attribute conditions
38
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
39
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
40
+ # express "no conditions".
41
+ #
42
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
43
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
44
+
45
+ # @!attribute headers
46
+ #
47
+ # @return [Hash{Symbol=>String}, nil]
48
+ optional :headers, Courier::Internal::Type::HashOf[String]
49
+
50
+ # @!attribute query_params
51
+ #
52
+ # @return [Hash{Symbol=>String}, nil]
53
+ optional :query_params, Courier::Internal::Type::HashOf[String]
54
+
55
+ # @!attribute response_schema
56
+ # A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
57
+ #
58
+ # @return [Hash{Symbol=>Object}, nil]
59
+ optional :response_schema, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
60
+
61
+ # @!method initialize(merge_strategy:, method_:, type:, url:, id: nil, body: nil, conditions: nil, headers: nil, query_params: nil, response_schema: nil)
62
+ # Some parameter documentations has been truncated, see
63
+ # {Courier::Models::JourneyFetchPostPutNode} for more details.
64
+ #
65
+ # Issue an HTTP POST or PUT request with a `body` and merge the response into the
66
+ # journey state per `merge_strategy`.
67
+ #
68
+ # @param merge_strategy [Symbol, Courier::Models::JourneyMergeStrategy] Strategy for merging a fetch response into the journey run state.
69
+ #
70
+ # @param method_ [Symbol, Courier::Models::JourneyFetchPostPutNode::Method]
71
+ #
72
+ # @param type [Symbol, Courier::Models::JourneyFetchPostPutNode::Type]
73
+ #
74
+ # @param url [String]
75
+ #
76
+ # @param id [String]
77
+ #
78
+ # @param body [String]
79
+ #
80
+ # @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
81
+ #
82
+ # @param headers [Hash{Symbol=>String}]
83
+ #
84
+ # @param query_params [Hash{Symbol=>String}]
85
+ #
86
+ # @param response_schema [Hash{Symbol=>Object}] A JSONSchema object (Draft-07-compatible). Validated at runtime by Ajv.
87
+
88
+ # @see Courier::Models::JourneyFetchPostPutNode#method_
89
+ module Method
90
+ extend Courier::Internal::Type::Enum
91
+
92
+ POST = :post
93
+ PUT = :put
94
+
95
+ # @!method self.values
96
+ # @return [Array<Symbol>]
97
+ end
98
+
99
+ # @see Courier::Models::JourneyFetchPostPutNode#type
100
+ module Type
101
+ extend Courier::Internal::Type::Enum
102
+
103
+ FETCH = :fetch
104
+
105
+ # @!method self.values
106
+ # @return [Array<Symbol>]
107
+ end
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#list_versions
6
+ class JourneyListVersionsParams < 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,18 @@
1
+ # frozen_string_literal: true
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
+ OVERWRITE = :overwrite
10
+ SOFT_MERGE = :"soft-merge"
11
+ REPLACE = :replace
12
+ NONE = :none
13
+
14
+ # @!method self.values
15
+ # @return [Array<Symbol>]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,295 @@
1
+ # frozen_string_literal: true
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
+ # Trigger fired when the journey is invoked via the API. The optional `schema` field is a JSON Schema that validates the invocation payload.
12
+ variant -> { Courier::JourneyAPIInvokeTriggerNode }
13
+
14
+ # Trigger fired by a segment event (`identify`, `group`, or `track`).
15
+ variant -> { Courier::JourneySegmentTriggerNode }
16
+
17
+ # Send a notification template to the recipient. Optionally override the recipient address, delay the send, or attach `data`.
18
+ variant -> { Courier::JourneySendNode }
19
+
20
+ # Pause the journey run for a fixed `duration`.
21
+ variant -> { Courier::JourneyDelayDurationNode }
22
+
23
+ # Pause the journey run `until` a specific time.
24
+ variant -> { Courier::JourneyDelayUntilNode }
25
+
26
+ # Issue an HTTP GET or DELETE request and merge the response into the journey state per `merge_strategy`.
27
+ variant -> { Courier::JourneyFetchGetDeleteNode }
28
+
29
+ # Issue an HTTP POST or PUT request with a `body` and merge the response into the journey state per `merge_strategy`.
30
+ variant -> { Courier::JourneyFetchPostPutNode }
31
+
32
+ # Invoke an AI step with `user_prompt` and optional `web_search`. Returns a structured response conforming to `output_schema`.
33
+ variant -> { Courier::JourneyAINode }
34
+
35
+ # Throttle the journey by a static `scope` (`user` or `global`), allowing at most `max_allowed` invocations per `period`.
36
+ variant -> { Courier::JourneyThrottleStaticNode }
37
+
38
+ # Throttle the journey by a dynamic `throttle_key`, allowing at most `max_allowed` invocations per `period`.
39
+ variant -> { Courier::JourneyThrottleDynamicNode }
40
+
41
+ # Collect events arriving at the node into a single batch and fire one downstream step with the aggregated payload. The first event into a batch owns the run; later contributing events terminate at the batch step. The batch releases when any of `max_items` is reached, a quiet window of `wait_period` elapses, or the `max_wait_period` ceiling hits.
42
+ variant -> { Courier::JourneyNode::JourneyBatchNode }
43
+
44
+ # Terminate the journey run.
45
+ variant -> { Courier::JourneyExitNode }
46
+
47
+ # Branch node. Routes to the first entry in `paths[]` whose `conditions` match, else falls through to `default.nodes`.
48
+ variant -> { Courier::JourneyNode::JourneyBranchNode }
49
+
50
+ class JourneyBatchNode < Courier::Internal::Type::BaseModel
51
+ # @!attribute max_wait_period
52
+ # ISO 8601 duration. Hard ceiling from the first event into the batch; releases
53
+ # the batch unconditionally when it elapses.
54
+ #
55
+ # @return [String]
56
+ required :max_wait_period, String
57
+
58
+ # @!attribute retain
59
+ # How to select which collected events to retain in the aggregated payload when
60
+ # the batch releases.
61
+ #
62
+ # @return [Courier::Models::JourneyNode::JourneyBatchNode::Retain]
63
+ required :retain, -> { Courier::JourneyNode::JourneyBatchNode::Retain }
64
+
65
+ # @!attribute scope
66
+ #
67
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Scope]
68
+ required :scope, enum: -> { Courier::JourneyNode::JourneyBatchNode::Scope }
69
+
70
+ # @!attribute type
71
+ #
72
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Type]
73
+ required :type, enum: -> { Courier::JourneyNode::JourneyBatchNode::Type }
74
+
75
+ # @!attribute wait_period
76
+ # ISO 8601 duration. Quiet window that releases the batch when it elapses with no
77
+ # new contributing events. Must be less than `max_wait_period`.
78
+ #
79
+ # @return [String]
80
+ required :wait_period, String
81
+
82
+ # @!attribute id
83
+ #
84
+ # @return [String, nil]
85
+ optional :id, String
86
+
87
+ # @!attribute category_key
88
+ # Optional partition key. Events with the same `category_key` are batched
89
+ # together; events with different values are batched separately.
90
+ #
91
+ # @return [String, nil]
92
+ optional :category_key, String
93
+
94
+ # @!attribute conditions
95
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
96
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
97
+ # express "no conditions".
98
+ #
99
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
100
+ optional :conditions, union: -> { Courier::JourneyConditionsField }
101
+
102
+ # @!attribute max_items
103
+ # Releases the batch once this many events have been collected.
104
+ #
105
+ # @return [Integer, nil]
106
+ optional :max_items, Integer
107
+
108
+ # @!method initialize(max_wait_period:, retain:, scope:, type:, wait_period:, id: nil, category_key: nil, conditions: nil, max_items: nil)
109
+ # Some parameter documentations has been truncated, see
110
+ # {Courier::Models::JourneyNode::JourneyBatchNode} for more details.
111
+ #
112
+ # Collect events arriving at the node into a single batch and fire one downstream
113
+ # step with the aggregated payload. The first event into a batch owns the run;
114
+ # later contributing events terminate at the batch step. The batch releases when
115
+ # any of `max_items` is reached, a quiet window of `wait_period` elapses, or the
116
+ # `max_wait_period` ceiling hits.
117
+ #
118
+ # @param max_wait_period [String] ISO 8601 duration. Hard ceiling from the first event into the batch; releases th
119
+ #
120
+ # @param retain [Courier::Models::JourneyNode::JourneyBatchNode::Retain] How to select which collected events to retain in the aggregated payload when th
121
+ #
122
+ # @param scope [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Scope]
123
+ #
124
+ # @param type [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Type]
125
+ #
126
+ # @param wait_period [String] ISO 8601 duration. Quiet window that releases the batch when it elapses with no
127
+ #
128
+ # @param id [String]
129
+ #
130
+ # @param category_key [String] Optional partition key. Events with the same `category_key` are batched together
131
+ #
132
+ # @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
133
+ #
134
+ # @param max_items [Integer] Releases the batch once this many events have been collected.
135
+
136
+ # @see Courier::Models::JourneyNode::JourneyBatchNode#retain
137
+ class Retain < Courier::Internal::Type::BaseModel
138
+ # @!attribute count
139
+ #
140
+ # @return [Integer]
141
+ required :count, Integer
142
+
143
+ # @!attribute type
144
+ #
145
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Retain::Type]
146
+ required :type, enum: -> { Courier::JourneyNode::JourneyBatchNode::Retain::Type }
147
+
148
+ # @!attribute sort_key
149
+ # Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
150
+ # `highest` or `lowest`.
151
+ #
152
+ # @return [String, nil]
153
+ optional :sort_key, String
154
+
155
+ # @!method initialize(count:, type:, sort_key: nil)
156
+ # Some parameter documentations has been truncated, see
157
+ # {Courier::Models::JourneyNode::JourneyBatchNode::Retain} for more details.
158
+ #
159
+ # How to select which collected events to retain in the aggregated payload when
160
+ # the batch releases.
161
+ #
162
+ # @param count [Integer]
163
+ #
164
+ # @param type [Symbol, Courier::Models::JourneyNode::JourneyBatchNode::Retain::Type]
165
+ #
166
+ # @param sort_key [String] Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
167
+
168
+ # @see Courier::Models::JourneyNode::JourneyBatchNode::Retain#type
169
+ module Type
170
+ extend Courier::Internal::Type::Enum
171
+
172
+ FIRST = :first
173
+ LAST = :last
174
+ HIGHEST = :highest
175
+ LOWEST = :lowest
176
+
177
+ # @!method self.values
178
+ # @return [Array<Symbol>]
179
+ end
180
+ end
181
+
182
+ # @see Courier::Models::JourneyNode::JourneyBatchNode#scope
183
+ module Scope
184
+ extend Courier::Internal::Type::Enum
185
+
186
+ USER = :user
187
+
188
+ # @!method self.values
189
+ # @return [Array<Symbol>]
190
+ end
191
+
192
+ # @see Courier::Models::JourneyNode::JourneyBatchNode#type
193
+ module Type
194
+ extend Courier::Internal::Type::Enum
195
+
196
+ BATCH = :batch
197
+
198
+ # @!method self.values
199
+ # @return [Array<Symbol>]
200
+ end
201
+ end
202
+
203
+ class JourneyBranchNode < Courier::Internal::Type::BaseModel
204
+ # @!attribute default
205
+ #
206
+ # @return [Courier::Models::JourneyNode::JourneyBranchNode::Default]
207
+ required :default, -> { Courier::JourneyNode::JourneyBranchNode::Default }
208
+
209
+ # @!attribute paths
210
+ #
211
+ # @return [Array<Courier::Models::JourneyNode::JourneyBranchNode::Path>]
212
+ required :paths, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyNode::JourneyBranchNode::Path] }
213
+
214
+ # @!attribute type
215
+ #
216
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBranchNode::Type]
217
+ required :type, enum: -> { Courier::JourneyNode::JourneyBranchNode::Type }
218
+
219
+ # @!attribute id
220
+ #
221
+ # @return [String, nil]
222
+ optional :id, String
223
+
224
+ # @!method initialize(default:, paths:, type:, id: nil)
225
+ # Branch node. Routes to the first entry in `paths[]` whose `conditions` match,
226
+ # else falls through to `default.nodes`.
227
+ #
228
+ # @param default [Courier::Models::JourneyNode::JourneyBranchNode::Default]
229
+ # @param paths [Array<Courier::Models::JourneyNode::JourneyBranchNode::Path>]
230
+ # @param type [Symbol, Courier::Models::JourneyNode::JourneyBranchNode::Type]
231
+ # @param id [String]
232
+
233
+ # @see Courier::Models::JourneyNode::JourneyBranchNode#default
234
+ class Default < Courier::Internal::Type::BaseModel
235
+ # @!attribute nodes
236
+ #
237
+ # @return [Array<Courier::Models::JourneyNode>]
238
+ required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
239
+
240
+ # @!attribute label
241
+ #
242
+ # @return [String, nil]
243
+ optional :label, String
244
+
245
+ # @!method initialize(nodes:, label: nil)
246
+ # @param nodes [Array<Courier::Models::JourneyNode>]
247
+ # @param label [String]
248
+ end
249
+
250
+ class Path < Courier::Internal::Type::BaseModel
251
+ # @!attribute conditions
252
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
253
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
254
+ # express "no conditions".
255
+ #
256
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup]
257
+ required :conditions, union: -> { Courier::JourneyConditionsField }
258
+
259
+ # @!attribute nodes
260
+ #
261
+ # @return [Array<Courier::Models::JourneyNode>]
262
+ required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
263
+
264
+ # @!attribute label
265
+ #
266
+ # @return [String, nil]
267
+ optional :label, String
268
+
269
+ # @!method initialize(conditions:, nodes:, label: nil)
270
+ # Some parameter documentations has been truncated, see
271
+ # {Courier::Models::JourneyNode::JourneyBranchNode::Path} for more details.
272
+ #
273
+ # @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
274
+ #
275
+ # @param nodes [Array<Courier::Models::JourneyNode>]
276
+ #
277
+ # @param label [String]
278
+ end
279
+
280
+ # @see Courier::Models::JourneyNode::JourneyBranchNode#type
281
+ module Type
282
+ extend Courier::Internal::Type::Enum
283
+
284
+ BRANCH = :branch
285
+
286
+ # @!method self.values
287
+ # @return [Array<Symbol>]
288
+ end
289
+ end
290
+
291
+ # @!method self.variants
292
+ # @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::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode)]
293
+ end
294
+ end
295
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#publish
6
+ class JourneyPublishParams < Courier::Models::JourneyPublishRequest
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,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyPublishRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute version
7
+ #
8
+ # @return [String, nil]
9
+ optional :version, String
10
+
11
+ # @!method initialize(version: nil)
12
+ # Request body for publishing a journey. Pass `version` to roll back to a prior
13
+ # version; omit to publish the current draft.
14
+ #
15
+ # @param version [String]
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#replace
6
+ class JourneyReplaceParams < Courier::Models::CreateJourneyRequest
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,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#create
6
+ class JourneyResponse < Courier::Internal::Type::BaseModel
7
+ # @!attribute id
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute created
13
+ #
14
+ # @return [Integer, nil]
15
+ required :created, Integer, nil?: true
16
+
17
+ # @!attribute creator
18
+ #
19
+ # @return [String, nil]
20
+ required :creator, String, nil?: true
21
+
22
+ # @!attribute enabled
23
+ #
24
+ # @return [Boolean]
25
+ required :enabled, Courier::Internal::Type::Boolean
26
+
27
+ # @!attribute name
28
+ #
29
+ # @return [String]
30
+ required :name, String
31
+
32
+ # @!attribute nodes
33
+ #
34
+ # @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::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
35
+ required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
36
+
37
+ # @!attribute published
38
+ #
39
+ # @return [Integer, nil]
40
+ required :published, Integer, nil?: true
41
+
42
+ # @!attribute state
43
+ # Lifecycle state of a journey.
44
+ #
45
+ # @return [Symbol, Courier::Models::JourneyState]
46
+ required :state, enum: -> { Courier::JourneyState }
47
+
48
+ # @!attribute updated
49
+ #
50
+ # @return [Integer, nil]
51
+ required :updated, Integer, nil?: true
52
+
53
+ # @!attribute updater
54
+ #
55
+ # @return [String, nil]
56
+ required :updater, String, nil?: true
57
+
58
+ # @!method initialize(id:, created:, creator:, enabled:, name:, nodes:, published:, state:, updated:, updater:)
59
+ # A journey, with its current draft or published nodes and metadata.
60
+ #
61
+ # @param id [String]
62
+ #
63
+ # @param created [Integer, nil]
64
+ #
65
+ # @param creator [String, nil]
66
+ #
67
+ # @param enabled [Boolean]
68
+ #
69
+ # @param name [String]
70
+ #
71
+ # @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::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
72
+ #
73
+ # @param published [Integer, nil]
74
+ #
75
+ # @param state [Symbol, Courier::Models::JourneyState] Lifecycle state of a journey.
76
+ #
77
+ # @param updated [Integer, nil]
78
+ #
79
+ # @param updater [String, nil]
80
+ end
81
+ end
82
+ end