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