trycourier 6.0.0 → 6.2.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 (94) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -0
  3. data/README.md +1 -1
  4. data/lib/courier/models/automation_run_list_item.rb +57 -0
  5. data/lib/courier/models/automation_run_list_response.rb +25 -0
  6. data/lib/courier/models/automation_run_step.rb +64 -0
  7. data/lib/courier/models/automation_run_steps_response.rb +17 -0
  8. data/lib/courier/models/automations/run_list_params.rb +71 -0
  9. data/lib/courier/models/automations/run_list_steps_params.rb +22 -0
  10. data/lib/courier/models/create_journey_request.rb +2 -2
  11. data/lib/courier/models/journey_audience_trigger_node.rb +77 -0
  12. data/lib/courier/models/journey_node.rb +8 -2
  13. data/lib/courier/models/journey_response.rb +2 -2
  14. data/lib/courier/models/journey_run.rb +66 -0
  15. data/lib/courier/models/journey_run_list_item.rb +50 -0
  16. data/lib/courier/models/journey_run_list_response.rb +33 -0
  17. data/lib/courier/models/journey_run_response.rb +22 -0
  18. data/lib/courier/models/journey_run_step.rb +65 -0
  19. data/lib/courier/models/journey_run_steps_response.rb +17 -0
  20. data/lib/courier/models/journey_segment_trigger_node.rb +5 -1
  21. data/lib/courier/models/journey_webhook_trigger_node.rb +85 -0
  22. data/lib/courier/models/journeys/run_list_params.rb +71 -0
  23. data/lib/courier/models/journeys/run_list_steps_params.rb +22 -0
  24. data/lib/courier/models/journeys/run_retrieve_params.rb +22 -0
  25. data/lib/courier/models/notification_get_metrics_params.rb +83 -0
  26. data/lib/courier/models/notification_metrics_response.rb +165 -0
  27. data/lib/courier/models/users/topic_preference.rb +21 -1
  28. data/lib/courier/models.rb +28 -0
  29. data/lib/courier/resources/automations/runs.rb +80 -0
  30. data/lib/courier/resources/automations.rb +6 -0
  31. data/lib/courier/resources/journeys/runs.rb +104 -0
  32. data/lib/courier/resources/journeys.rb +8 -2
  33. data/lib/courier/resources/notifications.rb +53 -0
  34. data/lib/courier/version.rb +1 -1
  35. data/lib/courier.rb +21 -0
  36. data/rbi/courier/models/automation_run_list_item.rbi +87 -0
  37. data/rbi/courier/models/automation_run_list_response.rbi +47 -0
  38. data/rbi/courier/models/automation_run_step.rbi +96 -0
  39. data/rbi/courier/models/automation_run_steps_response.rbi +28 -0
  40. data/rbi/courier/models/automations/run_list_params.rbi +114 -0
  41. data/rbi/courier/models/automations/run_list_steps_params.rbi +40 -0
  42. data/rbi/courier/models/create_journey_request.rbi +6 -0
  43. data/rbi/courier/models/journey_audience_trigger_node.rbi +162 -0
  44. data/rbi/courier/models/journey_node.rbi +2 -0
  45. data/rbi/courier/models/journey_response.rbi +2 -0
  46. data/rbi/courier/models/journey_run.rbi +97 -0
  47. data/rbi/courier/models/journey_run_list_item.rbi +79 -0
  48. data/rbi/courier/models/journey_run_list_response.rbi +58 -0
  49. data/rbi/courier/models/journey_run_response.rbi +33 -0
  50. data/rbi/courier/models/journey_run_step.rbi +97 -0
  51. data/rbi/courier/models/journey_run_steps_response.rbi +28 -0
  52. data/rbi/courier/models/journey_segment_trigger_node.rbi +9 -1
  53. data/rbi/courier/models/journey_webhook_trigger_node.rbi +174 -0
  54. data/rbi/courier/models/journeys/run_list_params.rbi +111 -0
  55. data/rbi/courier/models/journeys/run_list_steps_params.rbi +40 -0
  56. data/rbi/courier/models/journeys/run_retrieve_params.rbi +40 -0
  57. data/rbi/courier/models/notification_get_metrics_params.rbi +167 -0
  58. data/rbi/courier/models/notification_metrics_response.rbi +269 -0
  59. data/rbi/courier/models/users/topic_preference.rbi +33 -3
  60. data/rbi/courier/models.rbi +28 -0
  61. data/rbi/courier/resources/automations/runs.rbi +69 -0
  62. data/rbi/courier/resources/automations.rbi +5 -0
  63. data/rbi/courier/resources/journeys/runs.rbi +87 -0
  64. data/rbi/courier/resources/journeys.rbi +9 -0
  65. data/rbi/courier/resources/notifications.rbi +57 -0
  66. data/sig/courier/models/automation_run_list_item.rbs +46 -0
  67. data/sig/courier/models/automation_run_list_response.rbs +24 -0
  68. data/sig/courier/models/automation_run_step.rbs +53 -0
  69. data/sig/courier/models/automation_run_steps_response.rbs +14 -0
  70. data/sig/courier/models/automations/run_list_params.rbs +65 -0
  71. data/sig/courier/models/automations/run_list_steps_params.rbs +22 -0
  72. data/sig/courier/models/journey_audience_trigger_node.rbs +66 -0
  73. data/sig/courier/models/journey_node.rbs +2 -0
  74. data/sig/courier/models/journey_run.rbs +53 -0
  75. data/sig/courier/models/journey_run_list_item.rbs +46 -0
  76. data/sig/courier/models/journey_run_list_response.rbs +34 -0
  77. data/sig/courier/models/journey_run_response.rbs +13 -0
  78. data/sig/courier/models/journey_run_step.rbs +53 -0
  79. data/sig/courier/models/journey_run_steps_response.rbs +14 -0
  80. data/sig/courier/models/journey_segment_trigger_node.rbs +2 -1
  81. data/sig/courier/models/journey_webhook_trigger_node.rbs +73 -0
  82. data/sig/courier/models/journeys/run_list_params.rbs +65 -0
  83. data/sig/courier/models/journeys/run_list_steps_params.rbs +25 -0
  84. data/sig/courier/models/journeys/run_retrieve_params.rbs +25 -0
  85. data/sig/courier/models/notification_get_metrics_params.rbs +69 -0
  86. data/sig/courier/models/notification_metrics_response.rbs +127 -0
  87. data/sig/courier/models/users/topic_preference.rbs +17 -3
  88. data/sig/courier/models.rbs +28 -0
  89. data/sig/courier/resources/automations/runs.rbs +24 -0
  90. data/sig/courier/resources/automations.rbs +2 -0
  91. data/sig/courier/resources/journeys/runs.rbs +29 -0
  92. data/sig/courier/resources/journeys.rbs +2 -0
  93. data/sig/courier/resources/notifications.rbs +9 -0
  94. metadata +65 -2
@@ -0,0 +1,114 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Automations
6
+ class RunListParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Automations::RunListParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ # A cursor token for pagination. Use the `next_cursor` from the previous response
19
+ # to fetch the next page of results. Treat it as opaque.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :cursor
22
+
23
+ sig { params(cursor: String).void }
24
+ attr_writer :cursor
25
+
26
+ # An inclusive upper bound on `created_at`, in the same format as `start_date`.
27
+ sig { returns(T.nilable(String)) }
28
+ attr_reader :end_date
29
+
30
+ sig { params(end_date: String).void }
31
+ attr_writer :end_date
32
+
33
+ # The number of runs to return per page, between `1` and `50`. Defaults to `20`.
34
+ # Values outside the range are clamped, and a non-numeric value falls back to
35
+ # `20`.
36
+ sig { returns(T.nilable(String)) }
37
+ attr_reader :limit
38
+
39
+ sig { params(limit: String).void }
40
+ attr_writer :limit
41
+
42
+ # An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
43
+ # `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`.
44
+ sig { returns(T.nilable(String)) }
45
+ attr_reader :start_date
46
+
47
+ sig { params(start_date: String).void }
48
+ attr_writer :start_date
49
+
50
+ # A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :status
53
+
54
+ sig { params(status: String).void }
55
+ attr_writer :status
56
+
57
+ # A comma-separated list of Automation Template ids to filter on.
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :template_id
60
+
61
+ sig { params(template_id: String).void }
62
+ attr_writer :template_id
63
+
64
+ sig do
65
+ params(
66
+ cursor: String,
67
+ end_date: String,
68
+ limit: String,
69
+ start_date: String,
70
+ status: String,
71
+ template_id: String,
72
+ request_options: Courier::RequestOptions::OrHash
73
+ ).returns(T.attached_class)
74
+ end
75
+ def self.new(
76
+ # A cursor token for pagination. Use the `next_cursor` from the previous response
77
+ # to fetch the next page of results. Treat it as opaque.
78
+ cursor: nil,
79
+ # An inclusive upper bound on `created_at`, in the same format as `start_date`.
80
+ end_date: nil,
81
+ # The number of runs to return per page, between `1` and `50`. Defaults to `20`.
82
+ # Values outside the range are clamped, and a non-numeric value falls back to
83
+ # `20`.
84
+ limit: nil,
85
+ # An inclusive lower bound on `created_at`, as an ISO 8601 date or timestamp (e.g.
86
+ # `2026-08-18` or `2026-08-18T20:06:36.259Z`). Any other format returns `400`.
87
+ start_date: nil,
88
+ # A comma-separated list of run statuses to filter on, e.g. `PROCESSED,ERROR`.
89
+ status: nil,
90
+ # A comma-separated list of Automation Template ids to filter on.
91
+ template_id: nil,
92
+ request_options: {}
93
+ )
94
+ end
95
+
96
+ sig do
97
+ override.returns(
98
+ {
99
+ cursor: String,
100
+ end_date: String,
101
+ limit: String,
102
+ start_date: String,
103
+ status: String,
104
+ template_id: String,
105
+ request_options: Courier::RequestOptions
106
+ }
107
+ )
108
+ end
109
+ def to_hash
110
+ end
111
+ end
112
+ end
113
+ end
114
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Automations
6
+ class RunListStepsParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Automations::RunListStepsParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :id
20
+
21
+ sig do
22
+ params(
23
+ id: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { id: String, request_options: Courier::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -17,6 +17,8 @@ module Courier
17
17
  T.any(
18
18
  Courier::JourneyAPIInvokeTriggerNode,
19
19
  Courier::JourneySegmentTriggerNode,
20
+ Courier::JourneyAudienceTriggerNode,
21
+ Courier::JourneyWebhookTriggerNode,
20
22
  Courier::JourneySendNode,
21
23
  Courier::JourneyDelayDurationNode,
22
24
  Courier::JourneyDelayUntilNode,
@@ -57,6 +59,8 @@ module Courier
57
59
  T.any(
58
60
  Courier::JourneyAPIInvokeTriggerNode::OrHash,
59
61
  Courier::JourneySegmentTriggerNode::OrHash,
62
+ Courier::JourneyAudienceTriggerNode::OrHash,
63
+ Courier::JourneyWebhookTriggerNode::OrHash,
60
64
  Courier::JourneySendNode::OrHash,
61
65
  Courier::JourneyDelayDurationNode::OrHash,
62
66
  Courier::JourneyDelayUntilNode::OrHash,
@@ -93,6 +97,8 @@ module Courier
93
97
  T.any(
94
98
  Courier::JourneyAPIInvokeTriggerNode,
95
99
  Courier::JourneySegmentTriggerNode,
100
+ Courier::JourneyAudienceTriggerNode,
101
+ Courier::JourneyWebhookTriggerNode,
96
102
  Courier::JourneySendNode,
97
103
  Courier::JourneyDelayDurationNode,
98
104
  Courier::JourneyDelayUntilNode,
@@ -0,0 +1,162 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyAudienceTriggerNode < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyAudienceTriggerNode, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # The Audience to watch. Must name a single Audience; wildcards are not supported.
12
+ sig { returns(String) }
13
+ attr_accessor :audience_id
14
+
15
+ sig do
16
+ returns(Courier::JourneyAudienceTriggerNode::TriggerType::OrSymbol)
17
+ end
18
+ attr_accessor :trigger_type
19
+
20
+ sig { returns(Courier::JourneyAudienceTriggerNode::Type::OrSymbol) }
21
+ attr_accessor :type
22
+
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :id
25
+
26
+ sig { params(id: String).void }
27
+ attr_writer :id
28
+
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
+ sig do
33
+ returns(
34
+ T.nilable(
35
+ T.any(
36
+ T::Array[String],
37
+ Courier::JourneyConditionGroup,
38
+ Courier::JourneyConditionNestedGroup
39
+ )
40
+ )
41
+ )
42
+ end
43
+ attr_reader :conditions
44
+
45
+ sig do
46
+ params(
47
+ conditions:
48
+ T.any(
49
+ T::Array[String],
50
+ Courier::JourneyConditionGroup::OrHash,
51
+ Courier::JourneyConditionNestedGroup::OrHash
52
+ )
53
+ ).void
54
+ end
55
+ attr_writer :conditions
56
+
57
+ # Trigger fired when a user newly matches an Audience. Leaving and re-joining the
58
+ # Audience re-enters the Journey. Membership is new-members-only: users already in
59
+ # the Audience when the Journey is published do not enter. Unlike the v2
60
+ # Automations audience trigger, there is no member scope, event type, or frequency
61
+ # mode to configure, and `audience_id` must name one Audience — wildcards are not
62
+ # supported.
63
+ sig do
64
+ params(
65
+ audience_id: String,
66
+ trigger_type:
67
+ Courier::JourneyAudienceTriggerNode::TriggerType::OrSymbol,
68
+ type: Courier::JourneyAudienceTriggerNode::Type::OrSymbol,
69
+ id: String,
70
+ conditions:
71
+ T.any(
72
+ T::Array[String],
73
+ Courier::JourneyConditionGroup::OrHash,
74
+ Courier::JourneyConditionNestedGroup::OrHash
75
+ )
76
+ ).returns(T.attached_class)
77
+ end
78
+ def self.new(
79
+ # The Audience to watch. Must name a single Audience; wildcards are not supported.
80
+ audience_id:,
81
+ trigger_type:,
82
+ type:,
83
+ id: nil,
84
+ # Condition spec for a journey node. Accepts a single condition atom, an AND/OR
85
+ # group, or an AND/OR nested group. Omit the `conditions` property entirely to
86
+ # express "no conditions".
87
+ conditions: nil
88
+ )
89
+ end
90
+
91
+ sig do
92
+ override.returns(
93
+ {
94
+ audience_id: String,
95
+ trigger_type:
96
+ Courier::JourneyAudienceTriggerNode::TriggerType::OrSymbol,
97
+ type: Courier::JourneyAudienceTriggerNode::Type::OrSymbol,
98
+ id: String,
99
+ conditions:
100
+ T.any(
101
+ T::Array[String],
102
+ Courier::JourneyConditionGroup,
103
+ Courier::JourneyConditionNestedGroup
104
+ )
105
+ }
106
+ )
107
+ end
108
+ def to_hash
109
+ end
110
+
111
+ module TriggerType
112
+ extend Courier::Internal::Type::Enum
113
+
114
+ TaggedSymbol =
115
+ T.type_alias do
116
+ T.all(Symbol, Courier::JourneyAudienceTriggerNode::TriggerType)
117
+ end
118
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
119
+
120
+ AUDIENCE =
121
+ T.let(
122
+ :audience,
123
+ Courier::JourneyAudienceTriggerNode::TriggerType::TaggedSymbol
124
+ )
125
+
126
+ sig do
127
+ override.returns(
128
+ T::Array[
129
+ Courier::JourneyAudienceTriggerNode::TriggerType::TaggedSymbol
130
+ ]
131
+ )
132
+ end
133
+ def self.values
134
+ end
135
+ end
136
+
137
+ module Type
138
+ extend Courier::Internal::Type::Enum
139
+
140
+ TaggedSymbol =
141
+ T.type_alias do
142
+ T.all(Symbol, Courier::JourneyAudienceTriggerNode::Type)
143
+ end
144
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
145
+
146
+ TRIGGER =
147
+ T.let(
148
+ :trigger,
149
+ Courier::JourneyAudienceTriggerNode::Type::TaggedSymbol
150
+ )
151
+
152
+ sig do
153
+ override.returns(
154
+ T::Array[Courier::JourneyAudienceTriggerNode::Type::TaggedSymbol]
155
+ )
156
+ end
157
+ def self.values
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end
@@ -13,6 +13,8 @@ module Courier
13
13
  T.any(
14
14
  Courier::JourneyAPIInvokeTriggerNode,
15
15
  Courier::JourneySegmentTriggerNode,
16
+ Courier::JourneyAudienceTriggerNode,
17
+ Courier::JourneyWebhookTriggerNode,
16
18
  Courier::JourneySendNode,
17
19
  Courier::JourneyDelayDurationNode,
18
20
  Courier::JourneyDelayUntilNode,
@@ -52,6 +52,8 @@ module Courier
52
52
  T.any(
53
53
  Courier::JourneyAPIInvokeTriggerNode::OrHash,
54
54
  Courier::JourneySegmentTriggerNode::OrHash,
55
+ Courier::JourneyAudienceTriggerNode::OrHash,
56
+ Courier::JourneyWebhookTriggerNode::OrHash,
55
57
  Courier::JourneySendNode::OrHash,
56
58
  Courier::JourneyDelayDurationNode::OrHash,
57
59
  Courier::JourneyDelayUntilNode::OrHash,
@@ -0,0 +1,97 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyRun < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(Courier::JourneyRun, Courier::Internal::AnyHash) }
8
+
9
+ # A unique identifier representing the run.
10
+ sig { returns(String) }
11
+ attr_accessor :run_id
12
+
13
+ # Internal provenance strings describing what started the run, e.g.
14
+ # `invoke/<journey_id>` or `segment/page/Pricing Page`. Diagnostic only — the
15
+ # format is unstable and should not be parsed.
16
+ sig { returns(T::Array[String]) }
17
+ attr_accessor :source
18
+
19
+ # When the run started, as an ISO 8601 timestamp.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :created_at
22
+
23
+ sig { params(created_at: String).void }
24
+ attr_writer :created_at
25
+
26
+ # The state of the run: `PROCESSING`, `PROCESSED`, `WAITING`, `CANCELED`, `ERROR`,
27
+ # `THROTTLED`, or `NOT PROCESSED`. Not an enum — new values have been added
28
+ # before.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :status
31
+
32
+ sig { params(status: String).void }
33
+ attr_writer :status
34
+
35
+ # The id of the Journey this run belongs to.
36
+ sig { returns(T.nilable(String)) }
37
+ attr_reader :template_id
38
+
39
+ sig { params(template_id: String).void }
40
+ attr_writer :template_id
41
+
42
+ # When the run last changed state, as an ISO 8601 timestamp.
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :updated_at
45
+
46
+ sig { params(updated_at: String).void }
47
+ attr_writer :updated_at
48
+
49
+ # One run of a Journey. `status` and `created_at` are absent on a small number of
50
+ # legacy runs stored without them.
51
+ sig do
52
+ params(
53
+ run_id: String,
54
+ source: T::Array[String],
55
+ created_at: String,
56
+ status: String,
57
+ template_id: String,
58
+ updated_at: String
59
+ ).returns(T.attached_class)
60
+ end
61
+ def self.new(
62
+ # A unique identifier representing the run.
63
+ run_id:,
64
+ # Internal provenance strings describing what started the run, e.g.
65
+ # `invoke/<journey_id>` or `segment/page/Pricing Page`. Diagnostic only — the
66
+ # format is unstable and should not be parsed.
67
+ source:,
68
+ # When the run started, as an ISO 8601 timestamp.
69
+ created_at: nil,
70
+ # The state of the run: `PROCESSING`, `PROCESSED`, `WAITING`, `CANCELED`, `ERROR`,
71
+ # `THROTTLED`, or `NOT PROCESSED`. Not an enum — new values have been added
72
+ # before.
73
+ status: nil,
74
+ # The id of the Journey this run belongs to.
75
+ template_id: nil,
76
+ # When the run last changed state, as an ISO 8601 timestamp.
77
+ updated_at: nil
78
+ )
79
+ end
80
+
81
+ sig do
82
+ override.returns(
83
+ {
84
+ run_id: String,
85
+ source: T::Array[String],
86
+ created_at: String,
87
+ status: String,
88
+ template_id: String,
89
+ updated_at: String
90
+ }
91
+ )
92
+ end
93
+ def to_hash
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,79 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyRunListItem < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyRunListItem, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # A unique identifier representing the run.
12
+ sig { returns(String) }
13
+ attr_accessor :run_id
14
+
15
+ # Internal provenance strings describing what started the run. Diagnostic only.
16
+ sig { returns(T::Array[String]) }
17
+ attr_accessor :source
18
+
19
+ # When the run started, as an ISO 8601 timestamp.
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :created_at
22
+
23
+ sig { params(created_at: String).void }
24
+ attr_writer :created_at
25
+
26
+ # The state of the run. See `JourneyRun.status` for the values it takes.
27
+ sig { returns(T.nilable(String)) }
28
+ attr_reader :status
29
+
30
+ sig { params(status: String).void }
31
+ attr_writer :status
32
+
33
+ # The id of the Journey this run belongs to.
34
+ sig { returns(T.nilable(String)) }
35
+ attr_reader :template_id
36
+
37
+ sig { params(template_id: String).void }
38
+ attr_writer :template_id
39
+
40
+ # A Journey run as it appears in a list response, without `updated_at`.
41
+ sig do
42
+ params(
43
+ run_id: String,
44
+ source: T::Array[String],
45
+ created_at: String,
46
+ status: String,
47
+ template_id: String
48
+ ).returns(T.attached_class)
49
+ end
50
+ def self.new(
51
+ # A unique identifier representing the run.
52
+ run_id:,
53
+ # Internal provenance strings describing what started the run. Diagnostic only.
54
+ source:,
55
+ # When the run started, as an ISO 8601 timestamp.
56
+ created_at: nil,
57
+ # The state of the run. See `JourneyRun.status` for the values it takes.
58
+ status: nil,
59
+ # The id of the Journey this run belongs to.
60
+ template_id: nil
61
+ )
62
+ end
63
+
64
+ sig do
65
+ override.returns(
66
+ {
67
+ run_id: String,
68
+ source: T::Array[String],
69
+ created_at: String,
70
+ status: String,
71
+ template_id: String
72
+ }
73
+ )
74
+ end
75
+ def to_hash
76
+ end
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,58 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyRunListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyRunListResponse, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(T::Array[Courier::JourneyRunListItem]) }
12
+ attr_accessor :runs
13
+
14
+ # Pass back as `cursor` to fetch the next page. Absent on the last page.
15
+ sig { returns(T.nilable(String)) }
16
+ attr_reader :next_cursor
17
+
18
+ sig { params(next_cursor: String).void }
19
+ attr_writer :next_cursor
20
+
21
+ # Pass back as `cursor` to fetch the previous page. Absent on the first page.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :prev_cursor
24
+
25
+ sig { params(prev_cursor: String).void }
26
+ attr_writer :prev_cursor
27
+
28
+ # A page of Journey runs.
29
+ sig do
30
+ params(
31
+ runs: T::Array[Courier::JourneyRunListItem::OrHash],
32
+ next_cursor: String,
33
+ prev_cursor: String
34
+ ).returns(T.attached_class)
35
+ end
36
+ def self.new(
37
+ runs:,
38
+ # Pass back as `cursor` to fetch the next page. Absent on the last page.
39
+ next_cursor: nil,
40
+ # Pass back as `cursor` to fetch the previous page. Absent on the first page.
41
+ prev_cursor: nil
42
+ )
43
+ end
44
+
45
+ sig do
46
+ override.returns(
47
+ {
48
+ runs: T::Array[Courier::JourneyRunListItem],
49
+ next_cursor: String,
50
+ prev_cursor: String
51
+ }
52
+ )
53
+ end
54
+ def to_hash
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,33 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyRunResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyRunResponse, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # One run of a Journey. `status` and `created_at` are absent on a small number of
12
+ # legacy runs stored without them.
13
+ sig { returns(Courier::JourneyRun) }
14
+ attr_reader :run
15
+
16
+ sig { params(run: Courier::JourneyRun::OrHash).void }
17
+ attr_writer :run
18
+
19
+ # A single Journey run.
20
+ sig { params(run: Courier::JourneyRun::OrHash).returns(T.attached_class) }
21
+ def self.new(
22
+ # One run of a Journey. `status` and `created_at` are absent on a small number of
23
+ # legacy runs stored without them.
24
+ run:
25
+ )
26
+ end
27
+
28
+ sig { override.returns({ run: Courier::JourneyRun }) }
29
+ def to_hash
30
+ end
31
+ end
32
+ end
33
+ end