trycourier 5.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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/README.md +1 -1
  4. data/lib/courier/internal/type/union.rb +7 -7
  5. data/lib/courier/models/apn.rb +19 -0
  6. data/lib/courier/models/automation_run_list_item.rb +57 -0
  7. data/lib/courier/models/automation_run_list_response.rb +25 -0
  8. data/lib/courier/models/automation_run_step.rb +64 -0
  9. data/lib/courier/models/automation_run_steps_response.rb +17 -0
  10. data/lib/courier/models/automations/run_list_params.rb +71 -0
  11. data/lib/courier/models/automations/run_list_steps_params.rb +22 -0
  12. data/lib/courier/models/create_journey_request.rb +2 -2
  13. data/lib/courier/models/expo.rb +1 -0
  14. data/lib/courier/models/journey_audience_trigger_node.rb +77 -0
  15. data/lib/courier/models/journey_node.rb +8 -2
  16. data/lib/courier/models/journey_response.rb +2 -2
  17. data/lib/courier/models/journey_run.rb +66 -0
  18. data/lib/courier/models/journey_run_list_item.rb +50 -0
  19. data/lib/courier/models/journey_run_list_response.rb +33 -0
  20. data/lib/courier/models/journey_run_response.rb +22 -0
  21. data/lib/courier/models/journey_run_step.rb +65 -0
  22. data/lib/courier/models/journey_run_steps_response.rb +17 -0
  23. data/lib/courier/models/journey_segment_trigger_node.rb +5 -1
  24. data/lib/courier/models/journey_webhook_trigger_node.rb +85 -0
  25. data/lib/courier/models/journeys/run_list_params.rb +71 -0
  26. data/lib/courier/models/journeys/run_list_steps_params.rb +22 -0
  27. data/lib/courier/models/journeys/run_retrieve_params.rb +22 -0
  28. data/lib/courier/models/multiple_tokens.rb +26 -3
  29. data/lib/courier/models/user_profile.rb +8 -4
  30. data/lib/courier/models/users/topic_preference.rb +21 -1
  31. data/lib/courier/models.rb +26 -2
  32. data/lib/courier/resources/automations/runs.rb +80 -0
  33. data/lib/courier/resources/automations.rb +6 -0
  34. data/lib/courier/resources/journeys/runs.rb +104 -0
  35. data/lib/courier/resources/journeys.rb +8 -2
  36. data/lib/courier/resources/notifications.rb +0 -22
  37. data/lib/courier/version.rb +1 -1
  38. data/lib/courier.rb +20 -1
  39. data/rbi/courier/models/apn.rbi +18 -0
  40. data/rbi/courier/models/automation_run_list_item.rbi +87 -0
  41. data/rbi/courier/models/automation_run_list_response.rbi +47 -0
  42. data/rbi/courier/models/automation_run_step.rbi +96 -0
  43. data/rbi/courier/models/automation_run_steps_response.rbi +28 -0
  44. data/rbi/courier/models/automations/run_list_params.rbi +114 -0
  45. data/rbi/courier/models/automations/run_list_steps_params.rbi +40 -0
  46. data/rbi/courier/models/create_journey_request.rbi +6 -0
  47. data/rbi/courier/models/expo.rbi +1 -0
  48. data/rbi/courier/models/journey_audience_trigger_node.rbi +162 -0
  49. data/rbi/courier/models/journey_node.rbi +2 -0
  50. data/rbi/courier/models/journey_response.rbi +2 -0
  51. data/rbi/courier/models/journey_run.rbi +97 -0
  52. data/rbi/courier/models/journey_run_list_item.rbi +79 -0
  53. data/rbi/courier/models/journey_run_list_response.rbi +58 -0
  54. data/rbi/courier/models/journey_run_response.rbi +33 -0
  55. data/rbi/courier/models/journey_run_step.rbi +97 -0
  56. data/rbi/courier/models/journey_run_steps_response.rbi +28 -0
  57. data/rbi/courier/models/journey_segment_trigger_node.rbi +9 -1
  58. data/rbi/courier/models/journey_webhook_trigger_node.rbi +174 -0
  59. data/rbi/courier/models/journeys/run_list_params.rbi +111 -0
  60. data/rbi/courier/models/journeys/run_list_steps_params.rbi +40 -0
  61. data/rbi/courier/models/journeys/run_retrieve_params.rbi +40 -0
  62. data/rbi/courier/models/multiple_tokens.rbi +32 -4
  63. data/rbi/courier/models/user_profile.rbi +14 -3
  64. data/rbi/courier/models/users/topic_preference.rbi +33 -3
  65. data/rbi/courier/models.rbi +26 -2
  66. data/rbi/courier/resources/automations/runs.rbi +69 -0
  67. data/rbi/courier/resources/automations.rbi +5 -0
  68. data/rbi/courier/resources/journeys/runs.rbi +87 -0
  69. data/rbi/courier/resources/journeys.rbi +9 -0
  70. data/rbi/courier/resources/notifications.rbi +0 -16
  71. data/sig/courier/models/apn.rbs +11 -0
  72. data/sig/courier/models/automation_run_list_item.rbs +46 -0
  73. data/sig/courier/models/automation_run_list_response.rbs +24 -0
  74. data/sig/courier/models/automation_run_step.rbs +53 -0
  75. data/sig/courier/models/automation_run_steps_response.rbs +14 -0
  76. data/sig/courier/models/automations/run_list_params.rbs +65 -0
  77. data/sig/courier/models/automations/run_list_steps_params.rbs +22 -0
  78. data/sig/courier/models/journey_audience_trigger_node.rbs +66 -0
  79. data/sig/courier/models/journey_node.rbs +2 -0
  80. data/sig/courier/models/journey_run.rbs +53 -0
  81. data/sig/courier/models/journey_run_list_item.rbs +46 -0
  82. data/sig/courier/models/journey_run_list_response.rbs +34 -0
  83. data/sig/courier/models/journey_run_response.rbs +13 -0
  84. data/sig/courier/models/journey_run_step.rbs +53 -0
  85. data/sig/courier/models/journey_run_steps_response.rbs +14 -0
  86. data/sig/courier/models/journey_segment_trigger_node.rbs +2 -1
  87. data/sig/courier/models/journey_webhook_trigger_node.rbs +73 -0
  88. data/sig/courier/models/journeys/run_list_params.rbs +65 -0
  89. data/sig/courier/models/journeys/run_list_steps_params.rbs +25 -0
  90. data/sig/courier/models/journeys/run_retrieve_params.rbs +25 -0
  91. data/sig/courier/models/multiple_tokens.rbs +14 -4
  92. data/sig/courier/models/user_profile.rbs +4 -4
  93. data/sig/courier/models/users/topic_preference.rbs +17 -3
  94. data/sig/courier/models.rbs +26 -2
  95. data/sig/courier/resources/automations/runs.rbs +24 -0
  96. data/sig/courier/resources/automations.rbs +2 -0
  97. data/sig/courier/resources/journeys/runs.rbs +29 -0
  98. data/sig/courier/resources/journeys.rbs +2 -0
  99. data/sig/courier/resources/notifications.rbs +0 -5
  100. metadata +62 -5
  101. data/lib/courier/models/notification_duplicate_params.rb +0 -20
  102. data/rbi/courier/models/notification_duplicate_params.rbi +0 -38
  103. data/sig/courier/models/notification_duplicate_params.rbs +0 -20
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyRunListResponse < Courier::Internal::Type::BaseModel
6
+ # @!attribute runs
7
+ #
8
+ # @return [Array<Courier::Models::JourneyRunListItem>]
9
+ required :runs, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyRunListItem] }
10
+
11
+ # @!attribute next_cursor
12
+ # Pass back as `cursor` to fetch the next page. Absent on the last page.
13
+ #
14
+ # @return [String, nil]
15
+ optional :next_cursor, String
16
+
17
+ # @!attribute prev_cursor
18
+ # Pass back as `cursor` to fetch the previous page. Absent on the first page.
19
+ #
20
+ # @return [String, nil]
21
+ optional :prev_cursor, String
22
+
23
+ # @!method initialize(runs:, next_cursor: nil, prev_cursor: nil)
24
+ # A page of Journey runs.
25
+ #
26
+ # @param runs [Array<Courier::Models::JourneyRunListItem>]
27
+ #
28
+ # @param next_cursor [String] Pass back as `cursor` to fetch the next page. Absent on the last page.
29
+ #
30
+ # @param prev_cursor [String] Pass back as `cursor` to fetch the previous page. Absent on the first page.
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyRunResponse < Courier::Internal::Type::BaseModel
6
+ # @!attribute run
7
+ # One run of a Journey. `status` and `created_at` are absent on a small number of
8
+ # legacy runs stored without them.
9
+ #
10
+ # @return [Courier::Models::JourneyRun]
11
+ required :run, -> { Courier::JourneyRun }
12
+
13
+ # @!method initialize(run:)
14
+ # Some parameter documentations has been truncated, see
15
+ # {Courier::Models::JourneyRunResponse} for more details.
16
+ #
17
+ # A single Journey run.
18
+ #
19
+ # @param run [Courier::Models::JourneyRun] One run of a Journey. `status` and `created_at` are absent on a small number of
20
+ end
21
+ end
22
+ end
@@ -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 `track`).
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
@@ -4,12 +4,35 @@ module Courier
4
4
  module Models
5
5
  class MultipleTokens < Courier::Internal::Type::BaseModel
6
6
  # @!attribute tokens
7
+ # One device token, or an array of them. The values are the token strings
8
+ # themselves — not objects.
7
9
  #
8
- # @return [Array<Courier::Models::Token>]
9
- required :tokens, -> { Courier::Internal::Type::ArrayOf[Courier::Token] }
10
+ # @return [String, Array<String>]
11
+ required :tokens, union: -> { Courier::MultipleTokens::Tokens }
10
12
 
11
13
  # @!method initialize(tokens:)
12
- # @param tokens [Array<Courier::Models::Token>]
14
+ # Some parameter documentations has been truncated, see
15
+ # {Courier::Models::MultipleTokens} for more details.
16
+ #
17
+ # @param tokens [String, Array<String>] One device token, or an array of them. The values are the token strings themselv
18
+
19
+ # One device token, or an array of them. The values are the token strings
20
+ # themselves — not objects.
21
+ #
22
+ # @see Courier::Models::MultipleTokens#tokens
23
+ module Tokens
24
+ extend Courier::Internal::Type::Union
25
+
26
+ variant String
27
+
28
+ variant -> { Courier::Models::MultipleTokens::Tokens::StringArray }
29
+
30
+ # @!method self.variants
31
+ # @return [Array(String, Array<String>)]
32
+
33
+ # @type [Courier::Internal::Type::Converter]
34
+ StringArray = Courier::Internal::Type::ArrayOf[String]
35
+ end
13
36
  end
14
37
  end
15
38
  end
@@ -14,9 +14,12 @@ module Courier
14
14
  optional :airship, -> { Courier::AirshipProfile }, nil?: true
15
15
 
16
16
  # @!attribute apn
17
+ # Apple Push Notification device tokens. Supply either a single `token` or a
18
+ # `tokens` value. A bare string is rejected by the provider — the token must be
19
+ # wrapped in this object.
17
20
  #
18
- # @return [String, nil]
19
- optional :apn, String, nil?: true
21
+ # @return [Courier::Models::Token, Courier::Models::MultipleTokens, nil]
22
+ optional :apn, union: -> { Courier::Apn }, nil?: true
20
23
 
21
24
  # @!attribute aws_sns
22
25
  # Routes a push notification through the AWS SNS provider. The target ARN must be
@@ -54,6 +57,7 @@ module Courier
54
57
  optional :email_verified, Courier::Internal::Type::Boolean, nil?: true
55
58
 
56
59
  # @!attribute expo
60
+ # Expo push tokens. Supply either a single `token` or a `tokens` value.
57
61
  #
58
62
  # @return [Courier::Models::Token, Courier::Models::MultipleTokens, nil]
59
63
  optional :expo, union: -> { Courier::Expo }, nil?: true
@@ -174,7 +178,7 @@ module Courier
174
178
  #
175
179
  # @param airship [Courier::Models::AirshipProfile, nil]
176
180
  #
177
- # @param apn [String, nil]
181
+ # @param apn [Courier::Models::Token, Courier::Models::MultipleTokens, nil] Apple Push Notification device tokens. Supply either a single `token` or a `toke
178
182
  #
179
183
  # @param aws_sns [Courier::Models::AwsSns, nil] Routes a push notification through the AWS SNS provider. The target ARN must be
180
184
  #
@@ -188,7 +192,7 @@ module Courier
188
192
  #
189
193
  # @param email_verified [Boolean, nil]
190
194
  #
191
- # @param expo [Courier::Models::Token, Courier::Models::MultipleTokens, nil]
195
+ # @param expo [Courier::Models::Token, Courier::Models::MultipleTokens, nil] Expo push tokens. Supply either a single `token` or a `tokens` value.
192
196
  #
193
197
  # @param facebook_psid [String, nil]
194
198
  #
@@ -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
- # @!method initialize(default_status:, status:, topic_id:, topic_name:, custom_routing: nil, has_custom_routing: nil)
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
@@ -45,6 +45,8 @@ module Courier
45
45
 
46
46
  Alignment = Courier::Models::Alignment
47
47
 
48
+ Apn = Courier::Models::Apn
49
+
48
50
  AssociatedNotificationListResponse = Courier::Models::AssociatedNotificationListResponse
49
51
 
50
52
  Audience = Courier::Models::Audience
@@ -77,6 +79,14 @@ module Courier
77
79
 
78
80
  AutomationListParams = Courier::Models::AutomationListParams
79
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
+
80
90
  Automations = Courier::Models::Automations
81
91
 
82
92
  AutomationTemplate = Courier::Models::AutomationTemplate
@@ -243,6 +253,8 @@ module Courier
243
253
 
244
254
  JourneyArchiveParams = Courier::Models::JourneyArchiveParams
245
255
 
256
+ JourneyAudienceTriggerNode = Courier::Models::JourneyAudienceTriggerNode
257
+
246
258
  JourneyCancelParams = Courier::Models::JourneyCancelParams
247
259
 
248
260
  # @type [Courier::Internal::Type::Converter]
@@ -290,6 +302,18 @@ module Courier
290
302
 
291
303
  JourneyRetrieveParams = Courier::Models::JourneyRetrieveParams
292
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
+
293
317
  Journeys = Courier::Models::Journeys
294
318
 
295
319
  JourneySegmentTriggerNode = Courier::Models::JourneySegmentTriggerNode
@@ -324,6 +348,8 @@ module Courier
324
348
 
325
349
  JourneyVersionsListResponse = Courier::Models::JourneyVersionsListResponse
326
350
 
351
+ JourneyWebhookTriggerNode = Courier::Models::JourneyWebhookTriggerNode
352
+
327
353
  ListDeleteParams = Courier::Models::ListDeleteParams
328
354
 
329
355
  ListFilter = Courier::Models::ListFilter
@@ -392,8 +418,6 @@ module Courier
392
418
 
393
419
  NotificationCreateParams = Courier::Models::NotificationCreateParams
394
420
 
395
- NotificationDuplicateParams = Courier::Models::NotificationDuplicateParams
396
-
397
421
  NotificationElementPutRequest = Courier::Models::NotificationElementPutRequest
398
422
 
399
423
  NotificationGetContent = Courier::Models::NotificationGetContent
@@ -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