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,103 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class TopicDigestScheduleResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute schedule_id
|
|
7
|
+
# The schedule's identifier, assigned by the server. This is the value the
|
|
8
|
+
# `/digests/schedules/{schedule_id}` endpoints are keyed by.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :schedule_id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute created
|
|
14
|
+
# ISO-8601 timestamp of when the schedule was created.
|
|
15
|
+
#
|
|
16
|
+
# @return [String, nil]
|
|
17
|
+
optional :created, String
|
|
18
|
+
|
|
19
|
+
# @!attribute day_of_month
|
|
20
|
+
# Day of the month, 1-31.
|
|
21
|
+
#
|
|
22
|
+
# @return [Integer, nil]
|
|
23
|
+
optional :day_of_month, Integer
|
|
24
|
+
|
|
25
|
+
# @!attribute day_of_week
|
|
26
|
+
# A day of the week. Accepted case-insensitively, returned lowercase.
|
|
27
|
+
#
|
|
28
|
+
# @return [Symbol, Courier::Models::DigestDayOfWeek, nil]
|
|
29
|
+
optional :day_of_week, enum: -> { Courier::DigestDayOfWeek }
|
|
30
|
+
|
|
31
|
+
# @!attribute days_of_week
|
|
32
|
+
#
|
|
33
|
+
# @return [Array<Symbol, Courier::Models::DigestDayOfWeek>, nil]
|
|
34
|
+
optional :days_of_week, -> { Courier::Internal::Type::ArrayOf[enum: Courier::DigestDayOfWeek] }
|
|
35
|
+
|
|
36
|
+
# @!attribute disabled
|
|
37
|
+
# Whether the schedule is disabled.
|
|
38
|
+
#
|
|
39
|
+
# @return [Boolean, nil]
|
|
40
|
+
optional :disabled, Courier::Internal::Type::Boolean
|
|
41
|
+
|
|
42
|
+
# @!attribute frequency
|
|
43
|
+
# Omitted for a stored schedule this enum cannot express. Those schedules never
|
|
44
|
+
# fire, but their `schedule_id` is still returned so the `/digests/*` endpoints
|
|
45
|
+
# remain reachable for them.
|
|
46
|
+
#
|
|
47
|
+
# @return [Symbol, Courier::Models::DigestFrequency, nil]
|
|
48
|
+
optional :frequency, enum: -> { Courier::DigestFrequency }
|
|
49
|
+
|
|
50
|
+
# @!attribute is_default
|
|
51
|
+
# Whether this is the schedule recipients are placed on by default.
|
|
52
|
+
#
|
|
53
|
+
# @return [Boolean, nil]
|
|
54
|
+
optional :is_default, Courier::Internal::Type::Boolean
|
|
55
|
+
|
|
56
|
+
# @!attribute time
|
|
57
|
+
# 24-hour local delivery time, `HH:MM`.
|
|
58
|
+
#
|
|
59
|
+
# @return [String, nil]
|
|
60
|
+
optional :time, String
|
|
61
|
+
|
|
62
|
+
# @!attribute timezone
|
|
63
|
+
# IANA timezone the schedule is expressed in. Absent means UTC.
|
|
64
|
+
#
|
|
65
|
+
# @return [String, nil]
|
|
66
|
+
optional :timezone, String
|
|
67
|
+
|
|
68
|
+
# @!attribute updated
|
|
69
|
+
# ISO-8601 timestamp of the last update.
|
|
70
|
+
#
|
|
71
|
+
# @return [String, nil]
|
|
72
|
+
optional :updated, String
|
|
73
|
+
|
|
74
|
+
# @!method initialize(schedule_id:, created: nil, day_of_month: nil, day_of_week: nil, days_of_week: nil, disabled: nil, frequency: nil, is_default: nil, time: nil, timezone: nil, updated: nil)
|
|
75
|
+
# Some parameter documentations has been truncated, see
|
|
76
|
+
# {Courier::Models::TopicDigestScheduleResponse} for more details.
|
|
77
|
+
#
|
|
78
|
+
# A delivery cadence for a topic's digest, with its assigned id.
|
|
79
|
+
#
|
|
80
|
+
# @param schedule_id [String] The schedule's identifier, assigned by the server. This is the value the `/diges
|
|
81
|
+
#
|
|
82
|
+
# @param created [String] ISO-8601 timestamp of when the schedule was created.
|
|
83
|
+
#
|
|
84
|
+
# @param day_of_month [Integer] Day of the month, 1-31.
|
|
85
|
+
#
|
|
86
|
+
# @param day_of_week [Symbol, Courier::Models::DigestDayOfWeek] A day of the week. Accepted case-insensitively, returned lowercase.
|
|
87
|
+
#
|
|
88
|
+
# @param days_of_week [Array<Symbol, Courier::Models::DigestDayOfWeek>]
|
|
89
|
+
#
|
|
90
|
+
# @param disabled [Boolean] Whether the schedule is disabled.
|
|
91
|
+
#
|
|
92
|
+
# @param frequency [Symbol, Courier::Models::DigestFrequency] Omitted for a stored schedule this enum cannot express. Those schedules never fi
|
|
93
|
+
#
|
|
94
|
+
# @param is_default [Boolean] Whether this is the schedule recipients are placed on by default.
|
|
95
|
+
#
|
|
96
|
+
# @param time [String] 24-hour local delivery time, `HH:MM`.
|
|
97
|
+
#
|
|
98
|
+
# @param timezone [String] IANA timezone the schedule is expressed in. Absent means UTC.
|
|
99
|
+
#
|
|
100
|
+
# @param updated [String] ISO-8601 timestamp of the last update.
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
@@ -58,6 +58,16 @@ module Courier
|
|
|
58
58
|
-> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
|
|
59
59
|
nil?: true
|
|
60
60
|
|
|
61
|
+
# @!attribute digest_schedule_id
|
|
62
|
+
# Put this recipient on one of the topic's digest schedules. Send `null` to clear
|
|
63
|
+
# the choice and return them to the topic's default. Omit to leave an existing
|
|
64
|
+
# choice alone, unlike the routing fields, which this endpoint replaces. An id
|
|
65
|
+
# that is not an active schedule on the topic is rejected with a `400` before
|
|
66
|
+
# anything is written.
|
|
67
|
+
#
|
|
68
|
+
# @return [String, nil]
|
|
69
|
+
optional :digest_schedule_id, String, nil?: true
|
|
70
|
+
|
|
61
71
|
# @!attribute has_custom_routing
|
|
62
72
|
# Set to true to route this topic to the channels in custom_routing instead of the
|
|
63
73
|
# topic's default routing.
|
|
@@ -65,7 +75,7 @@ module Courier
|
|
|
65
75
|
# @return [Boolean, nil]
|
|
66
76
|
optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
|
|
67
77
|
|
|
68
|
-
# @!method initialize(status:, custom_routing: nil, has_custom_routing: nil)
|
|
78
|
+
# @!method initialize(status:, custom_routing: nil, digest_schedule_id: nil, has_custom_routing: nil)
|
|
69
79
|
# Some parameter documentations has been truncated, see
|
|
70
80
|
# {Courier::Models::Users::PreferenceUpdateOrCreateTopicParams::Topic} for more
|
|
71
81
|
# details.
|
|
@@ -74,6 +84,8 @@ module Courier
|
|
|
74
84
|
#
|
|
75
85
|
# @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The channels to deliver this topic on when has_custom_routing is true. One or mo
|
|
76
86
|
#
|
|
87
|
+
# @param digest_schedule_id [String, nil] Put this recipient on one of the topic's digest schedules. Send `null` to clear
|
|
88
|
+
#
|
|
77
89
|
# @param has_custom_routing [Boolean, nil] Set to true to route this topic to the channels in custom_routing instead of the
|
|
78
90
|
end
|
|
79
91
|
end
|
|
@@ -30,8 +30,12 @@ module Courier
|
|
|
30
30
|
optional :device, -> { Courier::Users::TokenAddSingleParams::Device }, nil?: true
|
|
31
31
|
|
|
32
32
|
# @!attribute expiry_date
|
|
33
|
-
#
|
|
34
|
-
#
|
|
33
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
34
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
35
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
36
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
37
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
38
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
35
39
|
#
|
|
36
40
|
# @return [String, Boolean, nil]
|
|
37
41
|
optional :expiry_date, union: -> { Courier::Users::TokenAddSingleParams::ExpiryDate }, nil?: true
|
|
@@ -60,7 +64,7 @@ module Courier
|
|
|
60
64
|
#
|
|
61
65
|
# @param device [Courier::Models::Users::TokenAddSingleParams::Device, nil] Information about the device the token came from.
|
|
62
66
|
#
|
|
63
|
-
# @param expiry_date [String, Boolean, nil]
|
|
67
|
+
# @param expiry_date [String, Boolean, nil] When the token expires. Accepts a date, or the boolean `false` to disable expira
|
|
64
68
|
#
|
|
65
69
|
# @param properties [Object] Properties about the token.
|
|
66
70
|
#
|
|
@@ -133,8 +137,12 @@ module Courier
|
|
|
133
137
|
# @param platform [String, nil] The device platform i.e. android, ios, web
|
|
134
138
|
end
|
|
135
139
|
|
|
136
|
-
#
|
|
137
|
-
#
|
|
140
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
141
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
142
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
143
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
144
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
145
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
138
146
|
module ExpiryDate
|
|
139
147
|
extend Courier::Internal::Type::Union
|
|
140
148
|
|
|
@@ -43,17 +43,43 @@ module Courier
|
|
|
43
43
|
required :path, String
|
|
44
44
|
|
|
45
45
|
# @!attribute value
|
|
46
|
-
# The value for the operation.
|
|
46
|
+
# The value for the operation. A string for most fields; boolean `false` when
|
|
47
|
+
# disabling token expiration via `expiry_date`, which cannot be expressed as a
|
|
48
|
+
# string.
|
|
47
49
|
#
|
|
48
|
-
# @return [String, nil]
|
|
49
|
-
optional :value,
|
|
50
|
+
# @return [String, Boolean, Hash{Symbol=>Object}, nil]
|
|
51
|
+
optional :value, union: -> { Courier::Users::TokenUpdateParams::Patch::Value }, nil?: true
|
|
50
52
|
|
|
51
53
|
# @!method initialize(op:, path:, value: nil)
|
|
54
|
+
# Some parameter documentations has been truncated, see
|
|
55
|
+
# {Courier::Models::Users::TokenUpdateParams::Patch} for more details.
|
|
56
|
+
#
|
|
52
57
|
# @param op [String] The operation to perform.
|
|
53
58
|
#
|
|
54
59
|
# @param path [String] The JSON path specifying the part of the profile to operate on.
|
|
55
60
|
#
|
|
56
|
-
# @param value [String, nil] The value for the operation.
|
|
61
|
+
# @param value [String, Boolean, Hash{Symbol=>Object}, nil] The value for the operation. A string for most fields; boolean `false` when disa
|
|
62
|
+
|
|
63
|
+
# The value for the operation. A string for most fields; boolean `false` when
|
|
64
|
+
# disabling token expiration via `expiry_date`, which cannot be expressed as a
|
|
65
|
+
# string.
|
|
66
|
+
#
|
|
67
|
+
# @see Courier::Models::Users::TokenUpdateParams::Patch#value
|
|
68
|
+
module Value
|
|
69
|
+
extend Courier::Internal::Type::Union
|
|
70
|
+
|
|
71
|
+
variant String
|
|
72
|
+
|
|
73
|
+
variant Courier::Internal::Type::Boolean
|
|
74
|
+
|
|
75
|
+
variant -> { Courier::Models::Users::TokenUpdateParams::Patch::Value::UnionMember2Map }
|
|
76
|
+
|
|
77
|
+
# @!method self.variants
|
|
78
|
+
# @return [Array(String, Boolean, Hash{Symbol=>Object})]
|
|
79
|
+
|
|
80
|
+
# @type [Courier::Internal::Type::Converter]
|
|
81
|
+
UnionMember2Map = Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
|
|
82
|
+
end
|
|
57
83
|
end
|
|
58
84
|
end
|
|
59
85
|
end
|
|
@@ -41,6 +41,15 @@ module Courier
|
|
|
41
41
|
-> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] },
|
|
42
42
|
nil?: true
|
|
43
43
|
|
|
44
|
+
# @!attribute digest_schedule_id
|
|
45
|
+
# The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
46
|
+
# when they have not chosen one, in which case the topic's default schedule
|
|
47
|
+
# applies. Ids come from the topic's digest configuration or from
|
|
48
|
+
# `GET /digests/schedules`.
|
|
49
|
+
#
|
|
50
|
+
# @return [String, nil]
|
|
51
|
+
optional :digest_schedule_id, String
|
|
52
|
+
|
|
44
53
|
# @!attribute has_custom_routing
|
|
45
54
|
# Whether the user has chosen specific delivery channels for this topic (listed in
|
|
46
55
|
# custom_routing) rather than the topic's default routing.
|
|
@@ -64,7 +73,7 @@ module Courier
|
|
|
64
73
|
# @return [String, nil]
|
|
65
74
|
optional :section_name, String
|
|
66
75
|
|
|
67
|
-
# @!method initialize(default_status:, status:, topic_id:, topic_name:, custom_routing: nil, has_custom_routing: nil, section_id: nil, section_name: nil)
|
|
76
|
+
# @!method initialize(default_status:, status:, topic_id:, topic_name:, custom_routing: nil, digest_schedule_id: nil, has_custom_routing: nil, section_id: nil, section_name: nil)
|
|
68
77
|
# Some parameter documentations has been truncated, see
|
|
69
78
|
# {Courier::Models::Users::TopicPreference} for more details.
|
|
70
79
|
#
|
|
@@ -78,6 +87,8 @@ module Courier
|
|
|
78
87
|
#
|
|
79
88
|
# @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The channels the user has chosen to receive this topic on, present only when has
|
|
80
89
|
#
|
|
90
|
+
# @param digest_schedule_id [String] The digest schedule this recipient is on for the topic. Omitted rather than null
|
|
91
|
+
#
|
|
81
92
|
# @param has_custom_routing [Boolean, nil] Whether the user has chosen specific delivery channels for this topic (listed in
|
|
82
93
|
#
|
|
83
94
|
# @param section_id [String] The unique identifier of the section this topic belongs to. Always present when
|
|
@@ -22,8 +22,12 @@ module Courier
|
|
|
22
22
|
optional :device, -> { Courier::Users::UserToken::Device }, nil?: true
|
|
23
23
|
|
|
24
24
|
# @!attribute expiry_date
|
|
25
|
-
#
|
|
26
|
-
#
|
|
25
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
26
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
27
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
28
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
29
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
30
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
27
31
|
#
|
|
28
32
|
# @return [String, Boolean, nil]
|
|
29
33
|
optional :expiry_date, union: -> { Courier::Users::UserToken::ExpiryDate }, nil?: true
|
|
@@ -50,7 +54,7 @@ module Courier
|
|
|
50
54
|
#
|
|
51
55
|
# @param device [Courier::Models::Users::UserToken::Device, nil] Information about the device the token came from.
|
|
52
56
|
#
|
|
53
|
-
# @param expiry_date [String, Boolean, nil]
|
|
57
|
+
# @param expiry_date [String, Boolean, nil] When the token expires. Accepts a date, or the boolean `false` to disable expira
|
|
54
58
|
#
|
|
55
59
|
# @param properties [Object] Properties about the token.
|
|
56
60
|
#
|
|
@@ -123,8 +127,12 @@ module Courier
|
|
|
123
127
|
# @param platform [String, nil] The device platform i.e. android, ios, web
|
|
124
128
|
end
|
|
125
129
|
|
|
126
|
-
#
|
|
127
|
-
#
|
|
130
|
+
# When the token expires. Accepts a date, or the boolean `false` to disable
|
|
131
|
+
# expiration entirely. ISO 8601 is recommended (for example
|
|
132
|
+
# `2026-10-25T00:00:00.000Z`). A value that cannot be parsed as a date is
|
|
133
|
+
# rejected; it is not treated as "no expiration" and does not fall back to the
|
|
134
|
+
# default. `true` is not a supported value. Omit the field to use the default,
|
|
135
|
+
# which expires a token that has not been re-registered for 60 days.
|
|
128
136
|
#
|
|
129
137
|
# @see Courier::Models::Users::UserToken#expiry_date
|
|
130
138
|
module ExpiryDate
|
|
@@ -32,6 +32,18 @@ module Courier
|
|
|
32
32
|
# @return [String, nil]
|
|
33
33
|
optional :description, String, nil?: true
|
|
34
34
|
|
|
35
|
+
# @!attribute digest
|
|
36
|
+
# A topic's digest configuration: the template that renders it, the cadences it
|
|
37
|
+
# delivers on, and how collected events are retained.
|
|
38
|
+
#
|
|
39
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
40
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
41
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
42
|
+
# merely off.
|
|
43
|
+
#
|
|
44
|
+
# @return [Courier::Models::TopicDigestRequest, nil]
|
|
45
|
+
optional :digest, -> { Courier::TopicDigestRequest }, nil?: true
|
|
46
|
+
|
|
35
47
|
# @!attribute include_unsubscribe_header
|
|
36
48
|
# Whether to include a list-unsubscribe header on emails for this topic.
|
|
37
49
|
#
|
|
@@ -52,7 +64,7 @@ module Courier
|
|
|
52
64
|
# @return [Hash{Symbol=>Object}, nil]
|
|
53
65
|
optional :topic_data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
|
|
54
66
|
|
|
55
|
-
# @!method initialize(default_status:, name:, allowed_preferences: nil, description: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
|
|
67
|
+
# @!method initialize(default_status:, name:, allowed_preferences: nil, description: nil, digest: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
|
|
56
68
|
# Some parameter documentations has been truncated, see
|
|
57
69
|
# {Courier::Models::WorkspacePreferenceTopicCreateRequest} for more details.
|
|
58
70
|
#
|
|
@@ -66,6 +78,8 @@ module Courier
|
|
|
66
78
|
#
|
|
67
79
|
# @param description [String, nil] Optional description shown under the topic on the hosted preferences page.
|
|
68
80
|
#
|
|
81
|
+
# @param digest [Courier::Models::TopicDigestRequest, nil] A topic's digest configuration: the template that renders it, the cadences it de
|
|
82
|
+
#
|
|
69
83
|
# @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
|
|
70
84
|
#
|
|
71
85
|
# @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels delivered for this topic. Defaults to empty if omitted.
|
|
@@ -70,13 +70,19 @@ module Courier
|
|
|
70
70
|
# @return [String, nil]
|
|
71
71
|
optional :description, String, nil?: true
|
|
72
72
|
|
|
73
|
+
# @!attribute digest
|
|
74
|
+
# A topic's digest configuration.
|
|
75
|
+
#
|
|
76
|
+
# @return [Courier::Models::TopicDigestResponse, nil]
|
|
77
|
+
optional :digest, -> { Courier::TopicDigestResponse }, nil?: true
|
|
78
|
+
|
|
73
79
|
# @!attribute updater
|
|
74
80
|
# Id of the last updater.
|
|
75
81
|
#
|
|
76
82
|
# @return [String, nil]
|
|
77
83
|
optional :updater, String, nil?: true
|
|
78
84
|
|
|
79
|
-
# @!method initialize(id:, allowed_preferences:, created:, default_status:, include_unsubscribe_header:, name:, routing_options:, topic_data:, updated:, creator: nil, description: nil, updater: nil)
|
|
85
|
+
# @!method initialize(id:, allowed_preferences:, created:, default_status:, include_unsubscribe_header:, name:, routing_options:, topic_data:, updated:, creator: nil, description: nil, digest: nil, updater: nil)
|
|
80
86
|
# A subscription preference topic in your workspace.
|
|
81
87
|
#
|
|
82
88
|
# @param id [String] The preference topic id.
|
|
@@ -101,6 +107,8 @@ module Courier
|
|
|
101
107
|
#
|
|
102
108
|
# @param description [String, nil] Optional description shown under the topic on the hosted preferences page.
|
|
103
109
|
#
|
|
110
|
+
# @param digest [Courier::Models::TopicDigestResponse, nil] A topic's digest configuration.
|
|
111
|
+
#
|
|
104
112
|
# @param updater [String, nil] Id of the last updater.
|
|
105
113
|
|
|
106
114
|
# A preference control a recipient may customize for a topic.
|
|
@@ -32,6 +32,18 @@ module Courier
|
|
|
32
32
|
# @return [String, nil]
|
|
33
33
|
optional :description, String, nil?: true
|
|
34
34
|
|
|
35
|
+
# @!attribute digest
|
|
36
|
+
# A topic's digest configuration: the template that renders it, the cadences it
|
|
37
|
+
# delivers on, and how collected events are retained.
|
|
38
|
+
#
|
|
39
|
+
# Send `null` for the whole object to turn a digest off, which unlinks the
|
|
40
|
+
# template and removes its schedules. There is no `enabled` flag, and
|
|
41
|
+
# `schedules: []` is rejected, because both states are un-deliverable rather than
|
|
42
|
+
# merely off.
|
|
43
|
+
#
|
|
44
|
+
# @return [Courier::Models::TopicDigestRequest, nil]
|
|
45
|
+
optional :digest, -> { Courier::TopicDigestRequest }, nil?: true
|
|
46
|
+
|
|
35
47
|
# @!attribute include_unsubscribe_header
|
|
36
48
|
# Whether to include a list-unsubscribe header on emails for this topic.
|
|
37
49
|
#
|
|
@@ -52,7 +64,7 @@ module Courier
|
|
|
52
64
|
# @return [Hash{Symbol=>Object}, nil]
|
|
53
65
|
optional :topic_data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
|
|
54
66
|
|
|
55
|
-
# @!method initialize(default_status:, name:, allowed_preferences: nil, description: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
|
|
67
|
+
# @!method initialize(default_status:, name:, allowed_preferences: nil, description: nil, digest: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
|
|
56
68
|
# Some parameter documentations has been truncated, see
|
|
57
69
|
# {Courier::Models::WorkspacePreferenceTopicReplaceRequest} for more details.
|
|
58
70
|
#
|
|
@@ -67,6 +79,8 @@ module Courier
|
|
|
67
79
|
#
|
|
68
80
|
# @param description [String, nil] Optional description shown under the topic on the hosted preferences page. Omit
|
|
69
81
|
#
|
|
82
|
+
# @param digest [Courier::Models::TopicDigestRequest, nil] A topic's digest configuration: the template that renders it, the cadences it de
|
|
83
|
+
#
|
|
70
84
|
# @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
|
|
71
85
|
#
|
|
72
86
|
# @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels delivered for this topic. Omit to clear.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module WorkspacePreferences
|
|
6
|
+
# @see Courier::Resources::WorkspacePreferences::Topics#delete_digest
|
|
7
|
+
class TopicDeleteDigestParams < Courier::Internal::Type::BaseModel
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute section_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :section_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute topic_id
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :topic_id, String
|
|
20
|
+
|
|
21
|
+
# @!method initialize(section_id:, topic_id:, request_options: {})
|
|
22
|
+
# @param section_id [String]
|
|
23
|
+
# @param topic_id [String]
|
|
24
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
module WorkspacePreferences
|
|
6
|
+
# @see Courier::Resources::WorkspacePreferences::Topics#release_digest
|
|
7
|
+
class TopicReleaseDigestParams < Courier::Models::TopicDigestReleaseRequest
|
|
8
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include Courier::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
# @!attribute section_id
|
|
12
|
+
#
|
|
13
|
+
# @return [String]
|
|
14
|
+
required :section_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute topic_id
|
|
17
|
+
#
|
|
18
|
+
# @return [String]
|
|
19
|
+
required :topic_id, String
|
|
20
|
+
|
|
21
|
+
# @!method initialize(section_id:, topic_id:, request_options: {})
|
|
22
|
+
# @param section_id [String]
|
|
23
|
+
# @param topic_id [String]
|
|
24
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
data/lib/courier/models.rb
CHANGED
|
@@ -187,6 +187,10 @@ module Courier
|
|
|
187
187
|
|
|
188
188
|
DigestCategory = Courier::Models::DigestCategory
|
|
189
189
|
|
|
190
|
+
DigestDayOfWeek = Courier::Models::DigestDayOfWeek
|
|
191
|
+
|
|
192
|
+
DigestFrequency = Courier::Models::DigestFrequency
|
|
193
|
+
|
|
190
194
|
DigestInstance = Courier::Models::DigestInstance
|
|
191
195
|
|
|
192
196
|
DigestInstanceListResponse = Courier::Models::DigestInstanceListResponse
|
|
@@ -643,6 +647,18 @@ module Courier
|
|
|
643
647
|
|
|
644
648
|
Token = Courier::Models::Token
|
|
645
649
|
|
|
650
|
+
TopicDigestCategory = Courier::Models::TopicDigestCategory
|
|
651
|
+
|
|
652
|
+
TopicDigestReleaseRequest = Courier::Models::TopicDigestReleaseRequest
|
|
653
|
+
|
|
654
|
+
TopicDigestRequest = Courier::Models::TopicDigestRequest
|
|
655
|
+
|
|
656
|
+
TopicDigestResponse = Courier::Models::TopicDigestResponse
|
|
657
|
+
|
|
658
|
+
TopicDigestScheduleRequest = Courier::Models::TopicDigestScheduleRequest
|
|
659
|
+
|
|
660
|
+
TopicDigestScheduleResponse = Courier::Models::TopicDigestScheduleResponse
|
|
661
|
+
|
|
646
662
|
TranslationRetrieveParams = Courier::Models::TranslationRetrieveParams
|
|
647
663
|
|
|
648
664
|
TranslationUpdateParams = Courier::Models::TranslationUpdateParams
|
|
@@ -45,7 +45,7 @@ module Courier
|
|
|
45
45
|
#
|
|
46
46
|
# @overload release(schedule_id, request_options: {})
|
|
47
47
|
#
|
|
48
|
-
# @param schedule_id [String] The ID of the digest schedule to release
|
|
48
|
+
# @param schedule_id [String] The ID of the digest schedule to release. Newer schedules are `sch_01m26xfcn3end
|
|
49
49
|
#
|
|
50
50
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
51
51
|
#
|
|
@@ -151,7 +151,7 @@ module Courier
|
|
|
151
151
|
#
|
|
152
152
|
# @param device [Courier::Models::Users::TokenAddSingleParams::Device, nil] Body param: Information about the device the token came from.
|
|
153
153
|
#
|
|
154
|
-
# @param expiry_date [String, Boolean, nil] Body param:
|
|
154
|
+
# @param expiry_date [String, Boolean, nil] Body param: When the token expires. Accepts a date, or the boolean `false` to di
|
|
155
155
|
#
|
|
156
156
|
# @param properties [Object] Body param: Properties about the token.
|
|
157
157
|
#
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Resources
|
|
5
5
|
class WorkspacePreferences
|
|
6
|
-
# Manage the workspace catalog of subscription topics, the sections that group
|
|
7
|
-
# them, and publishing the preference page.
|
|
8
6
|
class Topics
|
|
9
7
|
# Some parameter documentations has been truncated, see
|
|
10
8
|
# {Courier::Models::WorkspacePreferences::TopicCreateParams} for more details.
|
|
@@ -12,7 +10,7 @@ module Courier
|
|
|
12
10
|
# Creates a subscription topic inside a workspace preference. The default status
|
|
13
11
|
# sets whether users start opted in, opted out, or required.
|
|
14
12
|
#
|
|
15
|
-
# @overload create(section_id, default_status:, name:, allowed_preferences: nil, description: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
|
|
13
|
+
# @overload create(section_id, default_status:, name:, allowed_preferences: nil, description: nil, digest: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
|
|
16
14
|
#
|
|
17
15
|
# @param section_id [String] Path param: Id of the workspace preference to create the topic in.
|
|
18
16
|
#
|
|
@@ -24,6 +22,8 @@ module Courier
|
|
|
24
22
|
#
|
|
25
23
|
# @param description [String, nil] Body param: Optional description shown under the topic on the hosted preferences
|
|
26
24
|
#
|
|
25
|
+
# @param digest [Courier::Models::TopicDigestRequest, nil] Body param: A topic's digest configuration: the template that renders it, the ca
|
|
26
|
+
#
|
|
27
27
|
# @param include_unsubscribe_header [Boolean, nil] Body param: Whether to include a list-unsubscribe header on emails for this topi
|
|
28
28
|
#
|
|
29
29
|
# @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Body param: Default channels delivered for this topic. Defaults to empty if omit
|
|
@@ -130,13 +130,84 @@ module Courier
|
|
|
130
130
|
)
|
|
131
131
|
end
|
|
132
132
|
|
|
133
|
+
# Turn off a topic's digest, leaving the topic itself in place. The template is
|
|
134
|
+
# unlinked and the digest's schedules are removed along with their delivery rules.
|
|
135
|
+
# Equivalent to sending `digest: null` on a topic replace.
|
|
136
|
+
#
|
|
137
|
+
# @overload delete_digest(topic_id, section_id:, request_options: {})
|
|
138
|
+
#
|
|
139
|
+
# @param topic_id [String] The preference topic whose digest to turn off.
|
|
140
|
+
#
|
|
141
|
+
# @param section_id [String] The preference section containing the topic.
|
|
142
|
+
#
|
|
143
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
144
|
+
#
|
|
145
|
+
# @return [nil]
|
|
146
|
+
#
|
|
147
|
+
# @see Courier::Models::WorkspacePreferences::TopicDeleteDigestParams
|
|
148
|
+
def delete_digest(topic_id, params)
|
|
149
|
+
parsed, options = Courier::WorkspacePreferences::TopicDeleteDigestParams.dump_request(params)
|
|
150
|
+
section_id =
|
|
151
|
+
parsed.delete(:section_id) do
|
|
152
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
153
|
+
end
|
|
154
|
+
@client.request(
|
|
155
|
+
method: :delete,
|
|
156
|
+
path: ["preferences/sections/%1$s/topics/%2$s/digest", section_id, topic_id],
|
|
157
|
+
model: NilClass,
|
|
158
|
+
options: options
|
|
159
|
+
)
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Some parameter documentations has been truncated, see
|
|
163
|
+
# {Courier::Models::WorkspacePreferences::TopicReleaseDigestParams} for more
|
|
164
|
+
# details.
|
|
165
|
+
#
|
|
166
|
+
# Send one recipient's held digest now, instead of waiting for its schedule. Use
|
|
167
|
+
# it to preview what a digest will look like, or to let someone flush their own.
|
|
168
|
+
#
|
|
169
|
+
# Keyed on the topic because that is how a held digest is stored: one per
|
|
170
|
+
# recipient per topic, with the schedule recorded on it rather than part of its
|
|
171
|
+
# identity. To flush every recipient on a schedule instead, use
|
|
172
|
+
# `POST /digests/schedules/{schedule_id}/trigger`.
|
|
173
|
+
#
|
|
174
|
+
# @overload release_digest(topic_id, section_id:, user_id:, tenant_id: nil, request_options: {})
|
|
175
|
+
#
|
|
176
|
+
# @param topic_id [String] Path param: The preference topic whose digest to release.
|
|
177
|
+
#
|
|
178
|
+
# @param section_id [String] Path param: The preference section containing the topic.
|
|
179
|
+
#
|
|
180
|
+
# @param user_id [String] Body param: The recipient whose digest to release. Required: there is no "releas
|
|
181
|
+
#
|
|
182
|
+
# @param tenant_id [String] Body param: The recipient's tenant, when they were sent to as part of one -- the
|
|
183
|
+
#
|
|
184
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
185
|
+
#
|
|
186
|
+
# @return [nil]
|
|
187
|
+
#
|
|
188
|
+
# @see Courier::Models::WorkspacePreferences::TopicReleaseDigestParams
|
|
189
|
+
def release_digest(topic_id, params)
|
|
190
|
+
parsed, options = Courier::WorkspacePreferences::TopicReleaseDigestParams.dump_request(params)
|
|
191
|
+
section_id =
|
|
192
|
+
parsed.delete(:section_id) do
|
|
193
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
194
|
+
end
|
|
195
|
+
@client.request(
|
|
196
|
+
method: :post,
|
|
197
|
+
path: ["preferences/sections/%1$s/topics/%2$s/digest/release", section_id, topic_id],
|
|
198
|
+
body: parsed,
|
|
199
|
+
model: NilClass,
|
|
200
|
+
options: options
|
|
201
|
+
)
|
|
202
|
+
end
|
|
203
|
+
|
|
133
204
|
# Some parameter documentations has been truncated, see
|
|
134
205
|
# {Courier::Models::WorkspacePreferences::TopicReplaceParams} for more details.
|
|
135
206
|
#
|
|
136
207
|
# Replace a topic within a workspace preference. Full document replacement;
|
|
137
208
|
# missing optional fields are cleared. Same 404 rules as GET.
|
|
138
209
|
#
|
|
139
|
-
# @overload replace(topic_id, section_id:, default_status:, name:, allowed_preferences: nil, description: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, request_options: {})
|
|
210
|
+
# @overload replace(topic_id, section_id:, default_status:, name:, allowed_preferences: nil, description: nil, digest: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, request_options: {})
|
|
140
211
|
#
|
|
141
212
|
# @param topic_id [String] Path param: Id of the subscription preference topic.
|
|
142
213
|
#
|
|
@@ -150,6 +221,8 @@ module Courier
|
|
|
150
221
|
#
|
|
151
222
|
# @param description [String, nil] Body param: Optional description shown under the topic on the hosted preferences
|
|
152
223
|
#
|
|
224
|
+
# @param digest [Courier::Models::TopicDigestRequest, nil] Body param: A topic's digest configuration: the template that renders it, the ca
|
|
225
|
+
#
|
|
153
226
|
# @param include_unsubscribe_header [Boolean, nil] Body param: Whether to include a list-unsubscribe header on emails for this topi
|
|
154
227
|
#
|
|
155
228
|
# @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Body param: Default channels delivered for this topic. Omit to clear.
|
|
@@ -5,8 +5,6 @@ module Courier
|
|
|
5
5
|
# Manage the workspace catalog of subscription topics, the sections that group
|
|
6
6
|
# them, and publishing the preference page.
|
|
7
7
|
class WorkspacePreferences
|
|
8
|
-
# Manage the workspace catalog of subscription topics, the sections that group
|
|
9
|
-
# them, and publishing the preference page.
|
|
10
8
|
# @return [Courier::Resources::WorkspacePreferences::Topics]
|
|
11
9
|
attr_reader :topics
|
|
12
10
|
|
data/lib/courier/version.rb
CHANGED