trycourier 6.5.0 → 6.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +1 -1
  4. data/lib/courier/models/create_journey_request.rb +16 -1
  5. data/lib/courier/models/digest_day_of_week.rb +21 -0
  6. data/lib/courier/models/digest_frequency.rb +21 -0
  7. data/lib/courier/models/journey_conditions_field.rb +11 -1
  8. data/lib/courier/models/journey_node.rb +17 -2
  9. data/lib/courier/models/journey_response.rb +14 -1
  10. data/lib/courier/models/topic_digest_category.rb +71 -0
  11. data/lib/courier/models/topic_digest_release_request.rb +35 -0
  12. data/lib/courier/models/topic_digest_request.rb +75 -0
  13. data/lib/courier/models/topic_digest_response.rb +66 -0
  14. data/lib/courier/models/topic_digest_schedule_request.rb +99 -0
  15. data/lib/courier/models/topic_digest_schedule_response.rb +111 -0
  16. data/lib/courier/models/users/preference_update_or_create_topic_params.rb +13 -1
  17. data/lib/courier/models/users/topic_preference.rb +17 -1
  18. data/lib/courier/models/workspace_preference_topic_create_request.rb +97 -1
  19. data/lib/courier/models/workspace_preference_topic_get_response.rb +9 -1
  20. data/lib/courier/models/workspace_preference_topic_replace_request.rb +15 -1
  21. data/lib/courier/models/workspace_preferences/topic_delete_digest_params.rb +28 -0
  22. data/lib/courier/models/workspace_preferences/topic_release_digest_params.rb +28 -0
  23. data/lib/courier/models.rb +16 -0
  24. data/lib/courier/resources/digests/schedules.rb +1 -1
  25. data/lib/courier/resources/journeys.rb +9 -2
  26. data/lib/courier/resources/workspace_preferences/topics.rb +77 -4
  27. data/lib/courier/resources/workspace_preferences.rb +0 -2
  28. data/lib/courier/version.rb +1 -1
  29. data/lib/courier.rb +10 -0
  30. data/rbi/courier/models/create_journey_request.rbi +19 -0
  31. data/rbi/courier/models/digest_day_of_week.rbi +25 -0
  32. data/rbi/courier/models/digest_frequency.rbi +25 -0
  33. data/rbi/courier/models/journey_node.rbi +12 -1
  34. data/rbi/courier/models/journey_response.rbi +12 -0
  35. data/rbi/courier/models/topic_digest_category.rbi +116 -0
  36. data/rbi/courier/models/topic_digest_release_request.rbi +51 -0
  37. data/rbi/courier/models/topic_digest_request.rbi +126 -0
  38. data/rbi/courier/models/topic_digest_response.rbi +98 -0
  39. data/rbi/courier/models/topic_digest_schedule_request.rbi +147 -0
  40. data/rbi/courier/models/topic_digest_schedule_response.rbi +175 -0
  41. data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +16 -0
  42. data/rbi/courier/models/users/topic_preference.rbi +27 -0
  43. data/rbi/courier/models/workspace_preference_topic_create_request.rbi +172 -0
  44. data/rbi/courier/models/workspace_preference_topic_get_response.rbi +13 -0
  45. data/rbi/courier/models/workspace_preference_topic_replace_request.rbi +25 -0
  46. data/rbi/courier/models/workspace_preferences/topic_delete_digest_params.rbi +48 -0
  47. data/rbi/courier/models/workspace_preferences/topic_release_digest_params.rbi +48 -0
  48. data/rbi/courier/models.rbi +16 -0
  49. data/rbi/courier/resources/digests/schedules.rbi +5 -2
  50. data/rbi/courier/resources/journeys.rbi +14 -0
  51. data/rbi/courier/resources/workspace_preferences/topics.rbi +80 -2
  52. data/rbi/courier/resources/workspace_preferences.rbi +0 -2
  53. data/sig/courier/models/create_journey_request.rbs +7 -0
  54. data/sig/courier/models/digest_day_of_week.rbs +26 -0
  55. data/sig/courier/models/digest_frequency.rbs +19 -0
  56. data/sig/courier/models/journey_response.rbs +5 -0
  57. data/sig/courier/models/topic_digest_category.rbs +57 -0
  58. data/sig/courier/models/topic_digest_release_request.rbs +17 -0
  59. data/sig/courier/models/topic_digest_request.rbs +52 -0
  60. data/sig/courier/models/topic_digest_response.rbs +58 -0
  61. data/sig/courier/models/topic_digest_schedule_request.rbs +80 -0
  62. data/sig/courier/models/topic_digest_schedule_response.rbs +96 -0
  63. data/sig/courier/models/users/preference_update_or_create_topic_params.rbs +5 -0
  64. data/sig/courier/models/users/topic_preference.rbs +7 -0
  65. data/sig/courier/models/workspace_preference_topic_create_request.rbs +50 -0
  66. data/sig/courier/models/workspace_preference_topic_get_response.rbs +5 -0
  67. data/sig/courier/models/workspace_preference_topic_replace_request.rbs +5 -0
  68. data/sig/courier/models/workspace_preferences/topic_delete_digest_params.rbs +30 -0
  69. data/sig/courier/models/workspace_preferences/topic_release_digest_params.rbs +34 -0
  70. data/sig/courier/models.rbs +16 -0
  71. data/sig/courier/resources/journeys.rbs +2 -0
  72. data/sig/courier/resources/workspace_preferences/topics.rbs +16 -0
  73. metadata +32 -2
@@ -0,0 +1,111 @@
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
+ # Two formats are in circulation and only one is safe to drop into a URL.
11
+ # Schedules created through the API are `sch_01m26xfcn3endt3nxy4e2kx2rh` and need
12
+ # no encoding. Schedules created in the Preferences Editor before that format are
13
+ # `sch/{uuid}` and contain a literal `/`, so they must be URL-encoded as
14
+ # `sch%2F{uuid}` — unencoded, the path does not match the route and the response
15
+ # is a bare `404` that reads like a broken endpoint. Existing ids are never
16
+ # migrated.
17
+ #
18
+ # @return [String]
19
+ required :schedule_id, String
20
+
21
+ # @!attribute created
22
+ # ISO-8601 timestamp of when the schedule was created.
23
+ #
24
+ # @return [String, nil]
25
+ optional :created, String
26
+
27
+ # @!attribute day_of_month
28
+ # Day of the month, 1-31.
29
+ #
30
+ # @return [Integer, nil]
31
+ optional :day_of_month, Integer
32
+
33
+ # @!attribute day_of_week
34
+ # A day of the week. Accepted case-insensitively, returned lowercase.
35
+ #
36
+ # @return [Symbol, Courier::Models::DigestDayOfWeek, nil]
37
+ optional :day_of_week, enum: -> { Courier::DigestDayOfWeek }
38
+
39
+ # @!attribute days_of_week
40
+ #
41
+ # @return [Array<Symbol, Courier::Models::DigestDayOfWeek>, nil]
42
+ optional :days_of_week, -> { Courier::Internal::Type::ArrayOf[enum: Courier::DigestDayOfWeek] }
43
+
44
+ # @!attribute disabled
45
+ # Whether the schedule is disabled.
46
+ #
47
+ # @return [Boolean, nil]
48
+ optional :disabled, Courier::Internal::Type::Boolean
49
+
50
+ # @!attribute frequency
51
+ # Omitted for a stored schedule this enum cannot express. Those schedules never
52
+ # fire, but their `schedule_id` is still returned so the `/digests/*` endpoints
53
+ # remain reachable for them.
54
+ #
55
+ # @return [Symbol, Courier::Models::DigestFrequency, nil]
56
+ optional :frequency, enum: -> { Courier::DigestFrequency }
57
+
58
+ # @!attribute is_default
59
+ # Whether this is the schedule recipients are placed on by default.
60
+ #
61
+ # @return [Boolean, nil]
62
+ optional :is_default, Courier::Internal::Type::Boolean
63
+
64
+ # @!attribute time
65
+ # 24-hour local delivery time, `HH:MM`.
66
+ #
67
+ # @return [String, nil]
68
+ optional :time, String
69
+
70
+ # @!attribute timezone
71
+ # IANA timezone the schedule is expressed in. Absent means UTC.
72
+ #
73
+ # @return [String, nil]
74
+ optional :timezone, String
75
+
76
+ # @!attribute updated
77
+ # ISO-8601 timestamp of the last update.
78
+ #
79
+ # @return [String, nil]
80
+ optional :updated, String
81
+
82
+ # @!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)
83
+ # Some parameter documentations has been truncated, see
84
+ # {Courier::Models::TopicDigestScheduleResponse} for more details.
85
+ #
86
+ # A delivery cadence for a topic's digest, with its assigned id.
87
+ #
88
+ # @param schedule_id [String] The schedule's identifier, assigned by the server. This is the value the `/diges
89
+ #
90
+ # @param created [String] ISO-8601 timestamp of when the schedule was created.
91
+ #
92
+ # @param day_of_month [Integer] Day of the month, 1-31.
93
+ #
94
+ # @param day_of_week [Symbol, Courier::Models::DigestDayOfWeek] A day of the week. Accepted case-insensitively, returned lowercase.
95
+ #
96
+ # @param days_of_week [Array<Symbol, Courier::Models::DigestDayOfWeek>]
97
+ #
98
+ # @param disabled [Boolean] Whether the schedule is disabled.
99
+ #
100
+ # @param frequency [Symbol, Courier::Models::DigestFrequency] Omitted for a stored schedule this enum cannot express. Those schedules never fi
101
+ #
102
+ # @param is_default [Boolean] Whether this is the schedule recipients are placed on by default.
103
+ #
104
+ # @param time [String] 24-hour local delivery time, `HH:MM`.
105
+ #
106
+ # @param timezone [String] IANA timezone the schedule is expressed in. Absent means UTC.
107
+ #
108
+ # @param updated [String] ISO-8601 timestamp of the last update.
109
+ end
110
+ end
111
+ 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
@@ -41,6 +41,20 @@ 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, returned on any read of
48
+ # the topic.
49
+ #
50
+ # Also omitted when the schedule they chose has since been deleted or disabled:
51
+ # the recipient is on the topic's default from that point on, which is how a send
52
+ # already resolves it, so the field reports what would actually be used rather
53
+ # than a dead id.
54
+ #
55
+ # @return [String, nil]
56
+ optional :digest_schedule_id, String
57
+
44
58
  # @!attribute has_custom_routing
45
59
  # Whether the user has chosen specific delivery channels for this topic (listed in
46
60
  # custom_routing) rather than the topic's default routing.
@@ -64,7 +78,7 @@ module Courier
64
78
  # @return [String, nil]
65
79
  optional :section_name, String
66
80
 
67
- # @!method initialize(default_status:, status:, topic_id:, topic_name:, custom_routing: nil, has_custom_routing: nil, section_id: nil, section_name: nil)
81
+ # @!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
82
  # Some parameter documentations has been truncated, see
69
83
  # {Courier::Models::Users::TopicPreference} for more details.
70
84
  #
@@ -78,6 +92,8 @@ module Courier
78
92
  #
79
93
  # @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
94
  #
95
+ # @param digest_schedule_id [String] The digest schedule this recipient is on for the topic. Omitted rather than null
96
+ #
81
97
  # @param has_custom_routing [Boolean, nil] Whether the user has chosen specific delivery channels for this topic (listed in
82
98
  #
83
99
  # @param section_id [String] The unique identifier of the section this topic belongs to. Always present when
@@ -32,6 +32,23 @@ module Courier
32
32
  # @return [String, nil]
33
33
  optional :description, String, nil?: true
34
34
 
35
+ # @!attribute digest
36
+ # A topic's digest, as supplied when the topic itself is created: the template
37
+ # that renders it, the cadences it delivers on, and how collected events are
38
+ # retained.
39
+ #
40
+ # Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
41
+ # is required — a topic being created has no stored schedules for an absent key to
42
+ # leave alone.
43
+ #
44
+ # Send `null` for the whole object to turn a digest off, which unlinks the
45
+ # template and removes its schedules. There is no `enabled` flag, and
46
+ # `schedules: []` is rejected, because both states are un-deliverable rather than
47
+ # merely off.
48
+ #
49
+ # @return [Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest, nil]
50
+ optional :digest, -> { Courier::WorkspacePreferenceTopicCreateRequest::Digest }, nil?: true
51
+
35
52
  # @!attribute include_unsubscribe_header
36
53
  # Whether to include a list-unsubscribe header on emails for this topic.
37
54
  #
@@ -52,7 +69,7 @@ module Courier
52
69
  # @return [Hash{Symbol=>Object}, nil]
53
70
  optional :topic_data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
54
71
 
55
- # @!method initialize(default_status:, name:, allowed_preferences: nil, description: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
72
+ # @!method initialize(default_status:, name:, allowed_preferences: nil, description: nil, digest: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil)
56
73
  # Some parameter documentations has been truncated, see
57
74
  # {Courier::Models::WorkspacePreferenceTopicCreateRequest} for more details.
58
75
  #
@@ -66,6 +83,8 @@ module Courier
66
83
  #
67
84
  # @param description [String, nil] Optional description shown under the topic on the hosted preferences page.
68
85
  #
86
+ # @param digest [Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest, nil] A topic's digest, as supplied when the topic itself is created: the template tha
87
+ #
69
88
  # @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
70
89
  #
71
90
  # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels delivered for this topic. Defaults to empty if omitted.
@@ -96,6 +115,83 @@ module Courier
96
115
  # @!method self.values
97
116
  # @return [Array<Symbol>]
98
117
  end
118
+
119
+ # @see Courier::Models::WorkspacePreferenceTopicCreateRequest#digest
120
+ class Digest < Courier::Internal::Type::BaseModel
121
+ # @!attribute schedules
122
+ # The cadences this digest delivers on.
123
+ #
124
+ # The array replaces the stored schedules wholesale, so a schedule you leave out
125
+ # of it is deleted along with its delivery rule. Omit the key entirely to leave
126
+ # the stored schedules untouched — useful for changing `template_id` or
127
+ # `categories` without restating every schedule.
128
+ #
129
+ # A digest must end up with at least one schedule, because one with none collects
130
+ # events into an instance that can never fire. So sending `[]` is always a `400`,
131
+ # and so is omitting the key on a topic that has no schedules stored yet.
132
+ #
133
+ # On **create** the key is required outright: a topic being created has nothing
134
+ # stored to leave alone, and the topic row is written before its digest, so
135
+ # rejecting it any later would leave the topic behind and let a retry duplicate
136
+ # it.
137
+ #
138
+ # @return [Array<Courier::Models::TopicDigestScheduleRequest>]
139
+ required :schedules, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestScheduleRequest] }
140
+
141
+ # @!attribute template_id
142
+ # The notification template that renders the digest. A digest with no template
143
+ # collects nothing, so this is required.
144
+ #
145
+ # @return [String]
146
+ required :template_id, String
147
+
148
+ # @!attribute audience_id
149
+ # Optional audience the digest is scoped to.
150
+ #
151
+ # @return [String, nil]
152
+ optional :audience_id, String
153
+
154
+ # @!attribute categories
155
+ # Retention rules per category key. Defaults to a single `digest` category
156
+ # retaining `FIRST`.
157
+ #
158
+ # @return [Array<Courier::Models::TopicDigestCategory>, nil]
159
+ optional :categories, -> { Courier::Internal::Type::ArrayOf[Courier::TopicDigestCategory] }
160
+
161
+ # @!attribute trigger_empty
162
+ # Whether to deliver the digest even when nothing was collected.
163
+ #
164
+ # @return [Boolean, nil]
165
+ optional :trigger_empty, Courier::Internal::Type::Boolean
166
+
167
+ # @!method initialize(schedules:, template_id:, audience_id: nil, categories: nil, trigger_empty: nil)
168
+ # Some parameter documentations has been truncated, see
169
+ # {Courier::Models::WorkspacePreferenceTopicCreateRequest::Digest} for more
170
+ # details.
171
+ #
172
+ # A topic's digest, as supplied when the topic itself is created: the template
173
+ # that renders it, the cadences it delivers on, and how collected events are
174
+ # retained.
175
+ #
176
+ # Identical to `TopicDigestRequest`, which a replace uses, except that `schedules`
177
+ # is required — a topic being created has no stored schedules for an absent key to
178
+ # leave alone.
179
+ #
180
+ # Send `null` for the whole object to turn a digest off, which unlinks the
181
+ # template and removes its schedules. There is no `enabled` flag, and
182
+ # `schedules: []` is rejected, because both states are un-deliverable rather than
183
+ # merely off.
184
+ #
185
+ # @param schedules [Array<Courier::Models::TopicDigestScheduleRequest>] The cadences this digest delivers on.
186
+ #
187
+ # @param template_id [String] The notification template that renders the digest. A digest with no template col
188
+ #
189
+ # @param audience_id [String] Optional audience the digest is scoped to.
190
+ #
191
+ # @param categories [Array<Courier::Models::TopicDigestCategory>] Retention rules per category key. Defaults to a single `digest` category retaini
192
+ #
193
+ # @param trigger_empty [Boolean] Whether to deliver the digest even when nothing was collected.
194
+ end
99
195
  end
100
196
  end
101
197
  end
@@ -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
@@ -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, in the form `sch/{uuid}`. The value mu
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
  #
@@ -21,12 +21,14 @@ module Courier
21
21
  # Creates a journey from a set of nodes, in draft state unless you pass a
22
22
  # published state. Send nodes cannot be included until their templates exist.
23
23
  #
24
- # @overload create(name:, nodes:, enabled: nil, state: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
24
+ # @overload create(name:, nodes:, cancelation_token: nil, enabled: nil, state: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
25
25
  #
26
26
  # @param name [String] Body param
27
27
  #
28
28
  # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>] Body param
29
29
  #
30
+ # @param cancelation_token [String] Body param: Cancelation token stored on the journey definition. It tags every ru
31
+ #
30
32
  # @param enabled [Boolean] Body param
31
33
  #
32
34
  # @param state [Symbol, Courier::Models::JourneyState] Body param: Lifecycle state of a journey.
@@ -259,10 +261,13 @@ module Courier
259
261
  )
260
262
  end
261
263
 
264
+ # Some parameter documentations has been truncated, see
265
+ # {Courier::Models::JourneyReplaceParams} for more details.
266
+ #
262
267
  # Replaces a journey's working draft, leaving the published version live until you
263
268
  # publish. Reach for this when editing a journey already running.
264
269
  #
265
- # @overload replace(template_id, name:, nodes:, enabled: nil, state: nil, request_options: {})
270
+ # @overload replace(template_id, name:, nodes:, cancelation_token: nil, enabled: nil, state: nil, request_options: {})
266
271
  #
267
272
  # @param template_id [String] Journey id
268
273
  #
@@ -270,6 +275,8 @@ module Courier
270
275
  #
271
276
  # @param nodes [Array<Courier::Models::JourneyAPIInvokeTriggerNode, Courier::Models::JourneySegmentTriggerNode, Courier::Models::JourneyAudienceTriggerNode, Courier::Models::JourneyWebhookTriggerNode, Courier::Models::JourneySendNode, Courier::Models::JourneyDelayDurationNode, Courier::Models::JourneyDelayUntilNode, Courier::Models::JourneyFetchGetDeleteNode, Courier::Models::JourneyFetchPostPutNode, Courier::Models::JourneyAINode, Courier::Models::JourneyThrottleStaticNode, Courier::Models::JourneyThrottleDynamicNode, Courier::Models::JourneyNode::JourneyBatchNode, Courier::Models::JourneyNode::JourneyAddToDigestNode, Courier::Models::JourneyExitNode, Courier::Models::JourneyNode::JourneyBranchNode>]
272
277
  #
278
+ # @param cancelation_token [String] Cancelation token stored on the journey definition. It tags every run the journe
279
+ #
273
280
  # @param enabled [Boolean]
274
281
  #
275
282
  # @param state [Symbol, Courier::Models::JourneyState] Lifecycle state of a journey.
@@ -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::WorkspacePreferenceTopicCreateRequest::Digest, nil] Body param: A topic's digest, as supplied when the topic itself is created: the
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "6.5.0"
4
+ VERSION = "6.7.0"
5
5
  end