trycourier 4.12.0 → 4.14.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 +16 -0
- data/lib/courier/client.rb +4 -0
- data/lib/courier/models/digest_category.rb +53 -0
- data/lib/courier/models/digest_instance.rb +98 -0
- data/lib/courier/models/digest_instance_list_response.rb +72 -0
- data/lib/courier/models/digests/schedule_list_instances_params.rb +43 -0
- data/lib/courier/models/digests/schedule_release_params.rb +22 -0
- data/lib/courier/models/users/preference_delete_topic_params.rb +38 -0
- data/lib/courier/models.rb +8 -0
- data/lib/courier/resources/digests/schedules.rb +72 -0
- data/lib/courier/resources/digests.rb +18 -0
- data/lib/courier/resources/users/preferences.rb +36 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +8 -0
- data/rbi/courier/client.rbi +3 -0
- data/rbi/courier/models/digest_category.rbi +82 -0
- data/rbi/courier/models/digest_instance.rbi +138 -0
- data/rbi/courier/models/digest_instance_list_response.rbi +104 -0
- data/rbi/courier/models/digests/schedule_list_instances_params.rbi +70 -0
- data/rbi/courier/models/digests/schedule_release_params.rbi +40 -0
- data/rbi/courier/models/users/preference_delete_topic_params.rbi +60 -0
- data/rbi/courier/models.rbi +8 -0
- data/rbi/courier/resources/digests/schedules.rbi +54 -0
- data/rbi/courier/resources/digests.rbi +15 -0
- data/rbi/courier/resources/users/preferences.rbi +23 -0
- data/sig/courier/client.rbs +2 -0
- data/sig/courier/models/digest_category.rbs +46 -0
- data/sig/courier/models/digest_instance.rbs +83 -0
- data/sig/courier/models/digest_instance_list_response.rbs +57 -0
- data/sig/courier/models/digests/schedule_list_instances_params.rbs +38 -0
- data/sig/courier/models/digests/schedule_release_params.rbs +25 -0
- data/sig/courier/models/users/preference_delete_topic_params.rbs +34 -0
- data/sig/courier/models.rbs +8 -0
- data/sig/courier/resources/digests/schedules.rbs +21 -0
- data/sig/courier/resources/digests.rbs +9 -0
- data/sig/courier/resources/users/preferences.rbs +7 -0
- metadata +26 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 62e50b0f394c9b71492f5a8edcf141e73349df61df527661a0e43660de5540d9
|
|
4
|
+
data.tar.gz: a9e4059917b03248a4fbbc198d1f3c809a4130b0ed39642be34c682b0d165eda
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb6d9b6d9b9edf0a1c51ad9305366b6e7a5a1cea3d8fa59a126c9f59d87b1108b3b17f0bb8ce00374692df294c69153389b08810527904f0b774086ffb54d71a
|
|
7
|
+
data.tar.gz: 498be96be04f5399ec5a6395e00b2f1a41e70983ea2d980657b231080fac0fc5b2f2165197bc3030a85b68767434b505f1da6aa649c95c692dae41b913a29903
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.14.0 (2026-06-16)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.13.0...v4.14.0](https://github.com/trycourier/courier-ruby/compare/v4.13.0...v4.14.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **openapi:** add DELETE /users/{id}/preferences/{topicId} ([417d5c8](https://github.com/trycourier/courier-ruby/commit/417d5c8d2e96bbb345d08908d35e3f3b4b6b7172))
|
|
10
|
+
|
|
11
|
+
## 4.13.0 (2026-06-12)
|
|
12
|
+
|
|
13
|
+
Full Changelog: [v4.12.0...v4.13.0](https://github.com/trycourier/courier-ruby/compare/v4.12.0...v4.13.0)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **digests:** document digest REST endpoints in OpenAPI spec ([6fdd4fc](https://github.com/trycourier/courier-ruby/commit/6fdd4fc94c104e0f3ca8905108a18eeafd9c5abc))
|
|
18
|
+
|
|
3
19
|
## 4.12.0 (2026-05-28)
|
|
4
20
|
|
|
5
21
|
Full Changelog: [v4.11.0...v4.12.0](https://github.com/trycourier/courier-ruby/compare/v4.11.0...v4.12.0)
|
data/lib/courier/client.rb
CHANGED
|
@@ -45,6 +45,9 @@ module Courier
|
|
|
45
45
|
# @return [Courier::Resources::Bulk]
|
|
46
46
|
attr_reader :bulk
|
|
47
47
|
|
|
48
|
+
# @return [Courier::Resources::Digests]
|
|
49
|
+
attr_reader :digests
|
|
50
|
+
|
|
48
51
|
# @return [Courier::Resources::Inbound]
|
|
49
52
|
attr_reader :inbound
|
|
50
53
|
|
|
@@ -145,6 +148,7 @@ module Courier
|
|
|
145
148
|
@journeys = Courier::Resources::Journeys.new(client: self)
|
|
146
149
|
@brands = Courier::Resources::Brands.new(client: self)
|
|
147
150
|
@bulk = Courier::Resources::Bulk.new(client: self)
|
|
151
|
+
@digests = Courier::Resources::Digests.new(client: self)
|
|
148
152
|
@inbound = Courier::Resources::Inbound.new(client: self)
|
|
149
153
|
@lists = Courier::Resources::Lists.new(client: self)
|
|
150
154
|
@messages = Courier::Resources::Messages.new(client: self)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class DigestCategory < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute category_key
|
|
7
|
+
# The key that identifies the category within the digest.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :category_key, String
|
|
11
|
+
|
|
12
|
+
# @!attribute retain
|
|
13
|
+
# Which events to keep when the number of events exceeds the retention limit for
|
|
14
|
+
# the category.
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, Courier::Models::DigestCategory::Retain]
|
|
17
|
+
required :retain, enum: -> { Courier::DigestCategory::Retain }
|
|
18
|
+
|
|
19
|
+
# @!attribute sort_key
|
|
20
|
+
# The data key used to order events when `retain` is `highest` or `lowest`.
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :sort_key, String
|
|
24
|
+
|
|
25
|
+
# @!method initialize(category_key:, retain:, sort_key: nil)
|
|
26
|
+
# Some parameter documentations has been truncated, see
|
|
27
|
+
# {Courier::Models::DigestCategory} for more details.
|
|
28
|
+
#
|
|
29
|
+
# @param category_key [String] The key that identifies the category within the digest.
|
|
30
|
+
#
|
|
31
|
+
# @param retain [Symbol, Courier::Models::DigestCategory::Retain] Which events to keep when the number of events exceeds the retention limit for t
|
|
32
|
+
#
|
|
33
|
+
# @param sort_key [String] The data key used to order events when `retain` is `highest` or `lowest`.
|
|
34
|
+
|
|
35
|
+
# Which events to keep when the number of events exceeds the retention limit for
|
|
36
|
+
# the category.
|
|
37
|
+
#
|
|
38
|
+
# @see Courier::Models::DigestCategory#retain
|
|
39
|
+
module Retain
|
|
40
|
+
extend Courier::Internal::Type::Enum
|
|
41
|
+
|
|
42
|
+
FIRST = :first
|
|
43
|
+
LAST = :last
|
|
44
|
+
HIGHEST = :highest
|
|
45
|
+
LOWEST = :lowest
|
|
46
|
+
NONE = :none
|
|
47
|
+
|
|
48
|
+
# @!method self.values
|
|
49
|
+
# @return [Array<Symbol>]
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class DigestInstance < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute digest_instance_id
|
|
7
|
+
# A unique identifier for the digest instance.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :digest_instance_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute event_count
|
|
13
|
+
# The total number of events received for this instance.
|
|
14
|
+
#
|
|
15
|
+
# @return [Integer]
|
|
16
|
+
required :event_count, Integer
|
|
17
|
+
|
|
18
|
+
# @!attribute status
|
|
19
|
+
# The status of the digest instance. `IN_PROGRESS` instances are still
|
|
20
|
+
# accumulating events; `COMPLETED` instances have been released.
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, Courier::Models::DigestInstance::Status]
|
|
23
|
+
required :status, enum: -> { Courier::DigestInstance::Status }
|
|
24
|
+
|
|
25
|
+
# @!attribute user_id
|
|
26
|
+
# The ID of the user this digest instance belongs to.
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :user_id, String
|
|
30
|
+
|
|
31
|
+
# @!attribute categories
|
|
32
|
+
# The categories configured for the digest.
|
|
33
|
+
#
|
|
34
|
+
# @return [Array<Courier::Models::DigestCategory>, nil]
|
|
35
|
+
optional :categories, -> { Courier::Internal::Type::ArrayOf[Courier::DigestCategory] }
|
|
36
|
+
|
|
37
|
+
# @!attribute category_key_counts
|
|
38
|
+
# A map of category key to the number of events received for that category.
|
|
39
|
+
#
|
|
40
|
+
# @return [Hash{Symbol=>Integer}, nil]
|
|
41
|
+
optional :category_key_counts, Courier::Internal::Type::HashOf[Integer]
|
|
42
|
+
|
|
43
|
+
# @!attribute created_at
|
|
44
|
+
# An ISO 8601 timestamp of when the digest instance was created.
|
|
45
|
+
#
|
|
46
|
+
# @return [String, nil]
|
|
47
|
+
optional :created_at, String
|
|
48
|
+
|
|
49
|
+
# @!attribute disabled
|
|
50
|
+
# Whether the digest instance has been disabled.
|
|
51
|
+
#
|
|
52
|
+
# @return [Boolean, nil]
|
|
53
|
+
optional :disabled, Courier::Internal::Type::Boolean
|
|
54
|
+
|
|
55
|
+
# @!attribute tenant_id
|
|
56
|
+
# The ID of the tenant this digest instance belongs to, if any.
|
|
57
|
+
#
|
|
58
|
+
# @return [String, nil]
|
|
59
|
+
optional :tenant_id, String, nil?: true
|
|
60
|
+
|
|
61
|
+
# @!method initialize(digest_instance_id:, event_count:, status:, user_id:, categories: nil, category_key_counts: nil, created_at: nil, disabled: nil, tenant_id: nil)
|
|
62
|
+
# Some parameter documentations has been truncated, see
|
|
63
|
+
# {Courier::Models::DigestInstance} for more details.
|
|
64
|
+
#
|
|
65
|
+
# @param digest_instance_id [String] A unique identifier for the digest instance.
|
|
66
|
+
#
|
|
67
|
+
# @param event_count [Integer] The total number of events received for this instance.
|
|
68
|
+
#
|
|
69
|
+
# @param status [Symbol, Courier::Models::DigestInstance::Status] The status of the digest instance. `IN_PROGRESS` instances are still accumulatin
|
|
70
|
+
#
|
|
71
|
+
# @param user_id [String] The ID of the user this digest instance belongs to.
|
|
72
|
+
#
|
|
73
|
+
# @param categories [Array<Courier::Models::DigestCategory>] The categories configured for the digest.
|
|
74
|
+
#
|
|
75
|
+
# @param category_key_counts [Hash{Symbol=>Integer}] A map of category key to the number of events received for that category.
|
|
76
|
+
#
|
|
77
|
+
# @param created_at [String] An ISO 8601 timestamp of when the digest instance was created.
|
|
78
|
+
#
|
|
79
|
+
# @param disabled [Boolean] Whether the digest instance has been disabled.
|
|
80
|
+
#
|
|
81
|
+
# @param tenant_id [String, nil] The ID of the tenant this digest instance belongs to, if any.
|
|
82
|
+
|
|
83
|
+
# The status of the digest instance. `IN_PROGRESS` instances are still
|
|
84
|
+
# accumulating events; `COMPLETED` instances have been released.
|
|
85
|
+
#
|
|
86
|
+
# @see Courier::Models::DigestInstance#status
|
|
87
|
+
module Status
|
|
88
|
+
extend Courier::Internal::Type::Enum
|
|
89
|
+
|
|
90
|
+
IN_PROGRESS = :IN_PROGRESS
|
|
91
|
+
COMPLETED = :COMPLETED
|
|
92
|
+
|
|
93
|
+
# @!method self.values
|
|
94
|
+
# @return [Array<Symbol>]
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class DigestInstanceListResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute has_more
|
|
7
|
+
# Whether there are more digest instances to fetch using the cursor.
|
|
8
|
+
#
|
|
9
|
+
# @return [Boolean]
|
|
10
|
+
required :has_more, Courier::Internal::Type::Boolean
|
|
11
|
+
|
|
12
|
+
# @!attribute items
|
|
13
|
+
# The digest instances for this page of results.
|
|
14
|
+
#
|
|
15
|
+
# @return [Array<Courier::Models::DigestInstance>]
|
|
16
|
+
required :items, -> { Courier::Internal::Type::ArrayOf[Courier::DigestInstance] }
|
|
17
|
+
|
|
18
|
+
# @!attribute type
|
|
19
|
+
# Always `list` for a paginated list response.
|
|
20
|
+
#
|
|
21
|
+
# @return [Symbol, Courier::Models::DigestInstanceListResponse::Type]
|
|
22
|
+
required :type, enum: -> { Courier::DigestInstanceListResponse::Type }
|
|
23
|
+
|
|
24
|
+
# @!attribute cursor
|
|
25
|
+
# A cursor token for fetching the next page of results, or null when there are
|
|
26
|
+
# none.
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
optional :cursor, String, nil?: true
|
|
30
|
+
|
|
31
|
+
# @!attribute next_url
|
|
32
|
+
# The path to fetch the next page of results, or null when there are none.
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :next_url, String, nil?: true
|
|
36
|
+
|
|
37
|
+
# @!attribute url
|
|
38
|
+
# The path of the current request.
|
|
39
|
+
#
|
|
40
|
+
# @return [String, nil]
|
|
41
|
+
optional :url, String
|
|
42
|
+
|
|
43
|
+
# @!method initialize(has_more:, items:, type:, cursor: nil, next_url: nil, url: nil)
|
|
44
|
+
# Some parameter documentations has been truncated, see
|
|
45
|
+
# {Courier::Models::DigestInstanceListResponse} for more details.
|
|
46
|
+
#
|
|
47
|
+
# @param has_more [Boolean] Whether there are more digest instances to fetch using the cursor.
|
|
48
|
+
#
|
|
49
|
+
# @param items [Array<Courier::Models::DigestInstance>] The digest instances for this page of results.
|
|
50
|
+
#
|
|
51
|
+
# @param type [Symbol, Courier::Models::DigestInstanceListResponse::Type] Always `list` for a paginated list response.
|
|
52
|
+
#
|
|
53
|
+
# @param cursor [String, nil] A cursor token for fetching the next page of results, or null when there are non
|
|
54
|
+
#
|
|
55
|
+
# @param next_url [String, nil] The path to fetch the next page of results, or null when there are none.
|
|
56
|
+
#
|
|
57
|
+
# @param url [String] The path of the current request.
|
|
58
|
+
|
|
59
|
+
# Always `list` for a paginated list response.
|
|
60
|
+
#
|
|
61
|
+
# @see Courier::Models::DigestInstanceListResponse#type
|
|
62
|
+
module Type
|
|
63
|
+
extend Courier::Internal::Type::Enum
|
|
64
|
+
|
|
65
|
+
LIST = :list
|
|
66
|
+
|
|
67
|
+
# @!method self.values
|
|
68
|
+
# @return [Array<Symbol>]
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module Digests
|
|
6
|
+
# @see Courier::Resources::Digests::Schedules#list_instances
|
|
7
|
+
class ScheduleListInstancesParams < Courier::Internal::Type::BaseModel
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute schedule_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :schedule_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute cursor
|
|
17
|
+
# A cursor token from a previous response, used to fetch the next page of results.
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :cursor, String
|
|
21
|
+
|
|
22
|
+
# @!attribute limit
|
|
23
|
+
# The maximum number of digest instances to return. Defaults to 20, with a maximum
|
|
24
|
+
# of 100.
|
|
25
|
+
#
|
|
26
|
+
# @return [Integer, nil]
|
|
27
|
+
optional :limit, Integer
|
|
28
|
+
|
|
29
|
+
# @!method initialize(schedule_id:, cursor: nil, limit: nil, request_options: {})
|
|
30
|
+
# Some parameter documentations has been truncated, see
|
|
31
|
+
# {Courier::Models::Digests::ScheduleListInstancesParams} for more details.
|
|
32
|
+
#
|
|
33
|
+
# @param schedule_id [String]
|
|
34
|
+
#
|
|
35
|
+
# @param cursor [String] A cursor token from a previous response, used to fetch the next page of results.
|
|
36
|
+
#
|
|
37
|
+
# @param limit [Integer] The maximum number of digest instances to return. Defaults to 20, with a maximum
|
|
38
|
+
#
|
|
39
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module Digests
|
|
6
|
+
# @see Courier::Resources::Digests::Schedules#release
|
|
7
|
+
class ScheduleReleaseParams < Courier::Internal::Type::BaseModel
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute schedule_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :schedule_id, String
|
|
15
|
+
|
|
16
|
+
# @!method initialize(schedule_id:, request_options: {})
|
|
17
|
+
# @param schedule_id [String]
|
|
18
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module Users
|
|
6
|
+
# @see Courier::Resources::Users::Preferences#delete_topic
|
|
7
|
+
class PreferenceDeleteTopicParams < Courier::Internal::Type::BaseModel
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute user_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :user_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute topic_id
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :topic_id, String
|
|
20
|
+
|
|
21
|
+
# @!attribute tenant_id
|
|
22
|
+
# Delete the preferences of a user for this specific tenant context.
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
optional :tenant_id, String, nil?: true
|
|
26
|
+
|
|
27
|
+
# @!method initialize(user_id:, topic_id:, tenant_id: nil, request_options: {})
|
|
28
|
+
# @param user_id [String]
|
|
29
|
+
#
|
|
30
|
+
# @param topic_id [String]
|
|
31
|
+
#
|
|
32
|
+
# @param tenant_id [String, nil] Delete the preferences of a user for this specific tenant context.
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
data/lib/courier/models.rb
CHANGED
|
@@ -139,6 +139,14 @@ module Courier
|
|
|
139
139
|
|
|
140
140
|
DeviceType = Courier::Models::DeviceType
|
|
141
141
|
|
|
142
|
+
DigestCategory = Courier::Models::DigestCategory
|
|
143
|
+
|
|
144
|
+
DigestInstance = Courier::Models::DigestInstance
|
|
145
|
+
|
|
146
|
+
DigestInstanceListResponse = Courier::Models::DigestInstanceListResponse
|
|
147
|
+
|
|
148
|
+
Digests = Courier::Models::Digests
|
|
149
|
+
|
|
142
150
|
Discord = Courier::Models::Discord
|
|
143
151
|
|
|
144
152
|
ElementalActionNodeWithType = Courier::Models::ElementalActionNodeWithType
|
|
@@ -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
|
|
@@ -32,6 +32,42 @@ module Courier
|
|
|
32
32
|
)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
# Some parameter documentations has been truncated, see
|
|
36
|
+
# {Courier::Models::Users::PreferenceDeleteTopicParams} for more details.
|
|
37
|
+
#
|
|
38
|
+
# Remove a user's preferences for a specific subscription topic, resetting the
|
|
39
|
+
# topic to its effective default. This operation is idempotent: deleting a
|
|
40
|
+
# preference that does not exist succeeds with no error.
|
|
41
|
+
#
|
|
42
|
+
# @overload delete_topic(topic_id, user_id:, tenant_id: nil, request_options: {})
|
|
43
|
+
#
|
|
44
|
+
# @param topic_id [String] Path param: A unique identifier associated with a subscription topic.
|
|
45
|
+
#
|
|
46
|
+
# @param user_id [String] Path param: A unique identifier associated with the user whose preferences you w
|
|
47
|
+
#
|
|
48
|
+
# @param tenant_id [String, nil] Query param: Delete the preferences of a user for this specific tenant context.
|
|
49
|
+
#
|
|
50
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
51
|
+
#
|
|
52
|
+
# @return [nil]
|
|
53
|
+
#
|
|
54
|
+
# @see Courier::Models::Users::PreferenceDeleteTopicParams
|
|
55
|
+
def delete_topic(topic_id, params)
|
|
56
|
+
parsed, options = Courier::Users::PreferenceDeleteTopicParams.dump_request(params)
|
|
57
|
+
query = Courier::Internal::Util.encode_query_params(parsed)
|
|
58
|
+
user_id =
|
|
59
|
+
parsed.delete(:user_id) do
|
|
60
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
61
|
+
end
|
|
62
|
+
@client.request(
|
|
63
|
+
method: :delete,
|
|
64
|
+
path: ["users/%1$s/preferences/%2$s", user_id, topic_id],
|
|
65
|
+
query: query,
|
|
66
|
+
model: NilClass,
|
|
67
|
+
options: options
|
|
68
|
+
)
|
|
69
|
+
end
|
|
70
|
+
|
|
35
71
|
# Some parameter documentations has been truncated, see
|
|
36
72
|
# {Courier::Models::Users::PreferenceRetrieveTopicParams} for more details.
|
|
37
73
|
#
|
data/lib/courier/version.rb
CHANGED
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"
|
|
@@ -351,6 +356,7 @@ require_relative "courier/models/translation_update_params"
|
|
|
351
356
|
require_relative "courier/models/user_profile"
|
|
352
357
|
require_relative "courier/models/user_profile_firebase_token"
|
|
353
358
|
require_relative "courier/models/user_recipient"
|
|
359
|
+
require_relative "courier/models/users/preference_delete_topic_params"
|
|
354
360
|
require_relative "courier/models/users/preference_retrieve_params"
|
|
355
361
|
require_relative "courier/models/users/preference_retrieve_response"
|
|
356
362
|
require_relative "courier/models/users/preference_retrieve_topic_params"
|
|
@@ -389,6 +395,8 @@ require_relative "courier/resources/automations"
|
|
|
389
395
|
require_relative "courier/resources/automations/invoke"
|
|
390
396
|
require_relative "courier/resources/brands"
|
|
391
397
|
require_relative "courier/resources/bulk"
|
|
398
|
+
require_relative "courier/resources/digests"
|
|
399
|
+
require_relative "courier/resources/digests/schedules"
|
|
392
400
|
require_relative "courier/resources/inbound"
|
|
393
401
|
require_relative "courier/resources/journeys"
|
|
394
402
|
require_relative "courier/resources/journeys/templates"
|
data/rbi/courier/client.rbi
CHANGED
|
@@ -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
|