trycourier 4.16.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 (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/lib/courier/client.rb +4 -0
  4. data/lib/courier/models/publish_preferences_response.rb +51 -0
  5. data/lib/courier/models/workspace_preference_archive_params.rb +20 -0
  6. data/lib/courier/models/workspace_preference_create_params.rb +14 -0
  7. data/lib/courier/models/workspace_preference_create_request.rb +36 -0
  8. data/lib/courier/models/workspace_preference_get_response.rb +83 -0
  9. data/lib/courier/models/workspace_preference_list_params.rb +14 -0
  10. data/lib/courier/models/workspace_preference_list_response.rb +18 -0
  11. data/lib/courier/models/workspace_preference_publish_params.rb +14 -0
  12. data/lib/courier/models/workspace_preference_replace_params.rb +20 -0
  13. data/lib/courier/models/workspace_preference_replace_request.rb +37 -0
  14. data/lib/courier/models/workspace_preference_retrieve_params.rb +20 -0
  15. data/lib/courier/models/workspace_preference_topic_create_request.rb +93 -0
  16. data/lib/courier/models/workspace_preference_topic_get_response.rb +124 -0
  17. data/lib/courier/models/workspace_preference_topic_list_response.rb +17 -0
  18. data/lib/courier/models/workspace_preference_topic_replace_request.rb +90 -0
  19. data/lib/courier/models/workspace_preferences/topic_archive_params.rb +28 -0
  20. data/lib/courier/models/workspace_preferences/topic_create_params.rb +22 -0
  21. data/lib/courier/models/workspace_preferences/topic_list_params.rb +22 -0
  22. data/lib/courier/models/workspace_preferences/topic_replace_params.rb +28 -0
  23. data/lib/courier/models/workspace_preferences/topic_retrieve_params.rb +28 -0
  24. data/lib/courier/models.rb +32 -0
  25. data/lib/courier/resources/notifications/checks.rb +3 -3
  26. data/lib/courier/resources/workspace_preferences/topics.rb +176 -0
  27. data/lib/courier/resources/workspace_preferences.rb +155 -0
  28. data/lib/courier/version.rb +1 -1
  29. data/lib/courier.rb +22 -0
  30. data/rbi/courier/client.rbi +3 -0
  31. data/rbi/courier/models/publish_preferences_response.rbi +70 -0
  32. data/rbi/courier/models/workspace_preference_archive_params.rbi +38 -0
  33. data/rbi/courier/models/workspace_preference_create_params.rbi +30 -0
  34. data/rbi/courier/models/workspace_preference_create_request.rbi +61 -0
  35. data/rbi/courier/models/workspace_preference_get_response.rbi +107 -0
  36. data/rbi/courier/models/workspace_preference_list_params.rbi +30 -0
  37. data/rbi/courier/models/workspace_preference_list_response.rbi +35 -0
  38. data/rbi/courier/models/workspace_preference_publish_params.rbi +30 -0
  39. data/rbi/courier/models/workspace_preference_replace_params.rbi +38 -0
  40. data/rbi/courier/models/workspace_preference_replace_request.rbi +62 -0
  41. data/rbi/courier/models/workspace_preference_retrieve_params.rbi +38 -0
  42. data/rbi/courier/models/workspace_preference_topic_create_request.rbi +186 -0
  43. data/rbi/courier/models/workspace_preference_topic_get_response.rbi +215 -0
  44. data/rbi/courier/models/workspace_preference_topic_list_response.rbi +36 -0
  45. data/rbi/courier/models/workspace_preference_topic_replace_request.rbi +185 -0
  46. data/rbi/courier/models/workspace_preferences/topic_archive_params.rbi +48 -0
  47. data/rbi/courier/models/workspace_preferences/topic_create_params.rbi +40 -0
  48. data/rbi/courier/models/workspace_preferences/topic_list_params.rbi +40 -0
  49. data/rbi/courier/models/workspace_preferences/topic_replace_params.rbi +48 -0
  50. data/rbi/courier/models/workspace_preferences/topic_retrieve_params.rbi +48 -0
  51. data/rbi/courier/models.rbi +45 -0
  52. data/rbi/courier/resources/notifications/checks.rbi +3 -3
  53. data/rbi/courier/resources/workspace_preferences/topics.rbi +152 -0
  54. data/rbi/courier/resources/workspace_preferences.rbi +113 -0
  55. data/sig/courier/client.rbs +2 -0
  56. data/sig/courier/models/publish_preferences_response.rbs +40 -0
  57. data/sig/courier/models/workspace_preference_archive_params.rbs +23 -0
  58. data/sig/courier/models/workspace_preference_create_params.rbs +15 -0
  59. data/sig/courier/models/workspace_preference_create_request.rbs +30 -0
  60. data/sig/courier/models/workspace_preference_get_response.rbs +60 -0
  61. data/sig/courier/models/workspace_preference_list_params.rbs +15 -0
  62. data/sig/courier/models/workspace_preference_list_response.rbs +18 -0
  63. data/sig/courier/models/workspace_preference_publish_params.rbs +15 -0
  64. data/sig/courier/models/workspace_preference_replace_params.rbs +25 -0
  65. data/sig/courier/models/workspace_preference_replace_request.rbs +30 -0
  66. data/sig/courier/models/workspace_preference_retrieve_params.rbs +23 -0
  67. data/sig/courier/models/workspace_preference_topic_create_request.rbs +68 -0
  68. data/sig/courier/models/workspace_preference_topic_get_response.rbs +93 -0
  69. data/sig/courier/models/workspace_preference_topic_list_response.rbs +18 -0
  70. data/sig/courier/models/workspace_preference_topic_replace_request.rbs +68 -0
  71. data/sig/courier/models/workspace_preferences/topic_archive_params.rbs +30 -0
  72. data/sig/courier/models/workspace_preferences/topic_create_params.rbs +27 -0
  73. data/sig/courier/models/workspace_preferences/topic_list_params.rbs +25 -0
  74. data/sig/courier/models/workspace_preferences/topic_replace_params.rbs +34 -0
  75. data/sig/courier/models/workspace_preferences/topic_retrieve_params.rbs +30 -0
  76. data/sig/courier/models.rbs +32 -0
  77. data/sig/courier/resources/workspace_preferences/topics.rbs +49 -0
  78. data/sig/courier/resources/workspace_preferences.rbs +42 -0
  79. metadata +68 -2
@@ -0,0 +1,186 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class WorkspacePreferenceTopicCreateRequest < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::WorkspacePreferenceTopicCreateRequest,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The default subscription status applied when a recipient has not set their own.
15
+ sig do
16
+ returns(
17
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::OrSymbol
18
+ )
19
+ end
20
+ attr_accessor :default_status
21
+
22
+ # Human-readable name for the preference topic.
23
+ sig { returns(String) }
24
+ attr_accessor :name
25
+
26
+ # Preference controls a recipient may customize for this topic. Defaults to empty
27
+ # if omitted.
28
+ sig do
29
+ returns(
30
+ T.nilable(
31
+ T::Array[
32
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::OrSymbol
33
+ ]
34
+ )
35
+ )
36
+ end
37
+ attr_accessor :allowed_preferences
38
+
39
+ # Whether to include a list-unsubscribe header on emails for this topic.
40
+ sig { returns(T.nilable(T::Boolean)) }
41
+ attr_accessor :include_unsubscribe_header
42
+
43
+ # Default channels delivered for this topic. Defaults to empty if omitted.
44
+ sig do
45
+ returns(T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]))
46
+ end
47
+ attr_accessor :routing_options
48
+
49
+ # Arbitrary metadata associated with the topic.
50
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
51
+ attr_accessor :topic_data
52
+
53
+ # Request body for creating a preference topic.
54
+ sig do
55
+ params(
56
+ default_status:
57
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::OrSymbol,
58
+ name: String,
59
+ allowed_preferences:
60
+ T.nilable(
61
+ T::Array[
62
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::OrSymbol
63
+ ]
64
+ ),
65
+ include_unsubscribe_header: T.nilable(T::Boolean),
66
+ routing_options:
67
+ T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
68
+ topic_data: T.nilable(T::Hash[Symbol, T.anything])
69
+ ).returns(T.attached_class)
70
+ end
71
+ def self.new(
72
+ # The default subscription status applied when a recipient has not set their own.
73
+ default_status:,
74
+ # Human-readable name for the preference topic.
75
+ name:,
76
+ # Preference controls a recipient may customize for this topic. Defaults to empty
77
+ # if omitted.
78
+ allowed_preferences: nil,
79
+ # Whether to include a list-unsubscribe header on emails for this topic.
80
+ include_unsubscribe_header: nil,
81
+ # Default channels delivered for this topic. Defaults to empty if omitted.
82
+ routing_options: nil,
83
+ # Arbitrary metadata associated with the topic.
84
+ topic_data: nil
85
+ )
86
+ end
87
+
88
+ sig do
89
+ override.returns(
90
+ {
91
+ default_status:
92
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::OrSymbol,
93
+ name: String,
94
+ allowed_preferences:
95
+ T.nilable(
96
+ T::Array[
97
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::OrSymbol
98
+ ]
99
+ ),
100
+ include_unsubscribe_header: T.nilable(T::Boolean),
101
+ routing_options:
102
+ T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
103
+ topic_data: T.nilable(T::Hash[Symbol, T.anything])
104
+ }
105
+ )
106
+ end
107
+ def to_hash
108
+ end
109
+
110
+ # The default subscription status applied when a recipient has not set their own.
111
+ module DefaultStatus
112
+ extend Courier::Internal::Type::Enum
113
+
114
+ TaggedSymbol =
115
+ T.type_alias do
116
+ T.all(
117
+ Symbol,
118
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus
119
+ )
120
+ end
121
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
122
+
123
+ OPTED_OUT =
124
+ T.let(
125
+ :OPTED_OUT,
126
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::TaggedSymbol
127
+ )
128
+ OPTED_IN =
129
+ T.let(
130
+ :OPTED_IN,
131
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::TaggedSymbol
132
+ )
133
+ REQUIRED =
134
+ T.let(
135
+ :REQUIRED,
136
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::TaggedSymbol
137
+ )
138
+
139
+ sig do
140
+ override.returns(
141
+ T::Array[
142
+ Courier::WorkspacePreferenceTopicCreateRequest::DefaultStatus::TaggedSymbol
143
+ ]
144
+ )
145
+ end
146
+ def self.values
147
+ end
148
+ end
149
+
150
+ # A preference control a recipient may customize for a topic.
151
+ module AllowedPreference
152
+ extend Courier::Internal::Type::Enum
153
+
154
+ TaggedSymbol =
155
+ T.type_alias do
156
+ T.all(
157
+ Symbol,
158
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference
159
+ )
160
+ end
161
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
162
+
163
+ SNOOZE =
164
+ T.let(
165
+ :snooze,
166
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::TaggedSymbol
167
+ )
168
+ CHANNEL_PREFERENCES =
169
+ T.let(
170
+ :channel_preferences,
171
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::TaggedSymbol
172
+ )
173
+
174
+ sig do
175
+ override.returns(
176
+ T::Array[
177
+ Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::TaggedSymbol
178
+ ]
179
+ )
180
+ end
181
+ def self.values
182
+ end
183
+ end
184
+ end
185
+ end
186
+ end
@@ -0,0 +1,215 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class WorkspacePreferenceTopicGetResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::WorkspacePreferenceTopicGetResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The preference topic id.
15
+ sig { returns(String) }
16
+ attr_accessor :id
17
+
18
+ # Preference controls a recipient may customize. May be empty.
19
+ sig do
20
+ returns(
21
+ T::Array[
22
+ Courier::WorkspacePreferenceTopicGetResponse::AllowedPreference::TaggedSymbol
23
+ ]
24
+ )
25
+ end
26
+ attr_accessor :allowed_preferences
27
+
28
+ # ISO-8601 timestamp of when the topic was created.
29
+ sig { returns(String) }
30
+ attr_accessor :created
31
+
32
+ # The default subscription status applied when a recipient has not set their own.
33
+ sig do
34
+ returns(
35
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus::TaggedSymbol
36
+ )
37
+ end
38
+ attr_accessor :default_status
39
+
40
+ # Whether a list-unsubscribe header is included on emails for this topic.
41
+ sig { returns(T::Boolean) }
42
+ attr_accessor :include_unsubscribe_header
43
+
44
+ # Human-readable name.
45
+ sig { returns(String) }
46
+ attr_accessor :name
47
+
48
+ # Default channels delivered for this topic. May be empty.
49
+ sig { returns(T::Array[Courier::ChannelClassification::TaggedSymbol]) }
50
+ attr_accessor :routing_options
51
+
52
+ # Arbitrary metadata associated with the topic.
53
+ sig { returns(T::Hash[Symbol, T.anything]) }
54
+ attr_accessor :topic_data
55
+
56
+ # ISO-8601 timestamp of the last update.
57
+ sig { returns(String) }
58
+ attr_accessor :updated
59
+
60
+ # Id of the creator.
61
+ sig { returns(T.nilable(String)) }
62
+ attr_accessor :creator
63
+
64
+ # Id of the last updater.
65
+ sig { returns(T.nilable(String)) }
66
+ attr_accessor :updater
67
+
68
+ # A subscription preference topic in your workspace.
69
+ sig do
70
+ params(
71
+ id: String,
72
+ allowed_preferences:
73
+ T::Array[
74
+ Courier::WorkspacePreferenceTopicGetResponse::AllowedPreference::OrSymbol
75
+ ],
76
+ created: String,
77
+ default_status:
78
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus::OrSymbol,
79
+ include_unsubscribe_header: T::Boolean,
80
+ name: String,
81
+ routing_options: T::Array[Courier::ChannelClassification::OrSymbol],
82
+ topic_data: T::Hash[Symbol, T.anything],
83
+ updated: String,
84
+ creator: T.nilable(String),
85
+ updater: T.nilable(String)
86
+ ).returns(T.attached_class)
87
+ end
88
+ def self.new(
89
+ # The preference topic id.
90
+ id:,
91
+ # Preference controls a recipient may customize. May be empty.
92
+ allowed_preferences:,
93
+ # ISO-8601 timestamp of when the topic was created.
94
+ created:,
95
+ # The default subscription status applied when a recipient has not set their own.
96
+ default_status:,
97
+ # Whether a list-unsubscribe header is included on emails for this topic.
98
+ include_unsubscribe_header:,
99
+ # Human-readable name.
100
+ name:,
101
+ # Default channels delivered for this topic. May be empty.
102
+ routing_options:,
103
+ # Arbitrary metadata associated with the topic.
104
+ topic_data:,
105
+ # ISO-8601 timestamp of the last update.
106
+ updated:,
107
+ # Id of the creator.
108
+ creator: nil,
109
+ # Id of the last updater.
110
+ updater: nil
111
+ )
112
+ end
113
+
114
+ sig do
115
+ override.returns(
116
+ {
117
+ id: String,
118
+ allowed_preferences:
119
+ T::Array[
120
+ Courier::WorkspacePreferenceTopicGetResponse::AllowedPreference::TaggedSymbol
121
+ ],
122
+ created: String,
123
+ default_status:
124
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus::TaggedSymbol,
125
+ include_unsubscribe_header: T::Boolean,
126
+ name: String,
127
+ routing_options:
128
+ T::Array[Courier::ChannelClassification::TaggedSymbol],
129
+ topic_data: T::Hash[Symbol, T.anything],
130
+ updated: String,
131
+ creator: T.nilable(String),
132
+ updater: T.nilable(String)
133
+ }
134
+ )
135
+ end
136
+ def to_hash
137
+ end
138
+
139
+ # A preference control a recipient may customize for a topic.
140
+ module AllowedPreference
141
+ extend Courier::Internal::Type::Enum
142
+
143
+ TaggedSymbol =
144
+ T.type_alias do
145
+ T.all(
146
+ Symbol,
147
+ Courier::WorkspacePreferenceTopicGetResponse::AllowedPreference
148
+ )
149
+ end
150
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
151
+
152
+ SNOOZE =
153
+ T.let(
154
+ :snooze,
155
+ Courier::WorkspacePreferenceTopicGetResponse::AllowedPreference::TaggedSymbol
156
+ )
157
+ CHANNEL_PREFERENCES =
158
+ T.let(
159
+ :channel_preferences,
160
+ Courier::WorkspacePreferenceTopicGetResponse::AllowedPreference::TaggedSymbol
161
+ )
162
+
163
+ sig do
164
+ override.returns(
165
+ T::Array[
166
+ Courier::WorkspacePreferenceTopicGetResponse::AllowedPreference::TaggedSymbol
167
+ ]
168
+ )
169
+ end
170
+ def self.values
171
+ end
172
+ end
173
+
174
+ # The default subscription status applied when a recipient has not set their own.
175
+ module DefaultStatus
176
+ extend Courier::Internal::Type::Enum
177
+
178
+ TaggedSymbol =
179
+ T.type_alias do
180
+ T.all(
181
+ Symbol,
182
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus
183
+ )
184
+ end
185
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
186
+
187
+ OPTED_OUT =
188
+ T.let(
189
+ :OPTED_OUT,
190
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus::TaggedSymbol
191
+ )
192
+ OPTED_IN =
193
+ T.let(
194
+ :OPTED_IN,
195
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus::TaggedSymbol
196
+ )
197
+ REQUIRED =
198
+ T.let(
199
+ :REQUIRED,
200
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus::TaggedSymbol
201
+ )
202
+
203
+ sig do
204
+ override.returns(
205
+ T::Array[
206
+ Courier::WorkspacePreferenceTopicGetResponse::DefaultStatus::TaggedSymbol
207
+ ]
208
+ )
209
+ end
210
+ def self.values
211
+ end
212
+ end
213
+ end
214
+ end
215
+ end
@@ -0,0 +1,36 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class WorkspacePreferenceTopicListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::WorkspacePreferenceTopicListResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(T::Array[Courier::WorkspacePreferenceTopicGetResponse]) }
15
+ attr_accessor :results
16
+
17
+ # Topics contained in a workspace preference.
18
+ sig do
19
+ params(
20
+ results:
21
+ T::Array[Courier::WorkspacePreferenceTopicGetResponse::OrHash]
22
+ ).returns(T.attached_class)
23
+ end
24
+ def self.new(results:)
25
+ end
26
+
27
+ sig do
28
+ override.returns(
29
+ { results: T::Array[Courier::WorkspacePreferenceTopicGetResponse] }
30
+ )
31
+ end
32
+ def to_hash
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,185 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class WorkspacePreferenceTopicReplaceRequest < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::WorkspacePreferenceTopicReplaceRequest,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The default subscription status applied when a recipient has not set their own.
15
+ sig do
16
+ returns(
17
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::OrSymbol
18
+ )
19
+ end
20
+ attr_accessor :default_status
21
+
22
+ # Human-readable name for the preference topic.
23
+ sig { returns(String) }
24
+ attr_accessor :name
25
+
26
+ # Preference controls a recipient may customize. Omit to clear.
27
+ sig do
28
+ returns(
29
+ T.nilable(
30
+ T::Array[
31
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
32
+ ]
33
+ )
34
+ )
35
+ end
36
+ attr_accessor :allowed_preferences
37
+
38
+ # Whether to include a list-unsubscribe header on emails for this topic.
39
+ sig { returns(T.nilable(T::Boolean)) }
40
+ attr_accessor :include_unsubscribe_header
41
+
42
+ # Default channels delivered for this topic. Omit to clear.
43
+ sig do
44
+ returns(T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]))
45
+ end
46
+ attr_accessor :routing_options
47
+
48
+ # Arbitrary metadata associated with the topic. Omit to clear.
49
+ sig { returns(T.nilable(T::Hash[Symbol, T.anything])) }
50
+ attr_accessor :topic_data
51
+
52
+ # Request body for replacing a preference topic. Full document replacement;
53
+ # missing optional fields are cleared.
54
+ sig do
55
+ params(
56
+ default_status:
57
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
58
+ name: String,
59
+ allowed_preferences:
60
+ T.nilable(
61
+ T::Array[
62
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
63
+ ]
64
+ ),
65
+ include_unsubscribe_header: T.nilable(T::Boolean),
66
+ routing_options:
67
+ T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
68
+ topic_data: T.nilable(T::Hash[Symbol, T.anything])
69
+ ).returns(T.attached_class)
70
+ end
71
+ def self.new(
72
+ # The default subscription status applied when a recipient has not set their own.
73
+ default_status:,
74
+ # Human-readable name for the preference topic.
75
+ name:,
76
+ # Preference controls a recipient may customize. Omit to clear.
77
+ allowed_preferences: nil,
78
+ # Whether to include a list-unsubscribe header on emails for this topic.
79
+ include_unsubscribe_header: nil,
80
+ # Default channels delivered for this topic. Omit to clear.
81
+ routing_options: nil,
82
+ # Arbitrary metadata associated with the topic. Omit to clear.
83
+ topic_data: nil
84
+ )
85
+ end
86
+
87
+ sig do
88
+ override.returns(
89
+ {
90
+ default_status:
91
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::OrSymbol,
92
+ name: String,
93
+ allowed_preferences:
94
+ T.nilable(
95
+ T::Array[
96
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
97
+ ]
98
+ ),
99
+ include_unsubscribe_header: T.nilable(T::Boolean),
100
+ routing_options:
101
+ T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
102
+ topic_data: T.nilable(T::Hash[Symbol, T.anything])
103
+ }
104
+ )
105
+ end
106
+ def to_hash
107
+ end
108
+
109
+ # The default subscription status applied when a recipient has not set their own.
110
+ module DefaultStatus
111
+ extend Courier::Internal::Type::Enum
112
+
113
+ TaggedSymbol =
114
+ T.type_alias do
115
+ T.all(
116
+ Symbol,
117
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus
118
+ )
119
+ end
120
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
121
+
122
+ OPTED_OUT =
123
+ T.let(
124
+ :OPTED_OUT,
125
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
126
+ )
127
+ OPTED_IN =
128
+ T.let(
129
+ :OPTED_IN,
130
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
131
+ )
132
+ REQUIRED =
133
+ T.let(
134
+ :REQUIRED,
135
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
136
+ )
137
+
138
+ sig do
139
+ override.returns(
140
+ T::Array[
141
+ Courier::WorkspacePreferenceTopicReplaceRequest::DefaultStatus::TaggedSymbol
142
+ ]
143
+ )
144
+ end
145
+ def self.values
146
+ end
147
+ end
148
+
149
+ # A preference control a recipient may customize for a topic.
150
+ module AllowedPreference
151
+ extend Courier::Internal::Type::Enum
152
+
153
+ TaggedSymbol =
154
+ T.type_alias do
155
+ T.all(
156
+ Symbol,
157
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference
158
+ )
159
+ end
160
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
161
+
162
+ SNOOZE =
163
+ T.let(
164
+ :snooze,
165
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
166
+ )
167
+ CHANNEL_PREFERENCES =
168
+ T.let(
169
+ :channel_preferences,
170
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
171
+ )
172
+
173
+ sig do
174
+ override.returns(
175
+ T::Array[
176
+ Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::TaggedSymbol
177
+ ]
178
+ )
179
+ end
180
+ def self.values
181
+ end
182
+ end
183
+ end
184
+ end
185
+ end
@@ -0,0 +1,48 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module WorkspacePreferences
6
+ class TopicArchiveParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::WorkspacePreferences::TopicArchiveParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :section_id
20
+
21
+ sig { returns(String) }
22
+ attr_accessor :topic_id
23
+
24
+ sig do
25
+ params(
26
+ section_id: String,
27
+ topic_id: String,
28
+ request_options: Courier::RequestOptions::OrHash
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(section_id:, topic_id:, request_options: {})
32
+ end
33
+
34
+ sig do
35
+ override.returns(
36
+ {
37
+ section_id: String,
38
+ topic_id: String,
39
+ request_options: Courier::RequestOptions
40
+ }
41
+ )
42
+ end
43
+ def to_hash
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module WorkspacePreferences
6
+ class TopicCreateParams < Courier::Models::WorkspacePreferenceTopicCreateRequest
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::WorkspacePreferences::TopicCreateParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :section_id
20
+
21
+ sig do
22
+ params(
23
+ section_id: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(section_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { section_id: String, request_options: Courier::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end