trycourier 6.0.0 → 6.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +1 -1
- data/lib/courier/models/automation_run_list_item.rb +57 -0
- data/lib/courier/models/automation_run_list_response.rb +25 -0
- data/lib/courier/models/automation_run_step.rb +64 -0
- data/lib/courier/models/automation_run_steps_response.rb +17 -0
- data/lib/courier/models/automations/run_list_params.rb +71 -0
- data/lib/courier/models/automations/run_list_steps_params.rb +22 -0
- data/lib/courier/models/create_journey_request.rb +2 -2
- data/lib/courier/models/journey_audience_trigger_node.rb +77 -0
- data/lib/courier/models/journey_node.rb +8 -2
- data/lib/courier/models/journey_response.rb +2 -2
- data/lib/courier/models/journey_run.rb +66 -0
- data/lib/courier/models/journey_run_list_item.rb +50 -0
- data/lib/courier/models/journey_run_list_response.rb +33 -0
- data/lib/courier/models/journey_run_response.rb +22 -0
- data/lib/courier/models/journey_run_step.rb +65 -0
- data/lib/courier/models/journey_run_steps_response.rb +17 -0
- data/lib/courier/models/journey_segment_trigger_node.rb +5 -1
- data/lib/courier/models/journey_webhook_trigger_node.rb +85 -0
- data/lib/courier/models/journeys/run_list_params.rb +71 -0
- data/lib/courier/models/journeys/run_list_steps_params.rb +22 -0
- data/lib/courier/models/journeys/run_retrieve_params.rb +22 -0
- data/lib/courier/models/users/topic_preference.rb +21 -1
- data/lib/courier/models.rb +24 -0
- data/lib/courier/resources/automations/runs.rb +80 -0
- data/lib/courier/resources/automations.rb +6 -0
- data/lib/courier/resources/journeys/runs.rb +104 -0
- data/lib/courier/resources/journeys.rb +8 -2
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +19 -0
- data/rbi/courier/models/automation_run_list_item.rbi +87 -0
- data/rbi/courier/models/automation_run_list_response.rbi +47 -0
- data/rbi/courier/models/automation_run_step.rbi +96 -0
- data/rbi/courier/models/automation_run_steps_response.rbi +28 -0
- data/rbi/courier/models/automations/run_list_params.rbi +114 -0
- data/rbi/courier/models/automations/run_list_steps_params.rbi +40 -0
- data/rbi/courier/models/create_journey_request.rbi +6 -0
- data/rbi/courier/models/journey_audience_trigger_node.rbi +162 -0
- data/rbi/courier/models/journey_node.rbi +2 -0
- data/rbi/courier/models/journey_response.rbi +2 -0
- data/rbi/courier/models/journey_run.rbi +97 -0
- data/rbi/courier/models/journey_run_list_item.rbi +79 -0
- data/rbi/courier/models/journey_run_list_response.rbi +58 -0
- data/rbi/courier/models/journey_run_response.rbi +33 -0
- data/rbi/courier/models/journey_run_step.rbi +97 -0
- data/rbi/courier/models/journey_run_steps_response.rbi +28 -0
- data/rbi/courier/models/journey_segment_trigger_node.rbi +9 -1
- data/rbi/courier/models/journey_webhook_trigger_node.rbi +174 -0
- data/rbi/courier/models/journeys/run_list_params.rbi +111 -0
- data/rbi/courier/models/journeys/run_list_steps_params.rbi +40 -0
- data/rbi/courier/models/journeys/run_retrieve_params.rbi +40 -0
- data/rbi/courier/models/users/topic_preference.rbi +33 -3
- data/rbi/courier/models.rbi +24 -0
- data/rbi/courier/resources/automations/runs.rbi +69 -0
- data/rbi/courier/resources/automations.rbi +5 -0
- data/rbi/courier/resources/journeys/runs.rbi +87 -0
- data/rbi/courier/resources/journeys.rbi +9 -0
- data/sig/courier/models/automation_run_list_item.rbs +46 -0
- data/sig/courier/models/automation_run_list_response.rbs +24 -0
- data/sig/courier/models/automation_run_step.rbs +53 -0
- data/sig/courier/models/automation_run_steps_response.rbs +14 -0
- data/sig/courier/models/automations/run_list_params.rbs +65 -0
- data/sig/courier/models/automations/run_list_steps_params.rbs +22 -0
- data/sig/courier/models/journey_audience_trigger_node.rbs +66 -0
- data/sig/courier/models/journey_node.rbs +2 -0
- data/sig/courier/models/journey_run.rbs +53 -0
- data/sig/courier/models/journey_run_list_item.rbs +46 -0
- data/sig/courier/models/journey_run_list_response.rbs +34 -0
- data/sig/courier/models/journey_run_response.rbs +13 -0
- data/sig/courier/models/journey_run_step.rbs +53 -0
- data/sig/courier/models/journey_run_steps_response.rbs +14 -0
- data/sig/courier/models/journey_segment_trigger_node.rbs +2 -1
- data/sig/courier/models/journey_webhook_trigger_node.rbs +73 -0
- data/sig/courier/models/journeys/run_list_params.rbs +65 -0
- data/sig/courier/models/journeys/run_list_steps_params.rbs +25 -0
- data/sig/courier/models/journeys/run_retrieve_params.rbs +25 -0
- data/sig/courier/models/users/topic_preference.rbs +17 -3
- data/sig/courier/models.rbs +24 -0
- data/sig/courier/resources/automations/runs.rbs +24 -0
- data/sig/courier/resources/automations.rbs +2 -0
- data/sig/courier/resources/journeys/runs.rbs +29 -0
- data/sig/courier/resources/journeys.rbs +2 -0
- metadata +59 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyRunStep < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute action
|
|
7
|
+
# The kind of node that ran, e.g. `send`, `delay`, or `exit`.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :action, String
|
|
11
|
+
|
|
12
|
+
# @!attribute status
|
|
13
|
+
# The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
|
|
14
|
+
# Not an enum — new values have been added before.
|
|
15
|
+
#
|
|
16
|
+
# @return [String]
|
|
17
|
+
required :status, String
|
|
18
|
+
|
|
19
|
+
# @!attribute created_at
|
|
20
|
+
# When the step started, as an ISO 8601 timestamp.
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :created_at, String
|
|
24
|
+
|
|
25
|
+
# @!attribute message_id
|
|
26
|
+
# The message this step produced, present on send steps. Pass it to
|
|
27
|
+
# `GET /messages/{message_id}` for delivery status. A send to a List or an
|
|
28
|
+
# Audience yields one id for the request, not one per recipient.
|
|
29
|
+
#
|
|
30
|
+
# @return [String, nil]
|
|
31
|
+
optional :message_id, String
|
|
32
|
+
|
|
33
|
+
# @!attribute node_id
|
|
34
|
+
# The id of the node in the published Journey that this step executed.
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
optional :node_id, String
|
|
38
|
+
|
|
39
|
+
# @!attribute updated_at
|
|
40
|
+
# When the step last changed state, as an ISO 8601 timestamp.
|
|
41
|
+
#
|
|
42
|
+
# @return [String, nil]
|
|
43
|
+
optional :updated_at, String
|
|
44
|
+
|
|
45
|
+
# @!method initialize(action:, status:, created_at: nil, message_id: nil, node_id: nil, updated_at: nil)
|
|
46
|
+
# Some parameter documentations has been truncated, see
|
|
47
|
+
# {Courier::Models::JourneyRunStep} for more details.
|
|
48
|
+
#
|
|
49
|
+
# One executed node of a Journey run. `node_id` is the id of the node in the
|
|
50
|
+
# published Journey, so a step maps directly onto the Journey graph.
|
|
51
|
+
#
|
|
52
|
+
# @param action [String] The kind of node that ran, e.g. `send`, `delay`, or `exit`.
|
|
53
|
+
#
|
|
54
|
+
# @param status [String] The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`. N
|
|
55
|
+
#
|
|
56
|
+
# @param created_at [String] When the step started, as an ISO 8601 timestamp.
|
|
57
|
+
#
|
|
58
|
+
# @param message_id [String] The message this step produced, present on send steps. Pass it to `GET /messages
|
|
59
|
+
#
|
|
60
|
+
# @param node_id [String] The id of the node in the published Journey that this step executed.
|
|
61
|
+
#
|
|
62
|
+
# @param updated_at [String] When the step last changed state, as an ISO 8601 timestamp.
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyRunStepsResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute steps
|
|
7
|
+
#
|
|
8
|
+
# @return [Array<Courier::Models::JourneyRunStep>]
|
|
9
|
+
required :steps, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyRunStep] }
|
|
10
|
+
|
|
11
|
+
# @!method initialize(steps:)
|
|
12
|
+
# Every step of a Journey run. Not paginated.
|
|
13
|
+
#
|
|
14
|
+
# @param steps [Array<Courier::Models::JourneyRunStep>]
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -40,7 +40,10 @@ module Courier
|
|
|
40
40
|
# Some parameter documentations has been truncated, see
|
|
41
41
|
# {Courier::Models::JourneySegmentTriggerNode} for more details.
|
|
42
42
|
#
|
|
43
|
-
# Trigger fired by a segment event (`identify`, `group`, or `
|
|
43
|
+
# Trigger fired by a segment event (`identify`, `group`, `track`, or `page`). A
|
|
44
|
+
# trigger with no `event_id` fires on any event of its type — the only shape
|
|
45
|
+
# `identify` and `group` can take, and the one that catches a stock
|
|
46
|
+
# `analytics.page()` call.
|
|
44
47
|
#
|
|
45
48
|
# @param request_type [Symbol, Courier::Models::JourneySegmentTriggerNode::RequestType]
|
|
46
49
|
#
|
|
@@ -61,6 +64,7 @@ module Courier
|
|
|
61
64
|
IDENTIFY = :identify
|
|
62
65
|
GROUP = :group
|
|
63
66
|
TRACK = :track
|
|
67
|
+
PAGE = :page
|
|
64
68
|
|
|
65
69
|
# @!method self.values
|
|
66
70
|
# @return [Array<Symbol>]
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class JourneyWebhookTriggerNode < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute event_source
|
|
7
|
+
# The provider key the webhook URL is minted for. Required, and must not contain a
|
|
8
|
+
# forward slash.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :event_source, String
|
|
12
|
+
|
|
13
|
+
# @!attribute trigger_type
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Courier::Models::JourneyWebhookTriggerNode::TriggerType]
|
|
16
|
+
required :trigger_type, enum: -> { Courier::JourneyWebhookTriggerNode::TriggerType }
|
|
17
|
+
|
|
18
|
+
# @!attribute type
|
|
19
|
+
#
|
|
20
|
+
# @return [Symbol, Courier::Models::JourneyWebhookTriggerNode::Type]
|
|
21
|
+
required :type, enum: -> { Courier::JourneyWebhookTriggerNode::Type }
|
|
22
|
+
|
|
23
|
+
# @!attribute id
|
|
24
|
+
#
|
|
25
|
+
# @return [String, nil]
|
|
26
|
+
optional :id, String
|
|
27
|
+
|
|
28
|
+
# @!attribute conditions
|
|
29
|
+
# Condition spec for a journey node. Accepts a single condition atom, an AND/OR
|
|
30
|
+
# group, or an AND/OR nested group. Omit the `conditions` property entirely to
|
|
31
|
+
# express "no conditions".
|
|
32
|
+
#
|
|
33
|
+
# @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
|
|
34
|
+
optional :conditions, union: -> { Courier::JourneyConditionsField }
|
|
35
|
+
|
|
36
|
+
# @!attribute event_id
|
|
37
|
+
# An optional event filter, matched against the payload's `event` field. A sender
|
|
38
|
+
# that supplies no `event` matches the literal `custom`. Must not contain a
|
|
39
|
+
# forward slash. Omit to accept every event delivered to the URL.
|
|
40
|
+
#
|
|
41
|
+
# @return [String, nil]
|
|
42
|
+
optional :event_id, String
|
|
43
|
+
|
|
44
|
+
# @!method initialize(event_source:, trigger_type:, type:, id: nil, conditions: nil, event_id: nil)
|
|
45
|
+
# Some parameter documentations has been truncated, see
|
|
46
|
+
# {Courier::Models::JourneyWebhookTriggerNode} for more details.
|
|
47
|
+
#
|
|
48
|
+
# Trigger fired when an external system POSTs to the webhook URL minted for
|
|
49
|
+
# `event_source`. Narrow it to one event with `event_id`, or omit `event_id` to
|
|
50
|
+
# accept every event delivered to the URL.
|
|
51
|
+
#
|
|
52
|
+
# @param event_source [String] The provider key the webhook URL is minted for. Required, and must not contain a
|
|
53
|
+
#
|
|
54
|
+
# @param trigger_type [Symbol, Courier::Models::JourneyWebhookTriggerNode::TriggerType]
|
|
55
|
+
#
|
|
56
|
+
# @param type [Symbol, Courier::Models::JourneyWebhookTriggerNode::Type]
|
|
57
|
+
#
|
|
58
|
+
# @param id [String]
|
|
59
|
+
#
|
|
60
|
+
# @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
|
|
61
|
+
#
|
|
62
|
+
# @param event_id [String] An optional event filter, matched against the payload's `event` field. A sender
|
|
63
|
+
|
|
64
|
+
# @see Courier::Models::JourneyWebhookTriggerNode#trigger_type
|
|
65
|
+
module TriggerType
|
|
66
|
+
extend Courier::Internal::Type::Enum
|
|
67
|
+
|
|
68
|
+
WEBHOOK = :webhook
|
|
69
|
+
|
|
70
|
+
# @!method self.values
|
|
71
|
+
# @return [Array<Symbol>]
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# @see Courier::Models::JourneyWebhookTriggerNode#type
|
|
75
|
+
module Type
|
|
76
|
+
extend Courier::Internal::Type::Enum
|
|
77
|
+
|
|
78
|
+
TRIGGER = :trigger
|
|
79
|
+
|
|
80
|
+
# @!method self.values
|
|
81
|
+
# @return [Array<Symbol>]
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module Journeys
|
|
6
|
+
# @see Courier::Resources::Journeys::Runs#list
|
|
7
|
+
class RunListParams < Courier::Internal::Type::BaseModel
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute cursor
|
|
12
|
+
# A cursor token for pagination. Use the `next_cursor` from the previous response
|
|
13
|
+
# to fetch the next page of results. Treat it as opaque.
|
|
14
|
+
#
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
optional :cursor, String
|
|
17
|
+
|
|
18
|
+
# @!attribute end_date
|
|
19
|
+
# An inclusive upper bound on `created_at`, in the same format as `start_date`.
|
|
20
|
+
#
|
|
21
|
+
# @return [String, nil]
|
|
22
|
+
optional :end_date, String
|
|
23
|
+
|
|
24
|
+
# @!attribute limit
|
|
25
|
+
# The number of runs to return per page, between `1` and `50`. Defaults to `20`.
|
|
26
|
+
# Values outside the range are clamped, and a non-numeric value falls back to
|
|
27
|
+
# `20`.
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :limit, String
|
|
31
|
+
|
|
32
|
+
# @!attribute start_date
|
|
33
|
+
# An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
|
|
34
|
+
# `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`.
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
optional :start_date, String
|
|
38
|
+
|
|
39
|
+
# @!attribute status
|
|
40
|
+
# A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
|
|
41
|
+
#
|
|
42
|
+
# @return [String, nil]
|
|
43
|
+
optional :status, String
|
|
44
|
+
|
|
45
|
+
# @!attribute template_id
|
|
46
|
+
# A comma-separated list of Journey ids to filter on.
|
|
47
|
+
#
|
|
48
|
+
# @return [String, nil]
|
|
49
|
+
optional :template_id, String
|
|
50
|
+
|
|
51
|
+
# @!method initialize(cursor: nil, end_date: nil, limit: nil, start_date: nil, status: nil, template_id: nil, request_options: {})
|
|
52
|
+
# Some parameter documentations has been truncated, see
|
|
53
|
+
# {Courier::Models::Journeys::RunListParams} for more details.
|
|
54
|
+
#
|
|
55
|
+
# @param cursor [String] A cursor token for pagination. Use the `next_cursor` from the previous response
|
|
56
|
+
#
|
|
57
|
+
# @param end_date [String] An inclusive upper bound on `created_at`, in the same format as `start_date`.
|
|
58
|
+
#
|
|
59
|
+
# @param limit [String] The number of runs to return per page, between `1` and `50`. Defaults to `20`. V
|
|
60
|
+
#
|
|
61
|
+
# @param start_date [String] An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
|
|
62
|
+
#
|
|
63
|
+
# @param status [String] A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
|
|
64
|
+
#
|
|
65
|
+
# @param template_id [String] A comma-separated list of Journey ids to filter on.
|
|
66
|
+
#
|
|
67
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module Journeys
|
|
6
|
+
# @see Courier::Resources::Journeys::Runs#list_steps
|
|
7
|
+
class RunListStepsParams < Courier::Internal::Type::BaseModel
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute run_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :run_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(run_id:, request_options: {})
|
|
17
|
+
# @param run_id [String]
|
|
18
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module Journeys
|
|
6
|
+
# @see Courier::Resources::Journeys::Runs#retrieve
|
|
7
|
+
class RunRetrieveParams < Courier::Internal::Type::BaseModel
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute run_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :run_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(run_id:, request_options: {})
|
|
17
|
+
# @param run_id [String]
|
|
18
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -48,7 +48,23 @@ module Courier
|
|
|
48
48
|
# @return [Boolean, nil]
|
|
49
49
|
optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
|
|
50
50
|
|
|
51
|
-
# @!
|
|
51
|
+
# @!attribute section_id
|
|
52
|
+
# The unique identifier of the section this topic belongs to. Always present when
|
|
53
|
+
# listing a user's preferences; omitted by the single-topic read when the topic
|
|
54
|
+
# has no resolvable section.
|
|
55
|
+
#
|
|
56
|
+
# @return [String, nil]
|
|
57
|
+
optional :section_id, String
|
|
58
|
+
|
|
59
|
+
# @!attribute section_name
|
|
60
|
+
# The display name of the section this topic belongs to. Always present when
|
|
61
|
+
# listing a user's preferences; omitted by the single-topic read when the topic
|
|
62
|
+
# has no resolvable section.
|
|
63
|
+
#
|
|
64
|
+
# @return [String, nil]
|
|
65
|
+
optional :section_name, String
|
|
66
|
+
|
|
67
|
+
# @!method initialize(default_status:, status:, topic_id:, topic_name:, custom_routing: nil, has_custom_routing: nil, section_id: nil, section_name: nil)
|
|
52
68
|
# Some parameter documentations has been truncated, see
|
|
53
69
|
# {Courier::Models::Users::TopicPreference} for more details.
|
|
54
70
|
#
|
|
@@ -63,6 +79,10 @@ module Courier
|
|
|
63
79
|
# @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The channels the user has chosen to receive this topic on, present only when has
|
|
64
80
|
#
|
|
65
81
|
# @param has_custom_routing [Boolean, nil] Whether the user has chosen specific delivery channels for this topic (listed in
|
|
82
|
+
#
|
|
83
|
+
# @param section_id [String] The unique identifier of the section this topic belongs to. Always present when
|
|
84
|
+
#
|
|
85
|
+
# @param section_name [String] The display name of the section this topic belongs to. Always present when listi
|
|
66
86
|
end
|
|
67
87
|
end
|
|
68
88
|
end
|
data/lib/courier/models.rb
CHANGED
|
@@ -79,6 +79,14 @@ module Courier
|
|
|
79
79
|
|
|
80
80
|
AutomationListParams = Courier::Models::AutomationListParams
|
|
81
81
|
|
|
82
|
+
AutomationRunListItem = Courier::Models::AutomationRunListItem
|
|
83
|
+
|
|
84
|
+
AutomationRunListResponse = Courier::Models::AutomationRunListResponse
|
|
85
|
+
|
|
86
|
+
AutomationRunStep = Courier::Models::AutomationRunStep
|
|
87
|
+
|
|
88
|
+
AutomationRunStepsResponse = Courier::Models::AutomationRunStepsResponse
|
|
89
|
+
|
|
82
90
|
Automations = Courier::Models::Automations
|
|
83
91
|
|
|
84
92
|
AutomationTemplate = Courier::Models::AutomationTemplate
|
|
@@ -245,6 +253,8 @@ module Courier
|
|
|
245
253
|
|
|
246
254
|
JourneyArchiveParams = Courier::Models::JourneyArchiveParams
|
|
247
255
|
|
|
256
|
+
JourneyAudienceTriggerNode = Courier::Models::JourneyAudienceTriggerNode
|
|
257
|
+
|
|
248
258
|
JourneyCancelParams = Courier::Models::JourneyCancelParams
|
|
249
259
|
|
|
250
260
|
# @type [Courier::Internal::Type::Converter]
|
|
@@ -292,6 +302,18 @@ module Courier
|
|
|
292
302
|
|
|
293
303
|
JourneyRetrieveParams = Courier::Models::JourneyRetrieveParams
|
|
294
304
|
|
|
305
|
+
JourneyRun = Courier::Models::JourneyRun
|
|
306
|
+
|
|
307
|
+
JourneyRunListItem = Courier::Models::JourneyRunListItem
|
|
308
|
+
|
|
309
|
+
JourneyRunListResponse = Courier::Models::JourneyRunListResponse
|
|
310
|
+
|
|
311
|
+
JourneyRunResponse = Courier::Models::JourneyRunResponse
|
|
312
|
+
|
|
313
|
+
JourneyRunStep = Courier::Models::JourneyRunStep
|
|
314
|
+
|
|
315
|
+
JourneyRunStepsResponse = Courier::Models::JourneyRunStepsResponse
|
|
316
|
+
|
|
295
317
|
Journeys = Courier::Models::Journeys
|
|
296
318
|
|
|
297
319
|
JourneySegmentTriggerNode = Courier::Models::JourneySegmentTriggerNode
|
|
@@ -326,6 +348,8 @@ module Courier
|
|
|
326
348
|
|
|
327
349
|
JourneyVersionsListResponse = Courier::Models::JourneyVersionsListResponse
|
|
328
350
|
|
|
351
|
+
JourneyWebhookTriggerNode = Courier::Models::JourneyWebhookTriggerNode
|
|
352
|
+
|
|
329
353
|
ListDeleteParams = Courier::Models::ListDeleteParams
|
|
330
354
|
|
|
331
355
|
ListFilter = Courier::Models::ListFilter
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Automations
|
|
6
|
+
# Invoke a stored automation template or an ad hoc automation defined in the
|
|
7
|
+
# request.
|
|
8
|
+
class Runs
|
|
9
|
+
# Some parameter documentations has been truncated, see
|
|
10
|
+
# {Courier::Models::Automations::RunListParams} for more details.
|
|
11
|
+
#
|
|
12
|
+
# List runs of the workspace's v2 Automations, newest first, filtered by status,
|
|
13
|
+
# Template, or date range and paged by cursor. Journey (v3) runs are listed by
|
|
14
|
+
# `GET /journeys/runs` instead — the two surfaces never return each other's runs.
|
|
15
|
+
# Runs are retained for 95 days.
|
|
16
|
+
#
|
|
17
|
+
# @overload list(cursor: nil, end_date: nil, limit: nil, start_date: nil, status: nil, template_id: nil, request_options: {})
|
|
18
|
+
#
|
|
19
|
+
# @param cursor [String] A cursor token for pagination. Use the `next_cursor` from the previous response
|
|
20
|
+
#
|
|
21
|
+
# @param end_date [String] An inclusive upper bound on `created_at`, in the same format as `start_date`.
|
|
22
|
+
#
|
|
23
|
+
# @param limit [String] The number of runs to return per page, between `1` and `50`. Defaults to `20`. V
|
|
24
|
+
#
|
|
25
|
+
# @param start_date [String] An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
|
|
26
|
+
#
|
|
27
|
+
# @param status [String] A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
|
|
28
|
+
#
|
|
29
|
+
# @param template_id [String] A comma-separated list of Automation Template ids to filter on.
|
|
30
|
+
#
|
|
31
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
32
|
+
#
|
|
33
|
+
# @return [Courier::Models::AutomationRunListResponse]
|
|
34
|
+
#
|
|
35
|
+
# @see Courier::Models::Automations::RunListParams
|
|
36
|
+
def list(params = {})
|
|
37
|
+
parsed, options = Courier::Automations::RunListParams.dump_request(params)
|
|
38
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
39
|
+
@client.request(
|
|
40
|
+
method: :get,
|
|
41
|
+
path: "automations/runs",
|
|
42
|
+
query: query,
|
|
43
|
+
model: Courier::AutomationRunListResponse,
|
|
44
|
+
options: options
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# List the per-step state of one Automation run, in full — this endpoint is not
|
|
49
|
+
# paginated. `message_id` is present on send steps that produced a message; follow
|
|
50
|
+
# it to `GET /messages/{message_id}` for delivery status. A send to a List or an
|
|
51
|
+
# Audience yields one `message_id` for the request, not one per recipient.
|
|
52
|
+
#
|
|
53
|
+
# @overload list_steps(id, request_options: {})
|
|
54
|
+
#
|
|
55
|
+
# @param id [String] A unique identifier representing the Automation run.
|
|
56
|
+
#
|
|
57
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
58
|
+
#
|
|
59
|
+
# @return [Courier::Models::AutomationRunStepsResponse]
|
|
60
|
+
#
|
|
61
|
+
# @see Courier::Models::Automations::RunListStepsParams
|
|
62
|
+
def list_steps(id, params = {})
|
|
63
|
+
@client.request(
|
|
64
|
+
method: :get,
|
|
65
|
+
path: ["automations/runs/%1$s/steps", id],
|
|
66
|
+
model: Courier::AutomationRunStepsResponse,
|
|
67
|
+
options: params[:request_options]
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# @api private
|
|
72
|
+
#
|
|
73
|
+
# @param client [Courier::Client]
|
|
74
|
+
def initialize(client:)
|
|
75
|
+
@client = client
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -10,6 +10,11 @@ module Courier
|
|
|
10
10
|
# @return [Courier::Resources::Automations::Invoke]
|
|
11
11
|
attr_reader :invoke
|
|
12
12
|
|
|
13
|
+
# Invoke a stored automation template or an ad hoc automation defined in the
|
|
14
|
+
# request.
|
|
15
|
+
# @return [Courier::Resources::Automations::Runs]
|
|
16
|
+
attr_reader :runs
|
|
17
|
+
|
|
13
18
|
# Some parameter documentations has been truncated, see
|
|
14
19
|
# {Courier::Models::AutomationListParams} for more details.
|
|
15
20
|
#
|
|
@@ -45,6 +50,7 @@ module Courier
|
|
|
45
50
|
def initialize(client:)
|
|
46
51
|
@client = client
|
|
47
52
|
@invoke = Courier::Resources::Automations::Invoke.new(client: client)
|
|
53
|
+
@runs = Courier::Resources::Automations::Runs.new(client: client)
|
|
48
54
|
end
|
|
49
55
|
end
|
|
50
56
|
end
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Resources
|
|
5
|
+
class Journeys
|
|
6
|
+
# Build, version, publish, invoke, and cancel multi-step notification workflows,
|
|
7
|
+
# along with the templates scoped to them.
|
|
8
|
+
class Runs
|
|
9
|
+
# Fetch one Journey run by id. Returns `404` for an unknown run, a run belonging
|
|
10
|
+
# to another workspace, a run past the 95-day retention window, or an Automation
|
|
11
|
+
# run id — the same body in every case, so the response never reveals whether a
|
|
12
|
+
# run exists elsewhere.
|
|
13
|
+
#
|
|
14
|
+
# @overload retrieve(run_id, request_options: {})
|
|
15
|
+
#
|
|
16
|
+
# @param run_id [String] A unique identifier representing the Journey run.
|
|
17
|
+
#
|
|
18
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
19
|
+
#
|
|
20
|
+
# @return [Courier::Models::JourneyRunResponse]
|
|
21
|
+
#
|
|
22
|
+
# @see Courier::Models::Journeys::RunRetrieveParams
|
|
23
|
+
def retrieve(run_id, params = {})
|
|
24
|
+
@client.request(
|
|
25
|
+
method: :get,
|
|
26
|
+
path: ["journeys/runs/%1$s", run_id],
|
|
27
|
+
model: Courier::JourneyRunResponse,
|
|
28
|
+
options: params[:request_options]
|
|
29
|
+
)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Some parameter documentations has been truncated, see
|
|
33
|
+
# {Courier::Models::Journeys::RunListParams} for more details.
|
|
34
|
+
#
|
|
35
|
+
# List runs of the workspace's Journeys, newest first, filtered by status,
|
|
36
|
+
# Journey, or date range and paged by cursor. Runs of v2 Automations are listed by
|
|
37
|
+
# `GET /automations/runs` instead — the two surfaces never return each other's
|
|
38
|
+
# runs. Runs are retained for 95 days.
|
|
39
|
+
#
|
|
40
|
+
# @overload list(cursor: nil, end_date: nil, limit: nil, start_date: nil, status: nil, template_id: nil, request_options: {})
|
|
41
|
+
#
|
|
42
|
+
# @param cursor [String] A cursor token for pagination. Use the `next_cursor` from the previous response
|
|
43
|
+
#
|
|
44
|
+
# @param end_date [String] An inclusive upper bound on `created_at`, in the same format as `start_date`.
|
|
45
|
+
#
|
|
46
|
+
# @param limit [String] The number of runs to return per page, between `1` and `50`. Defaults to `20`. V
|
|
47
|
+
#
|
|
48
|
+
# @param start_date [String] An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
|
|
49
|
+
#
|
|
50
|
+
# @param status [String] A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
|
|
51
|
+
#
|
|
52
|
+
# @param template_id [String] A comma-separated list of Journey ids to filter on.
|
|
53
|
+
#
|
|
54
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
55
|
+
#
|
|
56
|
+
# @return [Courier::Models::JourneyRunListResponse]
|
|
57
|
+
#
|
|
58
|
+
# @see Courier::Models::Journeys::RunListParams
|
|
59
|
+
def list(params = {})
|
|
60
|
+
parsed, options = Courier::Journeys::RunListParams.dump_request(params)
|
|
61
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
62
|
+
@client.request(
|
|
63
|
+
method: :get,
|
|
64
|
+
path: "journeys/runs",
|
|
65
|
+
query: query,
|
|
66
|
+
model: Courier::JourneyRunListResponse,
|
|
67
|
+
options: options
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# List the per-node state of one Journey run, in full — this endpoint is not
|
|
72
|
+
# paginated. Each step's `node_id` is the id of the node in the published Journey,
|
|
73
|
+
# so a step maps directly onto the Journey graph. `message_id` is present on send
|
|
74
|
+
# steps that produced a message; follow it to `GET /messages/{message_id}` for
|
|
75
|
+
# delivery status.
|
|
76
|
+
#
|
|
77
|
+
# @overload list_steps(run_id, request_options: {})
|
|
78
|
+
#
|
|
79
|
+
# @param run_id [String] A unique identifier representing the Journey run.
|
|
80
|
+
#
|
|
81
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
82
|
+
#
|
|
83
|
+
# @return [Courier::Models::JourneyRunStepsResponse]
|
|
84
|
+
#
|
|
85
|
+
# @see Courier::Models::Journeys::RunListStepsParams
|
|
86
|
+
def list_steps(run_id, params = {})
|
|
87
|
+
@client.request(
|
|
88
|
+
method: :get,
|
|
89
|
+
path: ["journeys/runs/%1$s/steps", run_id],
|
|
90
|
+
model: Courier::JourneyRunStepsResponse,
|
|
91
|
+
options: params[:request_options]
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# @api private
|
|
96
|
+
#
|
|
97
|
+
# @param client [Courier::Client]
|
|
98
|
+
def initialize(client:)
|
|
99
|
+
@client = client
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -10,6 +10,11 @@ module Courier
|
|
|
10
10
|
# @return [Courier::Resources::Journeys::Templates]
|
|
11
11
|
attr_reader :templates
|
|
12
12
|
|
|
13
|
+
# Build, version, publish, invoke, and cancel multi-step notification workflows,
|
|
14
|
+
# along with the templates scoped to them.
|
|
15
|
+
# @return [Courier::Resources::Journeys::Runs]
|
|
16
|
+
attr_reader :runs
|
|
17
|
+
|
|
13
18
|
# Some parameter documentations has been truncated, see
|
|
14
19
|
# {Courier::Models::JourneyCreateParams} for more details.
|
|
15
20
|
#
|
|
@@ -20,7 +25,7 @@ module Courier
|
|
|
20
25
|
#
|
|
21
26
|
# @param name [String] Body param
|
|
22
27
|
#
|
|
23
|
-
# @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::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>] Body param
|
|
28
|
+
# @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, 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::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>] Body param
|
|
24
29
|
#
|
|
25
30
|
# @param enabled [Boolean] Body param
|
|
26
31
|
#
|
|
@@ -263,7 +268,7 @@ module Courier
|
|
|
263
268
|
#
|
|
264
269
|
# @param name [String]
|
|
265
270
|
#
|
|
266
|
-
# @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::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
|
|
271
|
+
# @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, 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::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
|
|
267
272
|
#
|
|
268
273
|
# @param enabled [Boolean]
|
|
269
274
|
#
|
|
@@ -291,6 +296,7 @@ module Courier
|
|
|
291
296
|
def initialize(client:)
|
|
292
297
|
@client = client
|
|
293
298
|
@templates = Courier::Resources::Journeys::Templates.new(client: client)
|
|
299
|
+
@runs = Courier::Resources::Journeys::Runs.new(client: client)
|
|
294
300
|
end
|
|
295
301
|
end
|
|
296
302
|
end
|
data/lib/courier/version.rb
CHANGED