trycourier 4.11.0 → 4.13.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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/lib/courier/client.rb +4 -0
  4. data/lib/courier/models/brand_create_params.rb +7 -7
  5. data/lib/courier/models/create_journey_request.rb +2 -2
  6. data/lib/courier/models/digest_category.rb +53 -0
  7. data/lib/courier/models/digest_instance.rb +98 -0
  8. data/lib/courier/models/digest_instance_list_response.rb +72 -0
  9. data/lib/courier/models/digests/schedule_list_instances_params.rb +43 -0
  10. data/lib/courier/models/digests/schedule_release_params.rb +22 -0
  11. data/lib/courier/models/journey_node.rb +157 -1
  12. data/lib/courier/models/journey_response.rb +2 -2
  13. data/lib/courier/models.rb +8 -0
  14. data/lib/courier/resources/brands.rb +4 -3
  15. data/lib/courier/resources/digests/schedules.rb +72 -0
  16. data/lib/courier/resources/digests.rb +18 -0
  17. data/lib/courier/resources/journeys.rb +2 -2
  18. data/lib/courier/version.rb +1 -1
  19. data/lib/courier.rb +7 -0
  20. data/rbi/courier/client.rbi +3 -0
  21. data/rbi/courier/models/brand_create_params.rbi +8 -8
  22. data/rbi/courier/models/create_journey_request.rbi +3 -0
  23. data/rbi/courier/models/digest_category.rbi +82 -0
  24. data/rbi/courier/models/digest_instance.rbi +138 -0
  25. data/rbi/courier/models/digest_instance_list_response.rbi +104 -0
  26. data/rbi/courier/models/digests/schedule_list_instances_params.rbi +70 -0
  27. data/rbi/courier/models/digests/schedule_release_params.rbi +40 -0
  28. data/rbi/courier/models/journey_node.rbi +315 -0
  29. data/rbi/courier/models/journey_response.rbi +1 -0
  30. data/rbi/courier/models.rbi +8 -0
  31. data/rbi/courier/resources/brands.rbi +4 -9
  32. data/rbi/courier/resources/digests/schedules.rbi +54 -0
  33. data/rbi/courier/resources/digests.rbi +15 -0
  34. data/rbi/courier/resources/journeys.rbi +2 -0
  35. data/sig/courier/client.rbs +2 -0
  36. data/sig/courier/models/brand_create_params.rbs +5 -5
  37. data/sig/courier/models/digest_category.rbs +46 -0
  38. data/sig/courier/models/digest_instance.rbs +83 -0
  39. data/sig/courier/models/digest_instance_list_response.rbs +57 -0
  40. data/sig/courier/models/digests/schedule_list_instances_params.rbs +38 -0
  41. data/sig/courier/models/digests/schedule_release_params.rbs +25 -0
  42. data/sig/courier/models/journey_node.rbs +130 -0
  43. data/sig/courier/models.rbs +8 -0
  44. data/sig/courier/resources/brands.rbs +1 -1
  45. data/sig/courier/resources/digests/schedules.rbs +21 -0
  46. data/sig/courier/resources/digests.rbs +9 -0
  47. metadata +23 -2
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Resources
5
+ class Digests
6
+ class Schedules
7
+ # Some parameter documentations has been truncated, see
8
+ # {Courier::Models::Digests::ScheduleListInstancesParams} for more details.
9
+ #
10
+ # List the digest instances for a schedule. Each instance represents the events
11
+ # accumulated for a single user against the schedule, and can be used to monitor
12
+ # digest accumulation before the digest is released.
13
+ #
14
+ # @overload list_instances(schedule_id, cursor: nil, limit: nil, request_options: {})
15
+ #
16
+ # @param schedule_id [String] The ID of the digest schedule, in the form `sch/{uuid}`. The value must be URL-e
17
+ #
18
+ # @param cursor [String] A cursor token from a previous response, used to fetch the next page of results.
19
+ #
20
+ # @param limit [Integer] The maximum number of digest instances to return. Defaults to 20, with a maximum
21
+ #
22
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
23
+ #
24
+ # @return [Courier::Models::DigestInstanceListResponse]
25
+ #
26
+ # @see Courier::Models::Digests::ScheduleListInstancesParams
27
+ def list_instances(schedule_id, params = {})
28
+ parsed, options = Courier::Digests::ScheduleListInstancesParams.dump_request(params)
29
+ query = Courier::Internal::Util.encode_query_params(parsed)
30
+ @client.request(
31
+ method: :get,
32
+ path: ["digests/schedules/%1$s/instances", schedule_id],
33
+ query: query,
34
+ model: Courier::DigestInstanceListResponse,
35
+ options: options
36
+ )
37
+ end
38
+
39
+ # Some parameter documentations has been truncated, see
40
+ # {Courier::Models::Digests::ScheduleReleaseParams} for more details.
41
+ #
42
+ # Send a digest now instead of waiting for its scheduled time, so your users get
43
+ # what they have collected so far right away.
44
+ #
45
+ # @overload release(schedule_id, request_options: {})
46
+ #
47
+ # @param schedule_id [String] The ID of the digest schedule to release, in the form `sch/{uuid}`. The value mu
48
+ #
49
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
50
+ #
51
+ # @return [nil]
52
+ #
53
+ # @see Courier::Models::Digests::ScheduleReleaseParams
54
+ def release(schedule_id, params = {})
55
+ @client.request(
56
+ method: :post,
57
+ path: ["digests/schedules/%1$s/trigger", schedule_id],
58
+ model: NilClass,
59
+ options: params[:request_options]
60
+ )
61
+ end
62
+
63
+ # @api private
64
+ #
65
+ # @param client [Courier::Client]
66
+ def initialize(client:)
67
+ @client = client
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Resources
5
+ class Digests
6
+ # @return [Courier::Resources::Digests::Schedules]
7
+ attr_reader :schedules
8
+
9
+ # @api private
10
+ #
11
+ # @param client [Courier::Client]
12
+ def initialize(client:)
13
+ @client = client
14
+ @schedules = Courier::Resources::Digests::Schedules.new(client: client)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -17,7 +17,7 @@ module Courier
17
17
  #
18
18
  # @param name [String]
19
19
  #
20
- # @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>]
20
+ # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
21
21
  #
22
22
  # @param enabled [Boolean]
23
23
  #
@@ -204,7 +204,7 @@ module Courier
204
204
  #
205
205
  # @param name [String]
206
206
  #
207
- # @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>]
207
+ # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
208
208
  #
209
209
  # @param enabled [Boolean]
210
210
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.11.0"
4
+ VERSION = "4.13.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -134,6 +134,11 @@ require_relative "courier/models/channel_preference"
134
134
  require_relative "courier/models/check"
135
135
  require_relative "courier/models/default_preferences"
136
136
  require_relative "courier/models/device_type"
137
+ require_relative "courier/models/digest_category"
138
+ require_relative "courier/models/digest_instance"
139
+ require_relative "courier/models/digest_instance_list_response"
140
+ require_relative "courier/models/digests/schedule_list_instances_params"
141
+ require_relative "courier/models/digests/schedule_release_params"
137
142
  require_relative "courier/models/discord"
138
143
  require_relative "courier/models/elemental_action_node_with_type"
139
144
  require_relative "courier/models/elemental_channel_node_with_type"
@@ -389,6 +394,8 @@ require_relative "courier/resources/automations"
389
394
  require_relative "courier/resources/automations/invoke"
390
395
  require_relative "courier/resources/brands"
391
396
  require_relative "courier/resources/bulk"
397
+ require_relative "courier/resources/digests"
398
+ require_relative "courier/resources/digests/schedules"
392
399
  require_relative "courier/resources/inbound"
393
400
  require_relative "courier/resources/journeys"
394
401
  require_relative "courier/resources/journeys/templates"
@@ -40,6 +40,9 @@ module Courier
40
40
  sig { returns(Courier::Resources::Bulk) }
41
41
  attr_reader :bulk
42
42
 
43
+ sig { returns(Courier::Resources::Digests) }
44
+ attr_reader :digests
45
+
43
46
  sig { returns(Courier::Resources::Inbound) }
44
47
  attr_reader :inbound
45
48
 
@@ -14,15 +14,15 @@ module Courier
14
14
  sig { returns(String) }
15
15
  attr_accessor :name
16
16
 
17
- sig { returns(T.nilable(String)) }
18
- attr_accessor :id
19
-
20
- sig { returns(T.nilable(Courier::BrandSettings)) }
17
+ sig { returns(Courier::BrandSettings) }
21
18
  attr_reader :settings
22
19
 
23
- sig { params(settings: T.nilable(Courier::BrandSettings::OrHash)).void }
20
+ sig { params(settings: Courier::BrandSettings::OrHash).void }
24
21
  attr_writer :settings
25
22
 
23
+ sig { returns(T.nilable(String)) }
24
+ attr_accessor :id
25
+
26
26
  sig { returns(T.nilable(Courier::BrandSnippets)) }
27
27
  attr_reader :snippets
28
28
 
@@ -32,16 +32,16 @@ module Courier
32
32
  sig do
33
33
  params(
34
34
  name: String,
35
+ settings: Courier::BrandSettings::OrHash,
35
36
  id: T.nilable(String),
36
- settings: T.nilable(Courier::BrandSettings::OrHash),
37
37
  snippets: T.nilable(Courier::BrandSnippets::OrHash),
38
38
  request_options: Courier::RequestOptions::OrHash
39
39
  ).returns(T.attached_class)
40
40
  end
41
41
  def self.new(
42
42
  name:,
43
+ settings:,
43
44
  id: nil,
44
- settings: nil,
45
45
  snippets: nil,
46
46
  request_options: {}
47
47
  )
@@ -51,8 +51,8 @@ module Courier
51
51
  override.returns(
52
52
  {
53
53
  name: String,
54
+ settings: Courier::BrandSettings,
54
55
  id: T.nilable(String),
55
- settings: T.nilable(Courier::BrandSettings),
56
56
  snippets: T.nilable(Courier::BrandSnippets),
57
57
  request_options: Courier::RequestOptions
58
58
  }
@@ -25,6 +25,7 @@ module Courier
25
25
  Courier::JourneyAINode,
26
26
  Courier::JourneyThrottleStaticNode,
27
27
  Courier::JourneyThrottleDynamicNode,
28
+ Courier::JourneyNode::JourneyBatchNode,
28
29
  Courier::JourneyExitNode,
29
30
  Courier::JourneyNode::JourneyBranchNode
30
31
  )
@@ -63,6 +64,7 @@ module Courier
63
64
  Courier::JourneyAINode::OrHash,
64
65
  Courier::JourneyThrottleStaticNode::OrHash,
65
66
  Courier::JourneyThrottleDynamicNode::OrHash,
67
+ Courier::JourneyNode::JourneyBatchNode::OrHash,
66
68
  Courier::JourneyExitNode::OrHash,
67
69
  Courier::JourneyNode::JourneyBranchNode::OrHash
68
70
  )
@@ -97,6 +99,7 @@ module Courier
97
99
  Courier::JourneyAINode,
98
100
  Courier::JourneyThrottleStaticNode,
99
101
  Courier::JourneyThrottleDynamicNode,
102
+ Courier::JourneyNode::JourneyBatchNode,
100
103
  Courier::JourneyExitNode,
101
104
  Courier::JourneyNode::JourneyBranchNode
102
105
  )
@@ -0,0 +1,82 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class DigestCategory < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::DigestCategory, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # The key that identifies the category within the digest.
12
+ sig { returns(String) }
13
+ attr_accessor :category_key
14
+
15
+ # Which events to keep when the number of events exceeds the retention limit for
16
+ # the category.
17
+ sig { returns(Courier::DigestCategory::Retain::TaggedSymbol) }
18
+ attr_accessor :retain
19
+
20
+ # The data key used to order events when `retain` is `highest` or `lowest`.
21
+ sig { returns(T.nilable(String)) }
22
+ attr_reader :sort_key
23
+
24
+ sig { params(sort_key: String).void }
25
+ attr_writer :sort_key
26
+
27
+ sig do
28
+ params(
29
+ category_key: String,
30
+ retain: Courier::DigestCategory::Retain::OrSymbol,
31
+ sort_key: String
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(
35
+ # The key that identifies the category within the digest.
36
+ category_key:,
37
+ # Which events to keep when the number of events exceeds the retention limit for
38
+ # the category.
39
+ retain:,
40
+ # The data key used to order events when `retain` is `highest` or `lowest`.
41
+ sort_key: nil
42
+ )
43
+ end
44
+
45
+ sig do
46
+ override.returns(
47
+ {
48
+ category_key: String,
49
+ retain: Courier::DigestCategory::Retain::TaggedSymbol,
50
+ sort_key: String
51
+ }
52
+ )
53
+ end
54
+ def to_hash
55
+ end
56
+
57
+ # Which events to keep when the number of events exceeds the retention limit for
58
+ # the category.
59
+ module Retain
60
+ extend Courier::Internal::Type::Enum
61
+
62
+ TaggedSymbol =
63
+ T.type_alias { T.all(Symbol, Courier::DigestCategory::Retain) }
64
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
65
+
66
+ FIRST = T.let(:first, Courier::DigestCategory::Retain::TaggedSymbol)
67
+ LAST = T.let(:last, Courier::DigestCategory::Retain::TaggedSymbol)
68
+ HIGHEST = T.let(:highest, Courier::DigestCategory::Retain::TaggedSymbol)
69
+ LOWEST = T.let(:lowest, Courier::DigestCategory::Retain::TaggedSymbol)
70
+ NONE = T.let(:none, Courier::DigestCategory::Retain::TaggedSymbol)
71
+
72
+ sig do
73
+ override.returns(
74
+ T::Array[Courier::DigestCategory::Retain::TaggedSymbol]
75
+ )
76
+ end
77
+ def self.values
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,138 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class DigestInstance < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::DigestInstance, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # A unique identifier for the digest instance.
12
+ sig { returns(String) }
13
+ attr_accessor :digest_instance_id
14
+
15
+ # The total number of events received for this instance.
16
+ sig { returns(Integer) }
17
+ attr_accessor :event_count
18
+
19
+ # The status of the digest instance. `IN_PROGRESS` instances are still
20
+ # accumulating events; `COMPLETED` instances have been released.
21
+ sig { returns(Courier::DigestInstance::Status::TaggedSymbol) }
22
+ attr_accessor :status
23
+
24
+ # The ID of the user this digest instance belongs to.
25
+ sig { returns(String) }
26
+ attr_accessor :user_id
27
+
28
+ # The categories configured for the digest.
29
+ sig { returns(T.nilable(T::Array[Courier::DigestCategory])) }
30
+ attr_reader :categories
31
+
32
+ sig { params(categories: T::Array[Courier::DigestCategory::OrHash]).void }
33
+ attr_writer :categories
34
+
35
+ # A map of category key to the number of events received for that category.
36
+ sig { returns(T.nilable(T::Hash[Symbol, Integer])) }
37
+ attr_reader :category_key_counts
38
+
39
+ sig { params(category_key_counts: T::Hash[Symbol, Integer]).void }
40
+ attr_writer :category_key_counts
41
+
42
+ # An ISO 8601 timestamp of when the digest instance was created.
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :created_at
45
+
46
+ sig { params(created_at: String).void }
47
+ attr_writer :created_at
48
+
49
+ # Whether the digest instance has been disabled.
50
+ sig { returns(T.nilable(T::Boolean)) }
51
+ attr_reader :disabled
52
+
53
+ sig { params(disabled: T::Boolean).void }
54
+ attr_writer :disabled
55
+
56
+ # The ID of the tenant this digest instance belongs to, if any.
57
+ sig { returns(T.nilable(String)) }
58
+ attr_accessor :tenant_id
59
+
60
+ sig do
61
+ params(
62
+ digest_instance_id: String,
63
+ event_count: Integer,
64
+ status: Courier::DigestInstance::Status::OrSymbol,
65
+ user_id: String,
66
+ categories: T::Array[Courier::DigestCategory::OrHash],
67
+ category_key_counts: T::Hash[Symbol, Integer],
68
+ created_at: String,
69
+ disabled: T::Boolean,
70
+ tenant_id: T.nilable(String)
71
+ ).returns(T.attached_class)
72
+ end
73
+ def self.new(
74
+ # A unique identifier for the digest instance.
75
+ digest_instance_id:,
76
+ # The total number of events received for this instance.
77
+ event_count:,
78
+ # The status of the digest instance. `IN_PROGRESS` instances are still
79
+ # accumulating events; `COMPLETED` instances have been released.
80
+ status:,
81
+ # The ID of the user this digest instance belongs to.
82
+ user_id:,
83
+ # The categories configured for the digest.
84
+ categories: nil,
85
+ # A map of category key to the number of events received for that category.
86
+ category_key_counts: nil,
87
+ # An ISO 8601 timestamp of when the digest instance was created.
88
+ created_at: nil,
89
+ # Whether the digest instance has been disabled.
90
+ disabled: nil,
91
+ # The ID of the tenant this digest instance belongs to, if any.
92
+ tenant_id: nil
93
+ )
94
+ end
95
+
96
+ sig do
97
+ override.returns(
98
+ {
99
+ digest_instance_id: String,
100
+ event_count: Integer,
101
+ status: Courier::DigestInstance::Status::TaggedSymbol,
102
+ user_id: String,
103
+ categories: T::Array[Courier::DigestCategory],
104
+ category_key_counts: T::Hash[Symbol, Integer],
105
+ created_at: String,
106
+ disabled: T::Boolean,
107
+ tenant_id: T.nilable(String)
108
+ }
109
+ )
110
+ end
111
+ def to_hash
112
+ end
113
+
114
+ # The status of the digest instance. `IN_PROGRESS` instances are still
115
+ # accumulating events; `COMPLETED` instances have been released.
116
+ module Status
117
+ extend Courier::Internal::Type::Enum
118
+
119
+ TaggedSymbol =
120
+ T.type_alias { T.all(Symbol, Courier::DigestInstance::Status) }
121
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
122
+
123
+ IN_PROGRESS =
124
+ T.let(:IN_PROGRESS, Courier::DigestInstance::Status::TaggedSymbol)
125
+ COMPLETED =
126
+ T.let(:COMPLETED, Courier::DigestInstance::Status::TaggedSymbol)
127
+
128
+ sig do
129
+ override.returns(
130
+ T::Array[Courier::DigestInstance::Status::TaggedSymbol]
131
+ )
132
+ end
133
+ def self.values
134
+ end
135
+ end
136
+ end
137
+ end
138
+ end
@@ -0,0 +1,104 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class DigestInstanceListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::DigestInstanceListResponse, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # Whether there are more digest instances to fetch using the cursor.
12
+ sig { returns(T::Boolean) }
13
+ attr_accessor :has_more
14
+
15
+ # The digest instances for this page of results.
16
+ sig { returns(T::Array[Courier::DigestInstance]) }
17
+ attr_accessor :items
18
+
19
+ # Always `list` for a paginated list response.
20
+ sig { returns(Courier::DigestInstanceListResponse::Type::TaggedSymbol) }
21
+ attr_accessor :type
22
+
23
+ # A cursor token for fetching the next page of results, or null when there are
24
+ # none.
25
+ sig { returns(T.nilable(String)) }
26
+ attr_accessor :cursor
27
+
28
+ # The path to fetch the next page of results, or null when there are none.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :next_url
31
+
32
+ # The path of the current request.
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :url
35
+
36
+ sig { params(url: String).void }
37
+ attr_writer :url
38
+
39
+ sig do
40
+ params(
41
+ has_more: T::Boolean,
42
+ items: T::Array[Courier::DigestInstance::OrHash],
43
+ type: Courier::DigestInstanceListResponse::Type::OrSymbol,
44
+ cursor: T.nilable(String),
45
+ next_url: T.nilable(String),
46
+ url: String
47
+ ).returns(T.attached_class)
48
+ end
49
+ def self.new(
50
+ # Whether there are more digest instances to fetch using the cursor.
51
+ has_more:,
52
+ # The digest instances for this page of results.
53
+ items:,
54
+ # Always `list` for a paginated list response.
55
+ type:,
56
+ # A cursor token for fetching the next page of results, or null when there are
57
+ # none.
58
+ cursor: nil,
59
+ # The path to fetch the next page of results, or null when there are none.
60
+ next_url: nil,
61
+ # The path of the current request.
62
+ url: nil
63
+ )
64
+ end
65
+
66
+ sig do
67
+ override.returns(
68
+ {
69
+ has_more: T::Boolean,
70
+ items: T::Array[Courier::DigestInstance],
71
+ type: Courier::DigestInstanceListResponse::Type::TaggedSymbol,
72
+ cursor: T.nilable(String),
73
+ next_url: T.nilable(String),
74
+ url: String
75
+ }
76
+ )
77
+ end
78
+ def to_hash
79
+ end
80
+
81
+ # Always `list` for a paginated list response.
82
+ module Type
83
+ extend Courier::Internal::Type::Enum
84
+
85
+ TaggedSymbol =
86
+ T.type_alias do
87
+ T.all(Symbol, Courier::DigestInstanceListResponse::Type)
88
+ end
89
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
90
+
91
+ LIST =
92
+ T.let(:list, Courier::DigestInstanceListResponse::Type::TaggedSymbol)
93
+
94
+ sig do
95
+ override.returns(
96
+ T::Array[Courier::DigestInstanceListResponse::Type::TaggedSymbol]
97
+ )
98
+ end
99
+ def self.values
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
@@ -0,0 +1,70 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Digests
6
+ class ScheduleListInstancesParams < 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::Digests::ScheduleListInstancesParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :schedule_id
20
+
21
+ # A cursor token from a previous response, used to fetch the next page of results.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :cursor
24
+
25
+ sig { params(cursor: String).void }
26
+ attr_writer :cursor
27
+
28
+ # The maximum number of digest instances to return. Defaults to 20, with a maximum
29
+ # of 100.
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :limit
32
+
33
+ sig { params(limit: Integer).void }
34
+ attr_writer :limit
35
+
36
+ sig do
37
+ params(
38
+ schedule_id: String,
39
+ cursor: String,
40
+ limit: Integer,
41
+ request_options: Courier::RequestOptions::OrHash
42
+ ).returns(T.attached_class)
43
+ end
44
+ def self.new(
45
+ schedule_id:,
46
+ # A cursor token from a previous response, used to fetch the next page of results.
47
+ cursor: nil,
48
+ # The maximum number of digest instances to return. Defaults to 20, with a maximum
49
+ # of 100.
50
+ limit: nil,
51
+ request_options: {}
52
+ )
53
+ end
54
+
55
+ sig do
56
+ override.returns(
57
+ {
58
+ schedule_id: String,
59
+ cursor: String,
60
+ limit: Integer,
61
+ request_options: Courier::RequestOptions
62
+ }
63
+ )
64
+ end
65
+ def to_hash
66
+ end
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Digests
6
+ class ScheduleReleaseParams < 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::Digests::ScheduleReleaseParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :schedule_id
20
+
21
+ sig do
22
+ params(
23
+ schedule_id: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(schedule_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { schedule_id: String, request_options: Courier::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end