trycourier 4.17.0 → 4.17.1

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/lib/courier/client.rb +3 -3
  4. data/lib/courier/models/publish_preferences_response.rb +1 -1
  5. data/lib/courier/models/{preference_section_archive_params.rb → workspace_preference_archive_params.rb} +2 -2
  6. data/lib/courier/models/{preference_section_create_params.rb → workspace_preference_create_params.rb} +2 -2
  7. data/lib/courier/models/{preference_section_create_request.rb → workspace_preference_create_request.rb} +8 -8
  8. data/lib/courier/models/{preference_section_get_response.rb → workspace_preference_get_response.rb} +15 -15
  9. data/lib/courier/models/{preference_section_list_params.rb → workspace_preference_list_params.rb} +2 -2
  10. data/lib/courier/models/workspace_preference_list_response.rb +18 -0
  11. data/lib/courier/models/{preference_section_publish_params.rb → workspace_preference_publish_params.rb} +2 -2
  12. data/lib/courier/models/{preference_section_replace_params.rb → workspace_preference_replace_params.rb} +2 -2
  13. data/lib/courier/models/{preference_section_replace_request.rb → workspace_preference_replace_request.rb} +8 -8
  14. data/lib/courier/models/{preference_section_retrieve_params.rb → workspace_preference_retrieve_params.rb} +2 -2
  15. data/lib/courier/models/{preference_topic_create_request.rb → workspace_preference_topic_create_request.rb} +9 -9
  16. data/lib/courier/models/{preference_topic_get_response.rb → workspace_preference_topic_get_response.rb} +8 -8
  17. data/lib/courier/models/workspace_preference_topic_list_response.rb +17 -0
  18. data/lib/courier/models/{preference_topic_replace_request.rb → workspace_preference_topic_replace_request.rb} +8 -8
  19. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rb +2 -2
  20. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rb +3 -3
  21. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rb +2 -2
  22. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rb +3 -3
  23. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rb +2 -2
  24. data/lib/courier/models.rb +30 -30
  25. data/lib/courier/resources/notifications/checks.rb +3 -3
  26. data/lib/courier/resources/{preference_sections → workspace_preferences}/topics.rb +40 -37
  27. data/lib/courier/resources/{preference_sections.rb → workspace_preferences.rb} +40 -40
  28. data/lib/courier/version.rb +1 -1
  29. data/lib/courier.rb +21 -21
  30. data/rbi/courier/client.rbi +2 -2
  31. data/rbi/courier/models/{preference_section_retrieve_params.rbi → workspace_preference_archive_params.rbi} +2 -2
  32. data/rbi/courier/models/{preference_section_create_params.rbi → workspace_preference_create_params.rbi} +2 -2
  33. data/rbi/courier/models/{preference_section_create_request.rbi → workspace_preference_create_request.rbi} +9 -9
  34. data/rbi/courier/models/{preference_section_get_response.rbi → workspace_preference_get_response.rbi} +17 -16
  35. data/rbi/courier/models/{preference_section_list_params.rbi → workspace_preference_list_params.rbi} +2 -2
  36. data/rbi/courier/models/{preference_topic_list_response.rbi → workspace_preference_list_response.rbi} +6 -6
  37. data/rbi/courier/models/{preference_section_publish_params.rbi → workspace_preference_publish_params.rbi} +2 -2
  38. data/rbi/courier/models/{preference_section_replace_params.rbi → workspace_preference_replace_params.rbi} +2 -2
  39. data/rbi/courier/models/{preference_section_replace_request.rbi → workspace_preference_replace_request.rbi} +9 -9
  40. data/rbi/courier/models/{preference_section_archive_params.rbi → workspace_preference_retrieve_params.rbi} +2 -2
  41. data/rbi/courier/models/{preference_topic_create_request.rbi → workspace_preference_topic_create_request.rbi} +22 -17
  42. data/rbi/courier/models/{preference_topic_get_response.rbi → workspace_preference_topic_get_response.rbi} +23 -17
  43. data/rbi/courier/models/workspace_preference_topic_list_response.rbi +36 -0
  44. data/rbi/courier/models/{preference_topic_replace_request.rbi → workspace_preference_topic_replace_request.rbi} +22 -17
  45. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rbi +2 -2
  46. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rbi +3 -3
  47. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rbi +2 -2
  48. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rbi +3 -3
  49. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rbi +2 -2
  50. data/rbi/courier/models.rbi +43 -36
  51. data/rbi/courier/resources/notifications/checks.rbi +3 -3
  52. data/rbi/courier/resources/{preference_sections → workspace_preferences}/topics.rbi +25 -22
  53. data/rbi/courier/resources/{preference_sections.rbi → workspace_preferences.rbi} +27 -27
  54. data/sig/courier/client.rbs +1 -1
  55. data/sig/courier/models/{preference_section_retrieve_params.rbs → workspace_preference_archive_params.rbs} +2 -2
  56. data/sig/courier/models/{preference_section_create_params.rbs → workspace_preference_create_params.rbs} +2 -2
  57. data/sig/courier/models/{preference_section_replace_request.rbs → workspace_preference_create_request.rbs} +2 -2
  58. data/sig/courier/models/{preference_section_get_response.rbs → workspace_preference_get_response.rbs} +6 -6
  59. data/sig/courier/models/{preference_section_list_params.rbs → workspace_preference_list_params.rbs} +2 -2
  60. data/sig/courier/models/workspace_preference_list_response.rbs +18 -0
  61. data/sig/courier/models/{preference_section_publish_params.rbs → workspace_preference_publish_params.rbs} +2 -2
  62. data/sig/courier/models/{preference_section_replace_params.rbs → workspace_preference_replace_params.rbs} +2 -2
  63. data/sig/courier/models/{preference_section_create_request.rbs → workspace_preference_replace_request.rbs} +2 -2
  64. data/sig/courier/models/{preference_section_archive_params.rbs → workspace_preference_retrieve_params.rbs} +2 -2
  65. data/sig/courier/models/{preference_topic_create_request.rbs → workspace_preference_topic_create_request.rbs} +12 -12
  66. data/sig/courier/models/{preference_topic_get_response.rbs → workspace_preference_topic_get_response.rbs} +12 -12
  67. data/sig/courier/models/workspace_preference_topic_list_response.rbs +18 -0
  68. data/sig/courier/models/{preference_topic_replace_request.rbs → workspace_preference_topic_replace_request.rbs} +12 -12
  69. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rbs +1 -1
  70. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rbs +2 -2
  71. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rbs +1 -1
  72. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rbs +2 -2
  73. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rbs +1 -1
  74. data/sig/courier/models.rbs +30 -30
  75. data/sig/courier/resources/{preference_sections → workspace_preferences}/topics.rbs +9 -9
  76. data/sig/courier/resources/{preference_sections.rbs → workspace_preferences.rbs} +6 -6
  77. metadata +65 -65
  78. data/lib/courier/models/preference_section_list_response.rb +0 -18
  79. data/lib/courier/models/preference_topic_list_response.rb +0 -17
  80. data/rbi/courier/models/preference_section_list_response.rbi +0 -35
  81. data/sig/courier/models/preference_section_list_response.rbs +0 -18
  82. data/sig/courier/models/preference_topic_list_response.rbs +0 -16
@@ -2,18 +2,20 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- class PreferenceTopicReplaceRequest < Courier::Internal::Type::BaseModel
5
+ class WorkspacePreferenceTopicReplaceRequest < Courier::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
8
  T.any(
9
- Courier::PreferenceTopicReplaceRequest,
9
+ Courier::WorkspacePreferenceTopicReplaceRequest,
10
10
  Courier::Internal::AnyHash
11
11
  )
12
12
  end
13
13
 
14
14
  # The default subscription status applied when a recipient has not set their own.
15
15
  sig do
16
- returns(Courier::PreferenceTopicReplaceRequest::DefaultStatus::OrSymbol)
16
+ returns(
17
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::OrSymbol
18
+ )
17
19
  end
18
20
  attr_accessor :default_status
19
21
 
@@ -26,7 +28,7 @@ module Courier
26
28
  returns(
27
29
  T.nilable(
28
30
  T::Array[
29
- Courier::PreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
31
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
30
32
  ]
31
33
  )
32
34
  )
@@ -52,12 +54,12 @@ module Courier
52
54
  sig do
53
55
  params(
54
56
  default_status:
55
- Courier::PreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
57
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
56
58
  name: String,
57
59
  allowed_preferences:
58
60
  T.nilable(
59
61
  T::Array[
60
- Courier::PreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
62
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
61
63
  ]
62
64
  ),
63
65
  include_unsubscribe_header: T.nilable(T::Boolean),
@@ -86,12 +88,12 @@ module Courier
86
88
  override.returns(
87
89
  {
88
90
  default_status:
89
- Courier::PreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
91
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
90
92
  name: String,
91
93
  allowed_preferences:
92
94
  T.nilable(
93
95
  T::Array[
94
- Courier::PreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
96
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
95
97
  ]
96
98
  ),
97
99
  include_unsubscribe_header: T.nilable(T::Boolean),
@@ -110,30 +112,33 @@ module Courier
110
112
 
111
113
  TaggedSymbol =
112
114
  T.type_alias do
113
- T.all(Symbol, Courier::PreferenceTopicReplaceRequest::DefaultStatus)
115
+ T.all(
116
+ Symbol,
117
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus
118
+ )
114
119
  end
115
120
  OrSymbol = T.type_alias { T.any(Symbol, String) }
116
121
 
117
122
  OPTED_OUT =
118
123
  T.let(
119
124
  :OPTED_OUT,
120
- Courier::PreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
125
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
121
126
  )
122
127
  OPTED_IN =
123
128
  T.let(
124
129
  :OPTED_IN,
125
- Courier::PreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
130
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
126
131
  )
127
132
  REQUIRED =
128
133
  T.let(
129
134
  :REQUIRED,
130
- Courier::PreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
135
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
131
136
  )
132
137
 
133
138
  sig do
134
139
  override.returns(
135
140
  T::Array[
136
- Courier::PreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
141
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
137
142
  ]
138
143
  )
139
144
  end
@@ -149,7 +154,7 @@ module Courier
149
154
  T.type_alias do
150
155
  T.all(
151
156
  Symbol,
152
- Courier::PreferenceTopicReplaceRequest::AllowedPreference
157
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference
153
158
  )
154
159
  end
155
160
  OrSymbol = T.type_alias { T.any(Symbol, String) }
@@ -157,18 +162,18 @@ module Courier
157
162
  SNOOZE =
158
163
  T.let(
159
164
  :snooze,
160
- Courier::PreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
165
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
161
166
  )
162
167
  CHANNEL_PREFERENCES =
163
168
  T.let(
164
169
  :channel_preferences,
165
- Courier::PreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
170
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
166
171
  )
167
172
 
168
173
  sig do
169
174
  override.returns(
170
175
  T::Array[
171
- Courier::PreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
176
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
172
177
  ]
173
178
  )
174
179
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- module PreferenceSections
5
+ module WorkspacePreferences
6
6
  class TopicArchiveParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
@@ -10,7 +10,7 @@ module Courier
10
10
  OrHash =
11
11
  T.type_alias do
12
12
  T.any(
13
- Courier::PreferenceSections::TopicArchiveParams,
13
+ Courier::WorkspacePreferences::TopicArchiveParams,
14
14
  Courier::Internal::AnyHash
15
15
  )
16
16
  end
@@ -2,15 +2,15 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- module PreferenceSections
6
- class TopicCreateParams < Courier::Models::PreferenceTopicCreateRequest
5
+ module WorkspacePreferences
6
+ class TopicCreateParams < Courier::Models::WorkspacePreferenceTopicCreateRequest
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
10
10
  OrHash =
11
11
  T.type_alias do
12
12
  T.any(
13
- Courier::PreferenceSections::TopicCreateParams,
13
+ Courier::WorkspacePreferences::TopicCreateParams,
14
14
  Courier::Internal::AnyHash
15
15
  )
16
16
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- module PreferenceSections
5
+ module WorkspacePreferences
6
6
  class TopicListParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
@@ -10,7 +10,7 @@ module Courier
10
10
  OrHash =
11
11
  T.type_alias do
12
12
  T.any(
13
- Courier::PreferenceSections::TopicListParams,
13
+ Courier::WorkspacePreferences::TopicListParams,
14
14
  Courier::Internal::AnyHash
15
15
  )
16
16
  end
@@ -2,15 +2,15 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- module PreferenceSections
6
- class TopicReplaceParams < Courier::Models::PreferenceTopicReplaceRequest
5
+ module WorkspacePreferences
6
+ class TopicReplaceParams < Courier::Models::WorkspacePreferenceTopicReplaceRequest
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
10
10
  OrHash =
11
11
  T.type_alias do
12
12
  T.any(
13
- Courier::PreferenceSections::TopicReplaceParams,
13
+ Courier::WorkspacePreferences::TopicReplaceParams,
14
14
  Courier::Internal::AnyHash
15
15
  )
16
16
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- module PreferenceSections
5
+ module WorkspacePreferences
6
6
  class TopicRetrieveParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
@@ -10,7 +10,7 @@ module Courier
10
10
  OrHash =
11
11
  T.type_alias do
12
12
  T.any(
13
- Courier::PreferenceSections::TopicRetrieveParams,
13
+ Courier::WorkspacePreferences::TopicRetrieveParams,
14
14
  Courier::Internal::AnyHash
15
15
  )
16
16
  end
@@ -381,44 +381,8 @@ module Courier
381
381
 
382
382
  Preference = Courier::Models::Preference
383
383
 
384
- PreferenceSectionArchiveParams =
385
- Courier::Models::PreferenceSectionArchiveParams
386
-
387
- PreferenceSectionCreateParams = Courier::Models::PreferenceSectionCreateParams
388
-
389
- PreferenceSectionCreateRequest =
390
- Courier::Models::PreferenceSectionCreateRequest
391
-
392
- PreferenceSectionGetResponse = Courier::Models::PreferenceSectionGetResponse
393
-
394
- PreferenceSectionListParams = Courier::Models::PreferenceSectionListParams
395
-
396
- PreferenceSectionListResponse = Courier::Models::PreferenceSectionListResponse
397
-
398
- PreferenceSectionPublishParams =
399
- Courier::Models::PreferenceSectionPublishParams
400
-
401
- PreferenceSectionReplaceParams =
402
- Courier::Models::PreferenceSectionReplaceParams
403
-
404
- PreferenceSectionReplaceRequest =
405
- Courier::Models::PreferenceSectionReplaceRequest
406
-
407
- PreferenceSectionRetrieveParams =
408
- Courier::Models::PreferenceSectionRetrieveParams
409
-
410
- PreferenceSections = Courier::Models::PreferenceSections
411
-
412
384
  PreferenceStatus = Courier::Models::PreferenceStatus
413
385
 
414
- PreferenceTopicCreateRequest = Courier::Models::PreferenceTopicCreateRequest
415
-
416
- PreferenceTopicGetResponse = Courier::Models::PreferenceTopicGetResponse
417
-
418
- PreferenceTopicListResponse = Courier::Models::PreferenceTopicListResponse
419
-
420
- PreferenceTopicReplaceRequest = Courier::Models::PreferenceTopicReplaceRequest
421
-
422
386
  ProfileCreateParams = Courier::Models::ProfileCreateParams
423
387
 
424
388
  ProfileDeleteParams = Courier::Models::ProfileDeleteParams
@@ -571,4 +535,47 @@ module Courier
571
535
  WebhookRecipient = Courier::Models::WebhookRecipient
572
536
 
573
537
  WidgetBackground = Courier::Models::WidgetBackground
538
+
539
+ WorkspacePreferenceArchiveParams =
540
+ Courier::Models::WorkspacePreferenceArchiveParams
541
+
542
+ WorkspacePreferenceCreateParams =
543
+ Courier::Models::WorkspacePreferenceCreateParams
544
+
545
+ WorkspacePreferenceCreateRequest =
546
+ Courier::Models::WorkspacePreferenceCreateRequest
547
+
548
+ WorkspacePreferenceGetResponse =
549
+ Courier::Models::WorkspacePreferenceGetResponse
550
+
551
+ WorkspacePreferenceListParams = Courier::Models::WorkspacePreferenceListParams
552
+
553
+ WorkspacePreferenceListResponse =
554
+ Courier::Models::WorkspacePreferenceListResponse
555
+
556
+ WorkspacePreferencePublishParams =
557
+ Courier::Models::WorkspacePreferencePublishParams
558
+
559
+ WorkspacePreferenceReplaceParams =
560
+ Courier::Models::WorkspacePreferenceReplaceParams
561
+
562
+ WorkspacePreferenceReplaceRequest =
563
+ Courier::Models::WorkspacePreferenceReplaceRequest
564
+
565
+ WorkspacePreferenceRetrieveParams =
566
+ Courier::Models::WorkspacePreferenceRetrieveParams
567
+
568
+ WorkspacePreferences = Courier::Models::WorkspacePreferences
569
+
570
+ WorkspacePreferenceTopicCreateRequest =
571
+ Courier::Models::WorkspacePreferenceTopicCreateRequest
572
+
573
+ WorkspacePreferenceTopicGetResponse =
574
+ Courier::Models::WorkspacePreferenceTopicGetResponse
575
+
576
+ WorkspacePreferenceTopicListResponse =
577
+ Courier::Models::WorkspacePreferenceTopicListResponse
578
+
579
+ WorkspacePreferenceTopicReplaceRequest =
580
+ Courier::Models::WorkspacePreferenceTopicReplaceRequest
574
581
  end
@@ -4,7 +4,7 @@ module Courier
4
4
  module Resources
5
5
  class Notifications
6
6
  class Checks
7
- # Replace the checks for a notification template submission.
7
+ # Replace the submission checks for a notification template.
8
8
  sig do
9
9
  params(
10
10
  submission_id: String,
@@ -24,7 +24,7 @@ module Courier
24
24
  )
25
25
  end
26
26
 
27
- # Retrieve the checks for a notification template submission.
27
+ # Retrieve the submission checks for a notification template.
28
28
  sig do
29
29
  params(
30
30
  submission_id: String,
@@ -41,7 +41,7 @@ module Courier
41
41
  )
42
42
  end
43
43
 
44
- # Cancel a notification template submission.
44
+ # Cancel a submission for a notification template.
45
45
  sig do
46
46
  params(
47
47
  submission_id: String,
@@ -2,20 +2,21 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
- class PreferenceSections
5
+ class WorkspacePreferences
6
6
  class Topics
7
- # Create a subscription preference topic inside a section. Fails with 404 if the
8
- # section does not exist. The topic id is generated and returned.
7
+ # Create a subscription preference topic inside a workspace preference. Fails with
8
+ # 404 if the workspace preference does not exist. The topic id is generated and
9
+ # returned.
9
10
  sig do
10
11
  params(
11
12
  section_id: String,
12
13
  default_status:
13
- Courier::PreferenceTopicCreateRequest::DefaultStatus::OrSymbol,
14
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::OrSymbol,
14
15
  name: String,
15
16
  allowed_preferences:
16
17
  T.nilable(
17
18
  T::Array[
18
- Courier::PreferenceTopicCreateRequest::AllowedPreference::OrSymbol
19
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::OrSymbol
19
20
  ]
20
21
  ),
21
22
  include_unsubscribe_header: T.nilable(T::Boolean),
@@ -23,10 +24,10 @@ module Courier
23
24
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
24
25
  topic_data: T.nilable(T::Hash[Symbol, T.anything]),
25
26
  request_options: Courier::RequestOptions::OrHash
26
- ).returns(Courier::PreferenceTopicGetResponse)
27
+ ).returns(Courier::WorkspacePreferenceTopicGetResponse)
27
28
  end
28
29
  def create(
29
- # Id of the preference section to create the topic in.
30
+ # Id of the workspace preference to create the topic in.
30
31
  section_id,
31
32
  # The default subscription status applied when a recipient has not set their own.
32
33
  default_status:,
@@ -45,39 +46,41 @@ module Courier
45
46
  )
46
47
  end
47
48
 
48
- # Retrieve a topic within a section. Returns 404 if the section does not exist,
49
- # the topic does not exist, or the topic belongs to a different section.
49
+ # Retrieve a topic within a workspace preference. Returns 404 if the workspace
50
+ # preference does not exist, the topic does not exist, or the topic belongs to a
51
+ # different workspace preference.
50
52
  sig do
51
53
  params(
52
54
  topic_id: String,
53
55
  section_id: String,
54
56
  request_options: Courier::RequestOptions::OrHash
55
- ).returns(Courier::PreferenceTopicGetResponse)
57
+ ).returns(Courier::WorkspacePreferenceTopicGetResponse)
56
58
  end
57
59
  def retrieve(
58
60
  # Id of the subscription preference topic.
59
61
  topic_id,
60
- # Id of the preference section.
62
+ # Id of the workspace preference.
61
63
  section_id:,
62
64
  request_options: {}
63
65
  )
64
66
  end
65
67
 
66
- # List the topics in a preference section.
68
+ # List the topics in a workspace preference.
67
69
  sig do
68
70
  params(
69
71
  section_id: String,
70
72
  request_options: Courier::RequestOptions::OrHash
71
- ).returns(Courier::PreferenceTopicListResponse)
73
+ ).returns(Courier::WorkspacePreferenceTopicListResponse)
72
74
  end
73
75
  def list(
74
- # Id of the preference section.
76
+ # Id of the workspace preference.
75
77
  section_id,
76
78
  request_options: {}
77
79
  )
78
80
  end
79
81
 
80
- # Archive a topic and remove it from its section. Same 404 rules as GET.
82
+ # Archive a topic and remove it from its workspace preference. Same 404 rules as
83
+ # GET.
81
84
  sig do
82
85
  params(
83
86
  topic_id: String,
@@ -88,25 +91,25 @@ module Courier
88
91
  def archive(
89
92
  # Id of the subscription preference topic.
90
93
  topic_id,
91
- # Id of the preference section.
94
+ # Id of the workspace preference.
92
95
  section_id:,
93
96
  request_options: {}
94
97
  )
95
98
  end
96
99
 
97
- # Replace a topic within a section. Full document replacement; missing optional
98
- # fields are cleared. Same 404 rules as GET.
100
+ # Replace a topic within a workspace preference. Full document replacement;
101
+ # missing optional fields are cleared. Same 404 rules as GET.
99
102
  sig do
100
103
  params(
101
104
  topic_id: String,
102
105
  section_id: String,
103
106
  default_status:
104
- Courier::PreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
107
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
105
108
  name: String,
106
109
  allowed_preferences:
107
110
  T.nilable(
108
111
  T::Array[
109
- Courier::PreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
112
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
110
113
  ]
111
114
  ),
112
115
  include_unsubscribe_header: T.nilable(T::Boolean),
@@ -114,12 +117,12 @@ module Courier
114
117
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
115
118
  topic_data: T.nilable(T::Hash[Symbol, T.anything]),
116
119
  request_options: Courier::RequestOptions::OrHash
117
- ).returns(Courier::PreferenceTopicGetResponse)
120
+ ).returns(Courier::WorkspacePreferenceTopicGetResponse)
118
121
  end
119
122
  def replace(
120
123
  # Path param: Id of the subscription preference topic.
121
124
  topic_id,
122
- # Path param: Id of the preference section.
125
+ # Path param: Id of the workspace preference.
123
126
  section_id:,
124
127
  # Body param: The default subscription status applied when a recipient has not set
125
128
  # their own.
@@ -2,12 +2,12 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
- class PreferenceSections
6
- sig { returns(Courier::Resources::PreferenceSections::Topics) }
5
+ class WorkspacePreferences
6
+ sig { returns(Courier::Resources::WorkspacePreferences::Topics) }
7
7
  attr_reader :topics
8
8
 
9
- # Create a preference section in your workspace. The section id is generated and
10
- # returned. Topics are created inside a section via POST
9
+ # Create a workspace preference. The workspace preference id is generated and
10
+ # returned. Topics are created inside a workspace preference via POST
11
11
  # /preferences/sections/{section_id}/topics.
12
12
  sig do
13
13
  params(
@@ -16,45 +16,45 @@ module Courier
16
16
  routing_options:
17
17
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
18
18
  request_options: Courier::RequestOptions::OrHash
19
- ).returns(Courier::PreferenceSectionGetResponse)
19
+ ).returns(Courier::WorkspacePreferenceGetResponse)
20
20
  end
21
21
  def create(
22
- # Human-readable name for the section.
22
+ # Human-readable name for the workspace preference.
23
23
  name:,
24
- # Whether the section defines custom routing for its topics.
24
+ # Whether the workspace preference defines custom routing for its topics.
25
25
  has_custom_routing: nil,
26
- # Default channels for the section. Defaults to empty if omitted.
26
+ # Default channels for the workspace preference. Defaults to empty if omitted.
27
27
  routing_options: nil,
28
28
  request_options: {}
29
29
  )
30
30
  end
31
31
 
32
- # Retrieve a preference section by id, including its topics.
32
+ # Retrieve a workspace preference by id, including its topics.
33
33
  sig do
34
34
  params(
35
35
  section_id: String,
36
36
  request_options: Courier::RequestOptions::OrHash
37
- ).returns(Courier::PreferenceSectionGetResponse)
37
+ ).returns(Courier::WorkspacePreferenceGetResponse)
38
38
  end
39
39
  def retrieve(
40
- # Id of the preference section.
40
+ # Id of the workspace preference.
41
41
  section_id,
42
42
  request_options: {}
43
43
  )
44
44
  end
45
45
 
46
- # List the workspace's preference sections. Each section embeds its topics. Scoped
47
- # to the workspace of the API key.
46
+ # List the workspace's preferences. Each workspace preference embeds its topics.
47
+ # Scoped to the workspace of the API key.
48
48
  sig do
49
49
  params(request_options: Courier::RequestOptions::OrHash).returns(
50
- Courier::PreferenceSectionListResponse
50
+ Courier::WorkspacePreferenceListResponse
51
51
  )
52
52
  end
53
53
  def list(request_options: {})
54
54
  end
55
55
 
56
- # Archive a preference section. The section must be empty: delete its topics
57
- # first, otherwise the request fails with 409.
56
+ # Archive a workspace preference. The workspace preference must be empty: delete
57
+ # its topics first, otherwise the request fails with 409.
58
58
  sig do
59
59
  params(
60
60
  section_id: String,
@@ -62,15 +62,15 @@ module Courier
62
62
  ).void
63
63
  end
64
64
  def archive(
65
- # Id of the preference section.
65
+ # Id of the workspace preference.
66
66
  section_id,
67
67
  request_options: {}
68
68
  )
69
69
  end
70
70
 
71
- # Publish the workspace's preferences page. Takes a snapshot of every section with
72
- # its topics under a new published version, making the current state visible on
73
- # the hosted preferences page (non-draft).
71
+ # Publish the workspace's preferences page. Takes a snapshot of every workspace
72
+ # preference with its topics under a new published version, making the current
73
+ # state visible on the hosted preferences page (non-draft).
74
74
  sig do
75
75
  params(request_options: Courier::RequestOptions::OrHash).returns(
76
76
  Courier::PublishPreferencesResponse
@@ -79,8 +79,8 @@ module Courier
79
79
  def publish(request_options: {})
80
80
  end
81
81
 
82
- # Replace a preference section. Full document replacement; missing optional fields
83
- # are cleared. Topics attached to the section are unaffected.
82
+ # Replace a workspace preference. Full document replacement; missing optional
83
+ # fields are cleared. Topics attached to the workspace preference are unaffected.
84
84
  sig do
85
85
  params(
86
86
  section_id: String,
@@ -89,16 +89,16 @@ module Courier
89
89
  routing_options:
90
90
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
91
91
  request_options: Courier::RequestOptions::OrHash
92
- ).returns(Courier::PreferenceSectionGetResponse)
92
+ ).returns(Courier::WorkspacePreferenceGetResponse)
93
93
  end
94
94
  def replace(
95
- # Id of the preference section.
95
+ # Id of the workspace preference.
96
96
  section_id,
97
- # Human-readable name for the section.
97
+ # Human-readable name for the workspace preference.
98
98
  name:,
99
- # Whether the section defines custom routing for its topics.
99
+ # Whether the workspace preference defines custom routing for its topics.
100
100
  has_custom_routing: nil,
101
- # Default channels for the section. Omit to clear.
101
+ # Default channels for the workspace preference. Omit to clear.
102
102
  routing_options: nil,
103
103
  request_options: {}
104
104
  )
@@ -42,7 +42,7 @@ module Courier
42
42
 
43
43
  attr_reader routing_strategies: Courier::Resources::RoutingStrategies
44
44
 
45
- attr_reader preference_sections: Courier::Resources::PreferenceSections
45
+ attr_reader workspace_preferences: Courier::Resources::WorkspacePreferences
46
46
 
47
47
  attr_reader profiles: Courier::Resources::Profiles
48
48
 
@@ -1,9 +1,9 @@
1
1
  module Courier
2
2
  module Models
3
- type preference_section_retrieve_params =
3
+ type workspace_preference_archive_params =
4
4
  { section_id: String } & Courier::Internal::Type::request_parameters
5
5
 
6
- class PreferenceSectionRetrieveParams < Courier::Internal::Type::BaseModel
6
+ class WorkspacePreferenceArchiveParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
@@ -1,9 +1,9 @@
1
1
  module Courier
2
2
  module Models
3
- type preference_section_create_params =
3
+ type workspace_preference_create_params =
4
4
  { } & Courier::Internal::Type::request_parameters
5
5
 
6
- class PreferenceSectionCreateParams < Courier::Models::PreferenceSectionCreateRequest
6
+ class WorkspacePreferenceCreateParams < Courier::Models::WorkspacePreferenceCreateRequest
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
@@ -1,13 +1,13 @@
1
1
  module Courier
2
2
  module Models
3
- type preference_section_replace_request =
3
+ type workspace_preference_create_request =
4
4
  {
5
5
  name: String,
6
6
  has_custom_routing: bool?,
7
7
  routing_options: ::Array[Courier::Models::channel_classification]?
8
8
  }
9
9
 
10
- class PreferenceSectionReplaceRequest < Courier::Internal::Type::BaseModel
10
+ class WorkspacePreferenceCreateRequest < Courier::Internal::Type::BaseModel
11
11
  attr_accessor name: String
12
12
 
13
13
  attr_accessor has_custom_routing: bool?