trycourier 6.4.4 → 6.6.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 +20 -0
- data/README.md +1 -1
- data/lib/courier/models/digest_day_of_week.rb +21 -0
- data/lib/courier/models/digest_frequency.rb +21 -0
- data/lib/courier/models/email_footer.rb +114 -7
- data/lib/courier/models/journey_conditions_field.rb +11 -1
- data/lib/courier/models/journey_node.rb +17 -2
- data/lib/courier/models/topic_digest_category.rb +71 -0
- data/lib/courier/models/topic_digest_release_request.rb +35 -0
- data/lib/courier/models/topic_digest_request.rb +63 -0
- data/lib/courier/models/topic_digest_response.rb +66 -0
- data/lib/courier/models/topic_digest_schedule_request.rb +93 -0
- data/lib/courier/models/topic_digest_schedule_response.rb +103 -0
- data/lib/courier/models/users/preference_update_or_create_topic_params.rb +13 -1
- data/lib/courier/models/users/token_add_single_params.rb +13 -5
- data/lib/courier/models/users/token_update_params.rb +30 -4
- data/lib/courier/models/users/topic_preference.rb +12 -1
- data/lib/courier/models/users/user_token.rb +13 -5
- data/lib/courier/models/workspace_preference_topic_create_request.rb +15 -1
- data/lib/courier/models/workspace_preference_topic_get_response.rb +9 -1
- data/lib/courier/models/workspace_preference_topic_replace_request.rb +15 -1
- data/lib/courier/models/workspace_preferences/topic_delete_digest_params.rb +28 -0
- data/lib/courier/models/workspace_preferences/topic_release_digest_params.rb +28 -0
- data/lib/courier/models.rb +16 -0
- data/lib/courier/resources/digests/schedules.rb +1 -1
- data/lib/courier/resources/users/tokens.rb +1 -1
- data/lib/courier/resources/workspace_preferences/topics.rb +77 -4
- data/lib/courier/resources/workspace_preferences.rb +0 -2
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +10 -0
- data/rbi/courier/models/digest_day_of_week.rbi +25 -0
- data/rbi/courier/models/digest_frequency.rbi +25 -0
- data/rbi/courier/models/email_footer.rbi +229 -7
- data/rbi/courier/models/journey_node.rbi +12 -1
- data/rbi/courier/models/topic_digest_category.rbi +116 -0
- data/rbi/courier/models/topic_digest_release_request.rbi +51 -0
- data/rbi/courier/models/topic_digest_request.rbi +95 -0
- data/rbi/courier/models/topic_digest_response.rbi +98 -0
- data/rbi/courier/models/topic_digest_schedule_request.rbi +141 -0
- data/rbi/courier/models/topic_digest_schedule_response.rbi +159 -0
- data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +16 -0
- data/rbi/courier/models/users/token_add_single_params.rbi +18 -6
- data/rbi/courier/models/users/token_update_params.rbi +59 -7
- data/rbi/courier/models/users/topic_preference.rbi +17 -0
- data/rbi/courier/models/users/user_token.rbi +18 -6
- data/rbi/courier/models/workspace_preference_topic_create_request.rbi +25 -0
- data/rbi/courier/models/workspace_preference_topic_get_response.rbi +13 -0
- data/rbi/courier/models/workspace_preference_topic_replace_request.rbi +25 -0
- data/rbi/courier/models/workspace_preferences/topic_delete_digest_params.rbi +48 -0
- data/rbi/courier/models/workspace_preferences/topic_release_digest_params.rbi +48 -0
- data/rbi/courier/models.rbi +16 -0
- data/rbi/courier/resources/digests/schedules.rbi +5 -2
- data/rbi/courier/resources/users/tokens.rbi +6 -2
- data/rbi/courier/resources/workspace_preferences/topics.rbi +72 -2
- data/rbi/courier/resources/workspace_preferences.rbi +0 -2
- data/sig/courier/models/digest_day_of_week.rbs +26 -0
- data/sig/courier/models/digest_frequency.rbs +19 -0
- data/sig/courier/models/email_footer.rbs +107 -5
- data/sig/courier/models/topic_digest_category.rbs +57 -0
- data/sig/courier/models/topic_digest_release_request.rbs +17 -0
- data/sig/courier/models/topic_digest_request.rbs +48 -0
- data/sig/courier/models/topic_digest_response.rbs +58 -0
- data/sig/courier/models/topic_digest_schedule_request.rbs +80 -0
- data/sig/courier/models/topic_digest_schedule_response.rbs +96 -0
- data/sig/courier/models/users/preference_update_or_create_topic_params.rbs +5 -0
- data/sig/courier/models/users/token_update_params.rbs +27 -4
- data/sig/courier/models/users/topic_preference.rbs +7 -0
- data/sig/courier/models/workspace_preference_topic_create_request.rbs +5 -0
- data/sig/courier/models/workspace_preference_topic_get_response.rbs +5 -0
- data/sig/courier/models/workspace_preference_topic_replace_request.rbs +5 -0
- data/sig/courier/models/workspace_preferences/topic_delete_digest_params.rbs +30 -0
- data/sig/courier/models/workspace_preferences/topic_release_digest_params.rbs +34 -0
- data/sig/courier/models.rbs +16 -0
- data/sig/courier/resources/workspace_preferences/topics.rbs +16 -0
- metadata +32 -2
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::TopicDigestResponse, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Retention rules per category key.
|
|
12
|
+
sig { returns(T::Array[Courier::TopicDigestCategory]) }
|
|
13
|
+
attr_accessor :categories
|
|
14
|
+
|
|
15
|
+
# The digest's delivery cadences, each with its server-assigned `schedule_id`.
|
|
16
|
+
sig { returns(T::Array[Courier::TopicDigestScheduleResponse]) }
|
|
17
|
+
attr_accessor :schedules
|
|
18
|
+
|
|
19
|
+
# The notification template that renders the digest.
|
|
20
|
+
sig { returns(String) }
|
|
21
|
+
attr_accessor :template_id
|
|
22
|
+
|
|
23
|
+
# The audience the digest is scoped to, when set.
|
|
24
|
+
sig { returns(T.nilable(String)) }
|
|
25
|
+
attr_reader :audience_id
|
|
26
|
+
|
|
27
|
+
sig { params(audience_id: String).void }
|
|
28
|
+
attr_writer :audience_id
|
|
29
|
+
|
|
30
|
+
# ISO-8601 timestamp of when the digest was configured.
|
|
31
|
+
sig { returns(T.nilable(String)) }
|
|
32
|
+
attr_reader :created
|
|
33
|
+
|
|
34
|
+
sig { params(created: String).void }
|
|
35
|
+
attr_writer :created
|
|
36
|
+
|
|
37
|
+
# Whether the digest is delivered even when nothing was collected.
|
|
38
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
39
|
+
attr_reader :trigger_empty
|
|
40
|
+
|
|
41
|
+
sig { params(trigger_empty: T::Boolean).void }
|
|
42
|
+
attr_writer :trigger_empty
|
|
43
|
+
|
|
44
|
+
# ISO-8601 timestamp of the last update.
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_reader :updated
|
|
47
|
+
|
|
48
|
+
sig { params(updated: String).void }
|
|
49
|
+
attr_writer :updated
|
|
50
|
+
|
|
51
|
+
# A topic's digest configuration.
|
|
52
|
+
sig do
|
|
53
|
+
params(
|
|
54
|
+
categories: T::Array[Courier::TopicDigestCategory::OrHash],
|
|
55
|
+
schedules: T::Array[Courier::TopicDigestScheduleResponse::OrHash],
|
|
56
|
+
template_id: String,
|
|
57
|
+
audience_id: String,
|
|
58
|
+
created: String,
|
|
59
|
+
trigger_empty: T::Boolean,
|
|
60
|
+
updated: String
|
|
61
|
+
).returns(T.attached_class)
|
|
62
|
+
end
|
|
63
|
+
def self.new(
|
|
64
|
+
# Retention rules per category key.
|
|
65
|
+
categories:,
|
|
66
|
+
# The digest's delivery cadences, each with its server-assigned `schedule_id`.
|
|
67
|
+
schedules:,
|
|
68
|
+
# The notification template that renders the digest.
|
|
69
|
+
template_id:,
|
|
70
|
+
# The audience the digest is scoped to, when set.
|
|
71
|
+
audience_id: nil,
|
|
72
|
+
# ISO-8601 timestamp of when the digest was configured.
|
|
73
|
+
created: nil,
|
|
74
|
+
# Whether the digest is delivered even when nothing was collected.
|
|
75
|
+
trigger_empty: nil,
|
|
76
|
+
# ISO-8601 timestamp of the last update.
|
|
77
|
+
updated: nil
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
sig do
|
|
82
|
+
override.returns(
|
|
83
|
+
{
|
|
84
|
+
categories: T::Array[Courier::TopicDigestCategory],
|
|
85
|
+
schedules: T::Array[Courier::TopicDigestScheduleResponse],
|
|
86
|
+
template_id: String,
|
|
87
|
+
audience_id: String,
|
|
88
|
+
created: String,
|
|
89
|
+
trigger_empty: T::Boolean,
|
|
90
|
+
updated: String
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
def to_hash
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestScheduleRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(Courier::TopicDigestScheduleRequest, Courier::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# How often a digest is delivered. `instant` delivers immediately without
|
|
12
|
+
# batching, and is the one value that takes no `time`.
|
|
13
|
+
sig { returns(Courier::DigestFrequency::OrSymbol) }
|
|
14
|
+
attr_accessor :frequency
|
|
15
|
+
|
|
16
|
+
# Required when `frequency` is `monthly`.
|
|
17
|
+
sig { returns(T.nilable(Integer)) }
|
|
18
|
+
attr_reader :day_of_month
|
|
19
|
+
|
|
20
|
+
sig { params(day_of_month: Integer).void }
|
|
21
|
+
attr_writer :day_of_month
|
|
22
|
+
|
|
23
|
+
# Required when `frequency` is `weekly`.
|
|
24
|
+
sig { returns(T.nilable(Courier::DigestDayOfWeek::OrSymbol)) }
|
|
25
|
+
attr_reader :day_of_week
|
|
26
|
+
|
|
27
|
+
sig { params(day_of_week: Courier::DigestDayOfWeek::OrSymbol).void }
|
|
28
|
+
attr_writer :day_of_week
|
|
29
|
+
|
|
30
|
+
# Required when `frequency` is `custom_days`.
|
|
31
|
+
sig { returns(T.nilable(T::Array[Courier::DigestDayOfWeek::OrSymbol])) }
|
|
32
|
+
attr_reader :days_of_week
|
|
33
|
+
|
|
34
|
+
sig do
|
|
35
|
+
params(days_of_week: T::Array[Courier::DigestDayOfWeek::OrSymbol]).void
|
|
36
|
+
end
|
|
37
|
+
attr_writer :days_of_week
|
|
38
|
+
|
|
39
|
+
# Whether the schedule is disabled.
|
|
40
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
41
|
+
attr_reader :disabled
|
|
42
|
+
|
|
43
|
+
sig { params(disabled: T::Boolean).void }
|
|
44
|
+
attr_writer :disabled
|
|
45
|
+
|
|
46
|
+
# The schedule recipients are placed on when they have not chosen one. Set this
|
|
47
|
+
# explicitly rather than relying on array position.
|
|
48
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
49
|
+
attr_reader :is_default
|
|
50
|
+
|
|
51
|
+
sig { params(is_default: T::Boolean).void }
|
|
52
|
+
attr_writer :is_default
|
|
53
|
+
|
|
54
|
+
# Identifier of an existing schedule to update. Omit when creating a new one.
|
|
55
|
+
sig { returns(T.nilable(String)) }
|
|
56
|
+
attr_reader :schedule_id
|
|
57
|
+
|
|
58
|
+
sig { params(schedule_id: String).void }
|
|
59
|
+
attr_writer :schedule_id
|
|
60
|
+
|
|
61
|
+
# 24-hour local delivery time, `HH:MM`. Required for every frequency except
|
|
62
|
+
# `instant`.
|
|
63
|
+
sig { returns(T.nilable(String)) }
|
|
64
|
+
attr_reader :time
|
|
65
|
+
|
|
66
|
+
sig { params(time: String).void }
|
|
67
|
+
attr_writer :time
|
|
68
|
+
|
|
69
|
+
# IANA timezone the `time` and day fields are expressed in, e.g.
|
|
70
|
+
# `America/New_York`. Absent means UTC. Delivery follows the same local wall-clock
|
|
71
|
+
# across daylight-saving changes.
|
|
72
|
+
sig { returns(T.nilable(String)) }
|
|
73
|
+
attr_reader :timezone
|
|
74
|
+
|
|
75
|
+
sig { params(timezone: String).void }
|
|
76
|
+
attr_writer :timezone
|
|
77
|
+
|
|
78
|
+
# One delivery cadence for a topic's digest. Supply `schedule_id` to update an
|
|
79
|
+
# existing schedule in place; omit it and one is assigned and returned. The
|
|
80
|
+
# `schedules` array is a full replacement, so a stored schedule absent from it is
|
|
81
|
+
# deleted along with its delivery rule.
|
|
82
|
+
sig do
|
|
83
|
+
params(
|
|
84
|
+
frequency: Courier::DigestFrequency::OrSymbol,
|
|
85
|
+
day_of_month: Integer,
|
|
86
|
+
day_of_week: Courier::DigestDayOfWeek::OrSymbol,
|
|
87
|
+
days_of_week: T::Array[Courier::DigestDayOfWeek::OrSymbol],
|
|
88
|
+
disabled: T::Boolean,
|
|
89
|
+
is_default: T::Boolean,
|
|
90
|
+
schedule_id: String,
|
|
91
|
+
time: String,
|
|
92
|
+
timezone: String
|
|
93
|
+
).returns(T.attached_class)
|
|
94
|
+
end
|
|
95
|
+
def self.new(
|
|
96
|
+
# How often a digest is delivered. `instant` delivers immediately without
|
|
97
|
+
# batching, and is the one value that takes no `time`.
|
|
98
|
+
frequency:,
|
|
99
|
+
# Required when `frequency` is `monthly`.
|
|
100
|
+
day_of_month: nil,
|
|
101
|
+
# Required when `frequency` is `weekly`.
|
|
102
|
+
day_of_week: nil,
|
|
103
|
+
# Required when `frequency` is `custom_days`.
|
|
104
|
+
days_of_week: nil,
|
|
105
|
+
# Whether the schedule is disabled.
|
|
106
|
+
disabled: nil,
|
|
107
|
+
# The schedule recipients are placed on when they have not chosen one. Set this
|
|
108
|
+
# explicitly rather than relying on array position.
|
|
109
|
+
is_default: nil,
|
|
110
|
+
# Identifier of an existing schedule to update. Omit when creating a new one.
|
|
111
|
+
schedule_id: nil,
|
|
112
|
+
# 24-hour local delivery time, `HH:MM`. Required for every frequency except
|
|
113
|
+
# `instant`.
|
|
114
|
+
time: nil,
|
|
115
|
+
# IANA timezone the `time` and day fields are expressed in, e.g.
|
|
116
|
+
# `America/New_York`. Absent means UTC. Delivery follows the same local wall-clock
|
|
117
|
+
# across daylight-saving changes.
|
|
118
|
+
timezone: nil
|
|
119
|
+
)
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
sig do
|
|
123
|
+
override.returns(
|
|
124
|
+
{
|
|
125
|
+
frequency: Courier::DigestFrequency::OrSymbol,
|
|
126
|
+
day_of_month: Integer,
|
|
127
|
+
day_of_week: Courier::DigestDayOfWeek::OrSymbol,
|
|
128
|
+
days_of_week: T::Array[Courier::DigestDayOfWeek::OrSymbol],
|
|
129
|
+
disabled: T::Boolean,
|
|
130
|
+
is_default: T::Boolean,
|
|
131
|
+
schedule_id: String,
|
|
132
|
+
time: String,
|
|
133
|
+
timezone: String
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
end
|
|
137
|
+
def to_hash
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
end
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestScheduleResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
Courier::TopicDigestScheduleResponse,
|
|
10
|
+
Courier::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# The schedule's identifier, assigned by the server. This is the value the
|
|
15
|
+
# `/digests/schedules/{schedule_id}` endpoints are keyed by.
|
|
16
|
+
sig { returns(String) }
|
|
17
|
+
attr_accessor :schedule_id
|
|
18
|
+
|
|
19
|
+
# ISO-8601 timestamp of when the schedule was created.
|
|
20
|
+
sig { returns(T.nilable(String)) }
|
|
21
|
+
attr_reader :created
|
|
22
|
+
|
|
23
|
+
sig { params(created: String).void }
|
|
24
|
+
attr_writer :created
|
|
25
|
+
|
|
26
|
+
# Day of the month, 1-31.
|
|
27
|
+
sig { returns(T.nilable(Integer)) }
|
|
28
|
+
attr_reader :day_of_month
|
|
29
|
+
|
|
30
|
+
sig { params(day_of_month: Integer).void }
|
|
31
|
+
attr_writer :day_of_month
|
|
32
|
+
|
|
33
|
+
# A day of the week. Accepted case-insensitively, returned lowercase.
|
|
34
|
+
sig { returns(T.nilable(Courier::DigestDayOfWeek::TaggedSymbol)) }
|
|
35
|
+
attr_reader :day_of_week
|
|
36
|
+
|
|
37
|
+
sig { params(day_of_week: Courier::DigestDayOfWeek::OrSymbol).void }
|
|
38
|
+
attr_writer :day_of_week
|
|
39
|
+
|
|
40
|
+
sig do
|
|
41
|
+
returns(T.nilable(T::Array[Courier::DigestDayOfWeek::TaggedSymbol]))
|
|
42
|
+
end
|
|
43
|
+
attr_reader :days_of_week
|
|
44
|
+
|
|
45
|
+
sig do
|
|
46
|
+
params(days_of_week: T::Array[Courier::DigestDayOfWeek::OrSymbol]).void
|
|
47
|
+
end
|
|
48
|
+
attr_writer :days_of_week
|
|
49
|
+
|
|
50
|
+
# Whether the schedule is disabled.
|
|
51
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
52
|
+
attr_reader :disabled
|
|
53
|
+
|
|
54
|
+
sig { params(disabled: T::Boolean).void }
|
|
55
|
+
attr_writer :disabled
|
|
56
|
+
|
|
57
|
+
# Omitted for a stored schedule this enum cannot express. Those schedules never
|
|
58
|
+
# fire, but their `schedule_id` is still returned so the `/digests/*` endpoints
|
|
59
|
+
# remain reachable for them.
|
|
60
|
+
sig { returns(T.nilable(Courier::DigestFrequency::TaggedSymbol)) }
|
|
61
|
+
attr_reader :frequency
|
|
62
|
+
|
|
63
|
+
sig { params(frequency: Courier::DigestFrequency::OrSymbol).void }
|
|
64
|
+
attr_writer :frequency
|
|
65
|
+
|
|
66
|
+
# Whether this is the schedule recipients are placed on by default.
|
|
67
|
+
sig { returns(T.nilable(T::Boolean)) }
|
|
68
|
+
attr_reader :is_default
|
|
69
|
+
|
|
70
|
+
sig { params(is_default: T::Boolean).void }
|
|
71
|
+
attr_writer :is_default
|
|
72
|
+
|
|
73
|
+
# 24-hour local delivery time, `HH:MM`.
|
|
74
|
+
sig { returns(T.nilable(String)) }
|
|
75
|
+
attr_reader :time
|
|
76
|
+
|
|
77
|
+
sig { params(time: String).void }
|
|
78
|
+
attr_writer :time
|
|
79
|
+
|
|
80
|
+
# IANA timezone the schedule is expressed in. Absent means UTC.
|
|
81
|
+
sig { returns(T.nilable(String)) }
|
|
82
|
+
attr_reader :timezone
|
|
83
|
+
|
|
84
|
+
sig { params(timezone: String).void }
|
|
85
|
+
attr_writer :timezone
|
|
86
|
+
|
|
87
|
+
# ISO-8601 timestamp of the last update.
|
|
88
|
+
sig { returns(T.nilable(String)) }
|
|
89
|
+
attr_reader :updated
|
|
90
|
+
|
|
91
|
+
sig { params(updated: String).void }
|
|
92
|
+
attr_writer :updated
|
|
93
|
+
|
|
94
|
+
# A delivery cadence for a topic's digest, with its assigned id.
|
|
95
|
+
sig do
|
|
96
|
+
params(
|
|
97
|
+
schedule_id: String,
|
|
98
|
+
created: String,
|
|
99
|
+
day_of_month: Integer,
|
|
100
|
+
day_of_week: Courier::DigestDayOfWeek::OrSymbol,
|
|
101
|
+
days_of_week: T::Array[Courier::DigestDayOfWeek::OrSymbol],
|
|
102
|
+
disabled: T::Boolean,
|
|
103
|
+
frequency: Courier::DigestFrequency::OrSymbol,
|
|
104
|
+
is_default: T::Boolean,
|
|
105
|
+
time: String,
|
|
106
|
+
timezone: String,
|
|
107
|
+
updated: String
|
|
108
|
+
).returns(T.attached_class)
|
|
109
|
+
end
|
|
110
|
+
def self.new(
|
|
111
|
+
# The schedule's identifier, assigned by the server. This is the value the
|
|
112
|
+
# `/digests/schedules/{schedule_id}` endpoints are keyed by.
|
|
113
|
+
schedule_id:,
|
|
114
|
+
# ISO-8601 timestamp of when the schedule was created.
|
|
115
|
+
created: nil,
|
|
116
|
+
# Day of the month, 1-31.
|
|
117
|
+
day_of_month: nil,
|
|
118
|
+
# A day of the week. Accepted case-insensitively, returned lowercase.
|
|
119
|
+
day_of_week: nil,
|
|
120
|
+
days_of_week: nil,
|
|
121
|
+
# Whether the schedule is disabled.
|
|
122
|
+
disabled: nil,
|
|
123
|
+
# Omitted for a stored schedule this enum cannot express. Those schedules never
|
|
124
|
+
# fire, but their `schedule_id` is still returned so the `/digests/*` endpoints
|
|
125
|
+
# remain reachable for them.
|
|
126
|
+
frequency: nil,
|
|
127
|
+
# Whether this is the schedule recipients are placed on by default.
|
|
128
|
+
is_default: nil,
|
|
129
|
+
# 24-hour local delivery time, `HH:MM`.
|
|
130
|
+
time: nil,
|
|
131
|
+
# IANA timezone the schedule is expressed in. Absent means UTC.
|
|
132
|
+
timezone: nil,
|
|
133
|
+
# ISO-8601 timestamp of the last update.
|
|
134
|
+
updated: nil
|
|
135
|
+
)
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
sig do
|
|
139
|
+
override.returns(
|
|
140
|
+
{
|
|
141
|
+
schedule_id: String,
|
|
142
|
+
created: String,
|
|
143
|
+
day_of_month: Integer,
|
|
144
|
+
day_of_week: Courier::DigestDayOfWeek::TaggedSymbol,
|
|
145
|
+
days_of_week: T::Array[Courier::DigestDayOfWeek::TaggedSymbol],
|
|
146
|
+
disabled: T::Boolean,
|
|
147
|
+
frequency: Courier::DigestFrequency::TaggedSymbol,
|
|
148
|
+
is_default: T::Boolean,
|
|
149
|
+
time: String,
|
|
150
|
+
timezone: String,
|
|
151
|
+
updated: String
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
end
|
|
155
|
+
def to_hash
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
@@ -96,6 +96,14 @@ module Courier
|
|
|
96
96
|
end
|
|
97
97
|
attr_accessor :custom_routing
|
|
98
98
|
|
|
99
|
+
# Put this recipient on one of the topic's digest schedules. Send `null` to clear
|
|
100
|
+
# the choice and return them to the topic's default. Omit to leave an existing
|
|
101
|
+
# choice alone, unlike the routing fields, which this endpoint replaces. An id
|
|
102
|
+
# that is not an active schedule on the topic is rejected with a `400` before
|
|
103
|
+
# anything is written.
|
|
104
|
+
sig { returns(T.nilable(String)) }
|
|
105
|
+
attr_accessor :digest_schedule_id
|
|
106
|
+
|
|
99
107
|
# Set to true to route this topic to the channels in custom_routing instead of the
|
|
100
108
|
# topic's default routing.
|
|
101
109
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -106,6 +114,7 @@ module Courier
|
|
|
106
114
|
status: Courier::PreferenceStatus::OrSymbol,
|
|
107
115
|
custom_routing:
|
|
108
116
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
117
|
+
digest_schedule_id: T.nilable(String),
|
|
109
118
|
has_custom_routing: T.nilable(T::Boolean)
|
|
110
119
|
).returns(T.attached_class)
|
|
111
120
|
end
|
|
@@ -117,6 +126,12 @@ module Courier
|
|
|
117
126
|
# The channels to deliver this topic on when has_custom_routing is true. One or
|
|
118
127
|
# more of: direct_message, email, push, sms, webhook, inbox.
|
|
119
128
|
custom_routing: nil,
|
|
129
|
+
# Put this recipient on one of the topic's digest schedules. Send `null` to clear
|
|
130
|
+
# the choice and return them to the topic's default. Omit to leave an existing
|
|
131
|
+
# choice alone, unlike the routing fields, which this endpoint replaces. An id
|
|
132
|
+
# that is not an active schedule on the topic is rejected with a `400` before
|
|
133
|
+
# anything is written.
|
|
134
|
+
digest_schedule_id: nil,
|
|
120
135
|
# Set to true to route this topic to the channels in custom_routing instead of the
|
|
121
136
|
# topic's default routing.
|
|
122
137
|
has_custom_routing: nil
|
|
@@ -129,6 +144,7 @@ module Courier
|
|
|
129
144
|
status: Courier::PreferenceStatus::OrSymbol,
|
|
130
145
|
custom_routing:
|
|
131
146
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
147
|
+
digest_schedule_id: T.nilable(String),
|
|
132
148
|
has_custom_routing: T.nilable(T::Boolean)
|
|
133
149
|
}
|
|
134
150
|
)
|
|
@@ -38,8 +38,12 @@ module Courier
|
|
|
38
38
|
end
|
|
39
39
|
attr_writer :device
|
|
40
40
|
|
|
41
|
-
#
|
|
42
|
-
#
|
|
41
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
42
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
43
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
44
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
45
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
46
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
43
47
|
sig do
|
|
44
48
|
returns(
|
|
45
49
|
T.nilable(
|
|
@@ -94,8 +98,12 @@ module Courier
|
|
|
94
98
|
provider_key:,
|
|
95
99
|
# Information about the device the token came from.
|
|
96
100
|
device: nil,
|
|
97
|
-
#
|
|
98
|
-
#
|
|
101
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
102
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
103
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
104
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
105
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
106
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
99
107
|
expiry_date: nil,
|
|
100
108
|
# Properties about the token.
|
|
101
109
|
properties: nil,
|
|
@@ -244,8 +252,12 @@ module Courier
|
|
|
244
252
|
end
|
|
245
253
|
end
|
|
246
254
|
|
|
247
|
-
#
|
|
248
|
-
#
|
|
255
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
256
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
257
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
258
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
259
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
260
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
249
261
|
module ExpiryDate
|
|
250
262
|
extend Courier::Internal::Type::Union
|
|
251
263
|
|
|
@@ -62,32 +62,84 @@ module Courier
|
|
|
62
62
|
sig { returns(String) }
|
|
63
63
|
attr_accessor :path
|
|
64
64
|
|
|
65
|
-
# The value for the operation.
|
|
66
|
-
|
|
65
|
+
# The value for the operation. A string for most fields; boolean `false` when
|
|
66
|
+
# disabling token expiration via `expiry_date`, which cannot be expressed as a
|
|
67
|
+
# string.
|
|
68
|
+
sig do
|
|
69
|
+
returns(
|
|
70
|
+
T.nilable(
|
|
71
|
+
Courier::Users::TokenUpdateParams::Patch::Value::Variants
|
|
72
|
+
)
|
|
73
|
+
)
|
|
74
|
+
end
|
|
67
75
|
attr_accessor :value
|
|
68
76
|
|
|
69
77
|
sig do
|
|
70
|
-
params(
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
params(
|
|
79
|
+
op: String,
|
|
80
|
+
path: String,
|
|
81
|
+
value:
|
|
82
|
+
T.nilable(
|
|
83
|
+
Courier::Users::TokenUpdateParams::Patch::Value::Variants
|
|
84
|
+
)
|
|
85
|
+
).returns(T.attached_class)
|
|
73
86
|
end
|
|
74
87
|
def self.new(
|
|
75
88
|
# The operation to perform.
|
|
76
89
|
op:,
|
|
77
90
|
# The JSON path specifying the part of the profile to operate on.
|
|
78
91
|
path:,
|
|
79
|
-
# The value for the operation.
|
|
92
|
+
# The value for the operation. A string for most fields; boolean `false` when
|
|
93
|
+
# disabling token expiration via `expiry_date`, which cannot be expressed as a
|
|
94
|
+
# string.
|
|
80
95
|
value: nil
|
|
81
96
|
)
|
|
82
97
|
end
|
|
83
98
|
|
|
84
99
|
sig do
|
|
85
100
|
override.returns(
|
|
86
|
-
{
|
|
101
|
+
{
|
|
102
|
+
op: String,
|
|
103
|
+
path: String,
|
|
104
|
+
value:
|
|
105
|
+
T.nilable(
|
|
106
|
+
Courier::Users::TokenUpdateParams::Patch::Value::Variants
|
|
107
|
+
)
|
|
108
|
+
}
|
|
87
109
|
)
|
|
88
110
|
end
|
|
89
111
|
def to_hash
|
|
90
112
|
end
|
|
113
|
+
|
|
114
|
+
# The value for the operation. A string for most fields; boolean `false` when
|
|
115
|
+
# disabling token expiration via `expiry_date`, which cannot be expressed as a
|
|
116
|
+
# string.
|
|
117
|
+
module Value
|
|
118
|
+
extend Courier::Internal::Type::Union
|
|
119
|
+
|
|
120
|
+
Variants =
|
|
121
|
+
T.type_alias do
|
|
122
|
+
T.any(String, T::Boolean, T::Hash[Symbol, T.anything])
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
sig do
|
|
126
|
+
override.returns(
|
|
127
|
+
T::Array[
|
|
128
|
+
Courier::Users::TokenUpdateParams::Patch::Value::Variants
|
|
129
|
+
]
|
|
130
|
+
)
|
|
131
|
+
end
|
|
132
|
+
def self.variants
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
UnionMember2Map =
|
|
136
|
+
T.let(
|
|
137
|
+
Courier::Internal::Type::HashOf[
|
|
138
|
+
Courier::Internal::Type::Unknown
|
|
139
|
+
],
|
|
140
|
+
Courier::Internal::Type::Converter
|
|
141
|
+
)
|
|
142
|
+
end
|
|
91
143
|
end
|
|
92
144
|
end
|
|
93
145
|
end
|
|
@@ -38,6 +38,16 @@ module Courier
|
|
|
38
38
|
end
|
|
39
39
|
attr_accessor :custom_routing
|
|
40
40
|
|
|
41
|
+
# The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
42
|
+
# when they have not chosen one, in which case the topic's default schedule
|
|
43
|
+
# applies. Ids come from the topic's digest configuration or from
|
|
44
|
+
# `GET /digests/schedules`.
|
|
45
|
+
sig { returns(T.nilable(String)) }
|
|
46
|
+
attr_reader :digest_schedule_id
|
|
47
|
+
|
|
48
|
+
sig { params(digest_schedule_id: String).void }
|
|
49
|
+
attr_writer :digest_schedule_id
|
|
50
|
+
|
|
41
51
|
# Whether the user has chosen specific delivery channels for this topic (listed in
|
|
42
52
|
# custom_routing) rather than the topic's default routing.
|
|
43
53
|
sig { returns(T.nilable(T::Boolean)) }
|
|
@@ -69,6 +79,7 @@ module Courier
|
|
|
69
79
|
topic_name: String,
|
|
70
80
|
custom_routing:
|
|
71
81
|
T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
|
|
82
|
+
digest_schedule_id: String,
|
|
72
83
|
has_custom_routing: T.nilable(T::Boolean),
|
|
73
84
|
section_id: String,
|
|
74
85
|
section_name: String
|
|
@@ -90,6 +101,11 @@ module Courier
|
|
|
90
101
|
# has_custom_routing is true. One or more of: direct_message, email, push, sms,
|
|
91
102
|
# webhook, inbox.
|
|
92
103
|
custom_routing: nil,
|
|
104
|
+
# The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
105
|
+
# when they have not chosen one, in which case the topic's default schedule
|
|
106
|
+
# applies. Ids come from the topic's digest configuration or from
|
|
107
|
+
# `GET /digests/schedules`.
|
|
108
|
+
digest_schedule_id: nil,
|
|
93
109
|
# Whether the user has chosen specific delivery channels for this topic (listed in
|
|
94
110
|
# custom_routing) rather than the topic's default routing.
|
|
95
111
|
has_custom_routing: nil,
|
|
@@ -115,6 +131,7 @@ module Courier
|
|
|
115
131
|
T.nilable(
|
|
116
132
|
T::Array[Courier::ChannelClassification::TaggedSymbol]
|
|
117
133
|
),
|
|
134
|
+
digest_schedule_id: String,
|
|
118
135
|
has_custom_routing: T.nilable(T::Boolean),
|
|
119
136
|
section_id: String,
|
|
120
137
|
section_name: String
|
|
@@ -29,8 +29,12 @@ module Courier
|
|
|
29
29
|
end
|
|
30
30
|
attr_writer :device
|
|
31
31
|
|
|
32
|
-
#
|
|
33
|
-
#
|
|
32
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
33
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
34
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
35
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
36
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
37
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
34
38
|
sig do
|
|
35
39
|
returns(T.nilable(Courier::Users::UserToken::ExpiryDate::Variants))
|
|
36
40
|
end
|
|
@@ -71,8 +75,12 @@ module Courier
|
|
|
71
75
|
provider_key:,
|
|
72
76
|
# Information about the device the token came from.
|
|
73
77
|
device: nil,
|
|
74
|
-
#
|
|
75
|
-
#
|
|
78
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
79
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
80
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
81
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
82
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
83
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
76
84
|
expiry_date: nil,
|
|
77
85
|
# Properties about the token.
|
|
78
86
|
properties: nil,
|
|
@@ -207,8 +215,12 @@ module Courier
|
|
|
207
215
|
end
|
|
208
216
|
end
|
|
209
217
|
|
|
210
|
-
#
|
|
211
|
-
#
|
|
218
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
219
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
220
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
221
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
222
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
223
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
212
224
|
module ExpiryDate
|
|
213
225
|
extend Courier::Internal::Type::Union
|
|
214
226
|
|