trycourier 4.10.2 → 4.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/lib/courier/client.rb +15 -1
  4. data/lib/courier/internal/transport/base_client.rb +2 -0
  5. data/lib/courier/models/create_journey_request.rb +39 -0
  6. data/lib/courier/models/journey_ai_node.rb +77 -0
  7. data/lib/courier/models/journey_api_invoke_trigger_node.rb +73 -0
  8. data/lib/courier/models/journey_archive_params.rb +20 -0
  9. data/lib/courier/models/journey_condition_atom.rb +8 -0
  10. data/lib/courier/models/journey_condition_group.rb +26 -0
  11. data/lib/courier/models/journey_condition_nested_group.rb +24 -0
  12. data/lib/courier/models/journey_conditions_field.rb +37 -0
  13. data/lib/courier/models/journey_create_params.rb +14 -0
  14. data/lib/courier/models/journey_delay_duration_node.rb +71 -0
  15. data/lib/courier/models/journey_delay_until_node.rb +71 -0
  16. data/lib/courier/models/journey_exit_node.rb +33 -0
  17. data/lib/courier/models/journey_fetch_get_delete_node.rb +103 -0
  18. data/lib/courier/models/journey_fetch_post_put_node.rb +110 -0
  19. data/lib/courier/models/journey_list_versions_params.rb +20 -0
  20. data/lib/courier/models/journey_merge_strategy.rb +18 -0
  21. data/lib/courier/models/journey_node.rb +139 -0
  22. data/lib/courier/models/journey_publish_params.rb +20 -0
  23. data/lib/courier/models/journey_publish_request.rb +18 -0
  24. data/lib/courier/models/journey_replace_params.rb +20 -0
  25. data/lib/courier/models/journey_response.rb +82 -0
  26. data/lib/courier/models/journey_retrieve_params.rb +29 -0
  27. data/lib/courier/models/journey_segment_trigger_node.rb +90 -0
  28. data/lib/courier/models/journey_send_node.rb +124 -0
  29. data/lib/courier/models/journey_state.rb +16 -0
  30. data/lib/courier/models/journey_template_create_request.rb +138 -0
  31. data/lib/courier/models/journey_template_get_response.rb +154 -0
  32. data/lib/courier/models/journey_template_list_response.rb +23 -0
  33. data/lib/courier/models/journey_template_publish_request.rb +18 -0
  34. data/lib/courier/models/journey_template_replace_request.rb +126 -0
  35. data/lib/courier/models/journey_template_summary.rb +60 -0
  36. data/lib/courier/models/journey_throttle_dynamic_node.rb +86 -0
  37. data/lib/courier/models/journey_throttle_static_node.rb +80 -0
  38. data/lib/courier/models/journey_version_item.rb +41 -0
  39. data/lib/courier/models/journey_versions_list_response.rb +24 -0
  40. data/lib/courier/models/journeys/template_archive_params.rb +28 -0
  41. data/lib/courier/models/journeys/template_create_params.rb +22 -0
  42. data/lib/courier/models/journeys/template_list_params.rb +39 -0
  43. data/lib/courier/models/journeys/template_list_versions_params.rb +28 -0
  44. data/lib/courier/models/journeys/template_publish_params.rb +28 -0
  45. data/lib/courier/models/journeys/template_replace_params.rb +28 -0
  46. data/lib/courier/models/journeys/template_retrieve_params.rb +28 -0
  47. data/lib/courier/models/tenants/template_delete_params.rb +28 -0
  48. data/lib/courier/models.rb +73 -0
  49. data/lib/courier/resources/journeys/templates.rb +224 -0
  50. data/lib/courier/resources/journeys.rb +167 -2
  51. data/lib/courier/resources/tenants/templates.rb +32 -0
  52. data/lib/courier/version.rb +1 -1
  53. data/lib/courier.rb +44 -0
  54. data/rbi/courier/models/create_journey_request.rbi +113 -0
  55. data/rbi/courier/models/journey_ai_node.rbi +141 -0
  56. data/rbi/courier/models/journey_api_invoke_trigger_node.rbi +164 -0
  57. data/rbi/courier/models/journey_archive_params.rbi +35 -0
  58. data/rbi/courier/models/journey_condition_atom.rbi +11 -0
  59. data/rbi/courier/models/journey_condition_group.rbi +43 -0
  60. data/rbi/courier/models/journey_condition_nested_group.rbi +51 -0
  61. data/rbi/courier/models/journey_conditions_field.rbi +27 -0
  62. data/rbi/courier/models/journey_create_params.rbi +27 -0
  63. data/rbi/courier/models/journey_delay_duration_node.rbi +146 -0
  64. data/rbi/courier/models/journey_delay_until_node.rbi +139 -0
  65. data/rbi/courier/models/journey_exit_node.rbi +57 -0
  66. data/rbi/courier/models/journey_fetch_get_delete_node.rbi +186 -0
  67. data/rbi/courier/models/journey_fetch_post_put_node.rbi +190 -0
  68. data/rbi/courier/models/journey_list_versions_params.rbi +35 -0
  69. data/rbi/courier/models/journey_merge_strategy.rbi +26 -0
  70. data/rbi/courier/models/journey_node.rbi +227 -0
  71. data/rbi/courier/models/journey_publish_params.rbi +35 -0
  72. data/rbi/courier/models/journey_publish_request.rbi +28 -0
  73. data/rbi/courier/models/journey_replace_params.rbi +35 -0
  74. data/rbi/courier/models/journey_response.rbi +108 -0
  75. data/rbi/courier/models/journey_retrieve_params.rbi +52 -0
  76. data/rbi/courier/models/journey_segment_trigger_node.rbi +200 -0
  77. data/rbi/courier/models/journey_send_node.rbi +254 -0
  78. data/rbi/courier/models/journey_state.rbi +20 -0
  79. data/rbi/courier/models/journey_template_create_request.rbi +381 -0
  80. data/rbi/courier/models/journey_template_get_response.rbi +334 -0
  81. data/rbi/courier/models/journey_template_list_response.rbi +45 -0
  82. data/rbi/courier/models/journey_template_publish_request.rbi +31 -0
  83. data/rbi/courier/models/journey_template_replace_request.rbi +368 -0
  84. data/rbi/courier/models/journey_template_summary.rbi +85 -0
  85. data/rbi/courier/models/journey_throttle_dynamic_node.rbi +162 -0
  86. data/rbi/courier/models/journey_throttle_static_node.rbi +158 -0
  87. data/rbi/courier/models/journey_version_item.rbi +54 -0
  88. data/rbi/courier/models/journey_versions_list_response.rbi +45 -0
  89. data/rbi/courier/models/journeys/template_archive_params.rbi +48 -0
  90. data/rbi/courier/models/journeys/template_create_params.rbi +40 -0
  91. data/rbi/courier/models/journeys/template_list_params.rbi +68 -0
  92. data/rbi/courier/models/journeys/template_list_versions_params.rbi +48 -0
  93. data/rbi/courier/models/journeys/template_publish_params.rbi +48 -0
  94. data/rbi/courier/models/journeys/template_replace_params.rbi +48 -0
  95. data/rbi/courier/models/journeys/template_retrieve_params.rbi +48 -0
  96. data/rbi/courier/models/tenants/template_delete_params.rbi +48 -0
  97. data/rbi/courier/models.rbi +76 -0
  98. data/rbi/courier/resources/journeys/templates.rbi +160 -0
  99. data/rbi/courier/resources/journeys.rbi +156 -3
  100. data/rbi/courier/resources/tenants/templates.rbi +22 -0
  101. data/sig/courier/models/create_journey_request.rbs +41 -0
  102. data/sig/courier/models/journey_ai_node.rbs +72 -0
  103. data/sig/courier/models/journey_api_invoke_trigger_node.rbs +68 -0
  104. data/sig/courier/models/journey_archive_params.rbs +23 -0
  105. data/sig/courier/models/journey_condition_atom.rbs +7 -0
  106. data/sig/courier/models/journey_condition_group.rbs +33 -0
  107. data/sig/courier/models/journey_condition_nested_group.rbs +33 -0
  108. data/sig/courier/models/journey_conditions_field.rbs +14 -0
  109. data/sig/courier/models/journey_create_params.rbs +15 -0
  110. data/sig/courier/models/journey_delay_duration_node.rbs +66 -0
  111. data/sig/courier/models/journey_delay_until_node.rbs +66 -0
  112. data/sig/courier/models/journey_exit_node.rbs +34 -0
  113. data/sig/courier/models/journey_fetch_get_delete_node.rbs +93 -0
  114. data/sig/courier/models/journey_fetch_post_put_node.rbs +100 -0
  115. data/sig/courier/models/journey_list_versions_params.rbs +23 -0
  116. data/sig/courier/models/journey_merge_strategy.rbs +16 -0
  117. data/sig/courier/models/journey_node.rbs +117 -0
  118. data/sig/courier/models/journey_publish_params.rbs +25 -0
  119. data/sig/courier/models/journey_publish_request.rbs +15 -0
  120. data/sig/courier/models/journey_replace_params.rbs +25 -0
  121. data/sig/courier/models/journey_response.rbs +65 -0
  122. data/sig/courier/models/journey_retrieve_params.rbs +30 -0
  123. data/sig/courier/models/journey_segment_trigger_node.rbs +85 -0
  124. data/sig/courier/models/journey_send_node.rbs +140 -0
  125. data/sig/courier/models/journey_state.rbs +14 -0
  126. data/sig/courier/models/journey_template_create_request.rbs +148 -0
  127. data/sig/courier/models/journey_template_get_response.rbs +157 -0
  128. data/sig/courier/models/journey_template_list_response.rbs +25 -0
  129. data/sig/courier/models/journey_template_publish_request.rbs +15 -0
  130. data/sig/courier/models/journey_template_replace_request.rbs +136 -0
  131. data/sig/courier/models/journey_template_summary.rbs +59 -0
  132. data/sig/courier/models/journey_throttle_dynamic_node.rbs +76 -0
  133. data/sig/courier/models/journey_throttle_static_node.rbs +72 -0
  134. data/sig/courier/models/journey_version_item.rbs +40 -0
  135. data/sig/courier/models/journey_versions_list_response.rbs +22 -0
  136. data/sig/courier/models/journeys/template_archive_params.rbs +30 -0
  137. data/sig/courier/models/journeys/template_create_params.rbs +27 -0
  138. data/sig/courier/models/journeys/template_list_params.rbs +38 -0
  139. data/sig/courier/models/journeys/template_list_versions_params.rbs +30 -0
  140. data/sig/courier/models/journeys/template_publish_params.rbs +34 -0
  141. data/sig/courier/models/journeys/template_replace_params.rbs +34 -0
  142. data/sig/courier/models/journeys/template_retrieve_params.rbs +30 -0
  143. data/sig/courier/models/tenants/template_delete_params.rbs +30 -0
  144. data/sig/courier/models.rbs +72 -0
  145. data/sig/courier/resources/journeys/templates.rbs +58 -0
  146. data/sig/courier/resources/journeys.rbs +41 -0
  147. data/sig/courier/resources/tenants/templates.rbs +6 -0
  148. metadata +134 -2
@@ -0,0 +1,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,139 @@
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
+ # Terminate the journey run.
42
+ variant -> { Courier::JourneyExitNode }
43
+
44
+ # Branch node. Routes to the first entry in `paths[]` whose `conditions` match, else falls through to `default.nodes`.
45
+ variant -> { Courier::JourneyNode::JourneyBranchNode }
46
+
47
+ class JourneyBranchNode < Courier::Internal::Type::BaseModel
48
+ # @!attribute default
49
+ #
50
+ # @return [Courier::Models::JourneyNode::JourneyBranchNode::Default]
51
+ required :default, -> { Courier::JourneyNode::JourneyBranchNode::Default }
52
+
53
+ # @!attribute paths
54
+ #
55
+ # @return [Array<Courier::Models::JourneyNode::JourneyBranchNode::Path>]
56
+ required :paths, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyNode::JourneyBranchNode::Path] }
57
+
58
+ # @!attribute type
59
+ #
60
+ # @return [Symbol, Courier::Models::JourneyNode::JourneyBranchNode::Type]
61
+ required :type, enum: -> { Courier::JourneyNode::JourneyBranchNode::Type }
62
+
63
+ # @!attribute id
64
+ #
65
+ # @return [String, nil]
66
+ optional :id, String
67
+
68
+ # @!method initialize(default:, paths:, type:, id: nil)
69
+ # Branch node. Routes to the first entry in `paths[]` whose `conditions` match,
70
+ # else falls through to `default.nodes`.
71
+ #
72
+ # @param default [Courier::Models::JourneyNode::JourneyBranchNode::Default]
73
+ # @param paths [Array<Courier::Models::JourneyNode::JourneyBranchNode::Path>]
74
+ # @param type [Symbol, Courier::Models::JourneyNode::JourneyBranchNode::Type]
75
+ # @param id [String]
76
+
77
+ # @see Courier::Models::JourneyNode::JourneyBranchNode#default
78
+ class Default < Courier::Internal::Type::BaseModel
79
+ # @!attribute nodes
80
+ #
81
+ # @return [Array<Courier::Models::JourneyNode>]
82
+ required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
83
+
84
+ # @!attribute label
85
+ #
86
+ # @return [String, nil]
87
+ optional :label, String
88
+
89
+ # @!method initialize(nodes:, label: nil)
90
+ # @param nodes [Array<Courier::Models::JourneyNode>]
91
+ # @param label [String]
92
+ end
93
+
94
+ class Path < Courier::Internal::Type::BaseModel
95
+ # @!attribute conditions
96
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
97
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
98
+ # express "no conditions".
99
+ #
100
+ # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup]
101
+ required :conditions, union: -> { Courier::JourneyConditionsField }
102
+
103
+ # @!attribute nodes
104
+ #
105
+ # @return [Array<Courier::Models::JourneyNode>]
106
+ required :nodes, -> { Courier::Internal::Type::ArrayOf[union: Courier::JourneyNode] }
107
+
108
+ # @!attribute label
109
+ #
110
+ # @return [String, nil]
111
+ optional :label, String
112
+
113
+ # @!method initialize(conditions:, nodes:, label: nil)
114
+ # Some parameter documentations has been truncated, see
115
+ # {Courier::Models::JourneyNode::JourneyBranchNode::Path} for more details.
116
+ #
117
+ # @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
118
+ #
119
+ # @param nodes [Array<Courier::Models::JourneyNode>]
120
+ #
121
+ # @param label [String]
122
+ end
123
+
124
+ # @see Courier::Models::JourneyNode::JourneyBranchNode#type
125
+ module Type
126
+ extend Courier::Internal::Type::Enum
127
+
128
+ BRANCH = :branch
129
+
130
+ # @!method self.values
131
+ # @return [Array<Symbol>]
132
+ end
133
+ end
134
+
135
+ # @!method self.variants
136
+ # @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)]
137
+ end
138
+ end
139
+ 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::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::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
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Journeys#retrieve
6
+ class JourneyRetrieveParams < 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
+ # @!attribute version
16
+ # Version selector: `draft`, `published` (default), or `vN`.
17
+ #
18
+ # @return [String, nil]
19
+ optional :version, String
20
+
21
+ # @!method initialize(template_id:, version: nil, request_options: {})
22
+ # @param template_id [String]
23
+ #
24
+ # @param version [String] Version selector: `draft`, `published` (default), or `vN`.
25
+ #
26
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneySegmentTriggerNode < Courier::Internal::Type::BaseModel
6
+ # @!attribute request_type
7
+ #
8
+ # @return [Symbol, Courier::Models::JourneySegmentTriggerNode::RequestType]
9
+ required :request_type, enum: -> { Courier::JourneySegmentTriggerNode::RequestType }
10
+
11
+ # @!attribute trigger_type
12
+ #
13
+ # @return [Symbol, Courier::Models::JourneySegmentTriggerNode::TriggerType]
14
+ required :trigger_type, enum: -> { Courier::JourneySegmentTriggerNode::TriggerType }
15
+
16
+ # @!attribute type
17
+ #
18
+ # @return [Symbol, Courier::Models::JourneySegmentTriggerNode::Type]
19
+ required :type, enum: -> { Courier::JourneySegmentTriggerNode::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
+ # @!attribute event_id
35
+ #
36
+ # @return [String, nil]
37
+ optional :event_id, String
38
+
39
+ # @!method initialize(request_type:, trigger_type:, type:, id: nil, conditions: nil, event_id: nil)
40
+ # Some parameter documentations has been truncated, see
41
+ # {Courier::Models::JourneySegmentTriggerNode} for more details.
42
+ #
43
+ # Trigger fired by a segment event (`identify`, `group`, or `track`).
44
+ #
45
+ # @param request_type [Symbol, Courier::Models::JourneySegmentTriggerNode::RequestType]
46
+ #
47
+ # @param trigger_type [Symbol, Courier::Models::JourneySegmentTriggerNode::TriggerType]
48
+ #
49
+ # @param type [Symbol, Courier::Models::JourneySegmentTriggerNode::Type]
50
+ #
51
+ # @param id [String]
52
+ #
53
+ # @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
54
+ #
55
+ # @param event_id [String]
56
+
57
+ # @see Courier::Models::JourneySegmentTriggerNode#request_type
58
+ module RequestType
59
+ extend Courier::Internal::Type::Enum
60
+
61
+ IDENTIFY = :identify
62
+ GROUP = :group
63
+ TRACK = :track
64
+
65
+ # @!method self.values
66
+ # @return [Array<Symbol>]
67
+ end
68
+
69
+ # @see Courier::Models::JourneySegmentTriggerNode#trigger_type
70
+ module TriggerType
71
+ extend Courier::Internal::Type::Enum
72
+
73
+ SEGMENT = :segment
74
+
75
+ # @!method self.values
76
+ # @return [Array<Symbol>]
77
+ end
78
+
79
+ # @see Courier::Models::JourneySegmentTriggerNode#type
80
+ module Type
81
+ extend Courier::Internal::Type::Enum
82
+
83
+ TRIGGER = :trigger
84
+
85
+ # @!method self.values
86
+ # @return [Array<Symbol>]
87
+ end
88
+ end
89
+ end
90
+ end