trycourier 4.18.1 → 4.19.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +17 -0
  3. data/lib/courier/models/message_resend_params.rb +20 -0
  4. data/lib/courier/models/message_resend_response.rb +21 -0
  5. data/lib/courier/models/publish_preferences_request.rb +40 -0
  6. data/lib/courier/models/users/bulk_preference_topic.rb +59 -0
  7. data/lib/courier/models/users/preference_bulk_replace_params.rb +93 -0
  8. data/lib/courier/models/users/preference_bulk_replace_response.rb +27 -0
  9. data/lib/courier/models/users/preference_bulk_update_params.rb +92 -0
  10. data/lib/courier/models/users/preference_bulk_update_response.rb +48 -0
  11. data/lib/courier/models/workspace_preference_create_request.rb +9 -1
  12. data/lib/courier/models/workspace_preference_get_response.rb +9 -1
  13. data/lib/courier/models/workspace_preference_publish_params.rb +1 -1
  14. data/lib/courier/models/workspace_preference_replace_request.rb +13 -1
  15. data/lib/courier/models/workspace_preference_topic_create_request.rb +9 -1
  16. data/lib/courier/models/workspace_preference_topic_get_response.rb +9 -1
  17. data/lib/courier/models/workspace_preference_topic_replace_request.rb +13 -1
  18. data/lib/courier/models.rb +4 -0
  19. data/lib/courier/resources/messages.rb +27 -0
  20. data/lib/courier/resources/users/preferences.rb +96 -0
  21. data/lib/courier/resources/workspace_preferences/topics.rb +6 -2
  22. data/lib/courier/resources/workspace_preferences.rb +22 -4
  23. data/lib/courier/version.rb +1 -1
  24. data/lib/courier.rb +8 -0
  25. data/rbi/courier/models/message_resend_params.rbi +35 -0
  26. data/rbi/courier/models/message_resend_response.rbi +32 -0
  27. data/rbi/courier/models/publish_preferences_request.rbi +58 -0
  28. data/rbi/courier/models/users/bulk_preference_topic.rbi +99 -0
  29. data/rbi/courier/models/users/preference_bulk_replace_params.rbi +188 -0
  30. data/rbi/courier/models/users/preference_bulk_replace_response.rbi +50 -0
  31. data/rbi/courier/models/users/preference_bulk_update_params.rbi +186 -0
  32. data/rbi/courier/models/users/preference_bulk_update_response.rbi +94 -0
  33. data/rbi/courier/models/workspace_preference_create_request.rbi +8 -0
  34. data/rbi/courier/models/workspace_preference_get_response.rbi +8 -0
  35. data/rbi/courier/models/workspace_preference_publish_params.rbi +1 -1
  36. data/rbi/courier/models/workspace_preference_replace_request.rbi +10 -0
  37. data/rbi/courier/models/workspace_preference_topic_create_request.rbi +8 -0
  38. data/rbi/courier/models/workspace_preference_topic_get_response.rbi +8 -0
  39. data/rbi/courier/models/workspace_preference_topic_replace_request.rbi +10 -0
  40. data/rbi/courier/models.rbi +4 -0
  41. data/rbi/courier/resources/messages.rbi +19 -0
  42. data/rbi/courier/resources/users/preferences.rbi +83 -0
  43. data/rbi/courier/resources/workspace_preferences/topics.rbi +7 -0
  44. data/rbi/courier/resources/workspace_preferences.rbi +23 -4
  45. data/sig/courier/models/message_resend_params.rbs +23 -0
  46. data/sig/courier/models/message_resend_response.rbs +13 -0
  47. data/sig/courier/models/publish_preferences_request.rbs +26 -0
  48. data/sig/courier/models/users/bulk_preference_topic.rbs +48 -0
  49. data/sig/courier/models/users/preference_bulk_replace_params.rbs +87 -0
  50. data/sig/courier/models/users/preference_bulk_replace_response.rbs +27 -0
  51. data/sig/courier/models/users/preference_bulk_update_params.rbs +87 -0
  52. data/sig/courier/models/users/preference_bulk_update_response.rbs +39 -0
  53. data/sig/courier/models/workspace_preference_create_request.rbs +5 -0
  54. data/sig/courier/models/workspace_preference_get_response.rbs +5 -0
  55. data/sig/courier/models/workspace_preference_publish_params.rbs +1 -1
  56. data/sig/courier/models/workspace_preference_replace_request.rbs +5 -0
  57. data/sig/courier/models/workspace_preference_topic_create_request.rbs +5 -0
  58. data/sig/courier/models/workspace_preference_topic_get_response.rbs +5 -0
  59. data/sig/courier/models/workspace_preference_topic_replace_request.rbs +5 -0
  60. data/sig/courier/models.rbs +4 -0
  61. data/sig/courier/resources/messages.rbs +5 -0
  62. data/sig/courier/resources/users/preferences.rbs +14 -0
  63. data/sig/courier/resources/workspace_preferences/topics.rbs +2 -0
  64. data/sig/courier/resources/workspace_preferences.rbs +5 -0
  65. metadata +26 -2
@@ -150,6 +150,33 @@ module Courier
150
150
  )
151
151
  end
152
152
 
153
+ # Some parameter documentations has been truncated, see
154
+ # {Courier::Models::MessageResendParams} for more details.
155
+ #
156
+ # Resend a previously sent message. The original send request is loaded from
157
+ # storage and a brand-new send is enqueued for the same recipient and content,
158
+ # producing a **new** `messageId` — the original message is not modified.
159
+ # Throttled by a per-message rate limit; a repeat inside the limit window returns
160
+ # `429 Too Many Requests`.
161
+ #
162
+ # @overload resend(message_id, request_options: {})
163
+ #
164
+ # @param message_id [String] A unique identifier representing the message ID of the original message to resen
165
+ #
166
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
167
+ #
168
+ # @return [Courier::Models::MessageResendResponse]
169
+ #
170
+ # @see Courier::Models::MessageResendParams
171
+ def resend(message_id, params = {})
172
+ @client.request(
173
+ method: :post,
174
+ path: ["messages/%1$s/resend", message_id],
175
+ model: Courier::Models::MessageResendResponse,
176
+ options: params[:request_options]
177
+ )
178
+ end
179
+
153
180
  # @api private
154
181
  #
155
182
  # @param client [Courier::Client]
@@ -32,6 +32,102 @@ module Courier
32
32
  )
33
33
  end
34
34
 
35
+ # Some parameter documentations has been truncated, see
36
+ # {Courier::Models::Users::PreferenceBulkReplaceParams} for more details.
37
+ #
38
+ # Replace a user's complete set of preference overrides in a single request. The
39
+ # topics in the request body become the recipient's entire set of overrides:
40
+ # listed topics are created or updated, and every existing override that is not
41
+ # included in the body is reset to its topic default. Submitting an empty `topics`
42
+ # array is a valid clear-all that resets every existing override.
43
+ #
44
+ # This operation is validation-atomic (all-or-nothing): structural validation
45
+ # fails fast with a single `400`, and if any topic is semantically invalid (an
46
+ # unknown topic, a `REQUIRED` topic that cannot be opted out, or a custom routing
47
+ # request that is not available on the workspace's plan) the request returns a
48
+ # single `400` aggregating every failure in `errors` and writes nothing. On
49
+ # success it returns `200` with `items` (the complete resulting override set) and
50
+ # `deleted` (the ids of the overrides that were reset to default).
51
+ #
52
+ # Every `topic_id` in the response — in `items`, `deleted`, and any `errors` — is
53
+ # returned in Courier's canonical topic id form, regardless of the form supplied
54
+ # in the request.
55
+ #
56
+ # @overload bulk_replace(user_id, topics:, tenant_id: nil, request_options: {})
57
+ #
58
+ # @param user_id [String] Path param: A unique identifier associated with the user whose preferences you w
59
+ #
60
+ # @param topics [Array<Courier::Models::Users::PreferenceBulkReplaceParams::Topic>] Body param: The complete set of topic overrides for the user. Up to 50 topics ma
61
+ #
62
+ # @param tenant_id [String, nil] Query param: Update the preferences of a user for this specific tenant context.
63
+ #
64
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
65
+ #
66
+ # @return [Courier::Models::Users::PreferenceBulkReplaceResponse]
67
+ #
68
+ # @see Courier::Models::Users::PreferenceBulkReplaceParams
69
+ def bulk_replace(user_id, params)
70
+ query_params = [:tenant_id]
71
+ parsed, options = Courier::Users::PreferenceBulkReplaceParams.dump_request(params)
72
+ query = Courier::Internal::Util.encode_query_params(parsed.slice(*query_params))
73
+ @client.request(
74
+ method: :put,
75
+ path: ["users/%1$s/preferences", user_id],
76
+ query: query,
77
+ body: parsed.except(*query_params),
78
+ model: Courier::Models::Users::PreferenceBulkReplaceResponse,
79
+ options: options
80
+ )
81
+ end
82
+
83
+ # Some parameter documentations has been truncated, see
84
+ # {Courier::Models::Users::PreferenceBulkUpdateParams} for more details.
85
+ #
86
+ # Additively create or update a user's preferences for one or more subscription
87
+ # topics in a single request. Only the topics included in the request body are
88
+ # created or updated; any existing overrides for topics not listed are left
89
+ # untouched.
90
+ #
91
+ # Structural validation of the request body fails fast with a single `400`. Beyond
92
+ # that, each topic is processed independently (partial-success, not
93
+ # all-or-nothing): valid topics are written and returned in `items`, while topics
94
+ # that cannot be applied are collected in `errors` with a per-topic `reason` (for
95
+ # example an unknown topic, a `REQUIRED` topic that cannot be opted out, a custom
96
+ # routing request that is not available on the workspace's plan, or a write
97
+ # failure). The request therefore returns `200` with both lists whenever the body
98
+ # is structurally valid.
99
+ #
100
+ # Every `topic_id` in the response — in both `items` and `errors` — is returned in
101
+ # Courier's canonical topic id form, regardless of the form supplied in the
102
+ # request.
103
+ #
104
+ # @overload bulk_update(user_id, topics:, tenant_id: nil, request_options: {})
105
+ #
106
+ # @param user_id [String] Path param: A unique identifier associated with the user whose preferences you w
107
+ #
108
+ # @param topics [Array<Courier::Models::Users::PreferenceBulkUpdateParams::Topic>] Body param: The topics to create or update. Between 1 and 50 topics may be provi
109
+ #
110
+ # @param tenant_id [String, nil] Query param: Update the preferences of a user for this specific tenant context.
111
+ #
112
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
113
+ #
114
+ # @return [Courier::Models::Users::PreferenceBulkUpdateResponse]
115
+ #
116
+ # @see Courier::Models::Users::PreferenceBulkUpdateParams
117
+ def bulk_update(user_id, params)
118
+ query_params = [:tenant_id]
119
+ parsed, options = Courier::Users::PreferenceBulkUpdateParams.dump_request(params)
120
+ query = Courier::Internal::Util.encode_query_params(parsed.slice(*query_params))
121
+ @client.request(
122
+ method: :post,
123
+ path: ["users/%1$s/preferences", user_id],
124
+ query: query,
125
+ body: parsed.except(*query_params),
126
+ model: Courier::Models::Users::PreferenceBulkUpdateResponse,
127
+ options: options
128
+ )
129
+ end
130
+
35
131
  # Some parameter documentations has been truncated, see
36
132
  # {Courier::Models::Users::PreferenceDeleteTopicParams} for more details.
37
133
  #
@@ -11,7 +11,7 @@ module Courier
11
11
  # 404 if the workspace preference does not exist. The topic id is generated and
12
12
  # returned.
13
13
  #
14
- # @overload create(section_id, default_status:, name:, allowed_preferences: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, request_options: {})
14
+ # @overload create(section_id, default_status:, name:, allowed_preferences: nil, description: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, request_options: {})
15
15
  #
16
16
  # @param section_id [String] Id of the workspace preference to create the topic in.
17
17
  #
@@ -21,6 +21,8 @@ module Courier
21
21
  #
22
22
  # @param allowed_preferences [Array<Symbol, Courier::Models::WorkspacePreferenceTopicCreateRequest::AllowedPreference>, nil] Preference controls a recipient may customize for this topic. Defaults to empty
23
23
  #
24
+ # @param description [String, nil] Optional description shown under the topic on the hosted preferences page.
25
+ #
24
26
  # @param include_unsubscribe_header [Boolean, nil] Whether to include a list-unsubscribe header on emails for this topic.
25
27
  #
26
28
  # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels delivered for this topic. Defaults to empty if omitted.
@@ -126,7 +128,7 @@ module Courier
126
128
  # Replace a topic within a workspace preference. Full document replacement;
127
129
  # missing optional fields are cleared. Same 404 rules as GET.
128
130
  #
129
- # @overload replace(topic_id, section_id:, default_status:, name:, allowed_preferences: nil, include_unsubscribe_header: nil, routing_options: nil, topic_data: nil, request_options: {})
131
+ # @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: {})
130
132
  #
131
133
  # @param topic_id [String] Path param: Id of the subscription preference topic.
132
134
  #
@@ -138,6 +140,8 @@ module Courier
138
140
  #
139
141
  # @param allowed_preferences [Array<Symbol, Courier::Models::WorkspacePreferenceTopicReplaceRequest::AllowedPreference>, nil] Body param: Preference controls a recipient may customize. Omit to clear.
140
142
  #
143
+ # @param description [String, nil] Body param: Optional description shown under the topic on the hosted preferences
144
+ #
141
145
  # @param include_unsubscribe_header [Boolean, nil] Body param: Whether to include a list-unsubscribe header on emails for this topi
142
146
  #
143
147
  # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Body param: Default channels delivered for this topic. Omit to clear.
@@ -10,10 +10,12 @@ module Courier
10
10
  # returned. Topics are created inside a workspace preference via POST
11
11
  # /preferences/sections/{section_id}/topics.
12
12
  #
13
- # @overload create(name:, has_custom_routing: nil, routing_options: nil, request_options: {})
13
+ # @overload create(name:, description: nil, has_custom_routing: nil, routing_options: nil, request_options: {})
14
14
  #
15
15
  # @param name [String] Human-readable name for the workspace preference.
16
16
  #
17
+ # @param description [String, nil] Optional description shown under the section on the hosted preferences page.
18
+ #
17
19
  # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
18
20
  #
19
21
  # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Defaults to empty if omitted.
@@ -94,11 +96,20 @@ module Courier
94
96
  )
95
97
  end
96
98
 
99
+ # Some parameter documentations has been truncated, see
100
+ # {Courier::Models::WorkspacePreferencePublishParams} for more details.
101
+ #
97
102
  # Publish the workspace's preferences page. Takes a snapshot of every workspace
98
103
  # preference with its topics under a new published version, making the current
99
104
  # state visible on the hosted preferences page (non-draft).
100
105
  #
101
- # @overload publish(request_options: {})
106
+ # @overload publish(brand_id: nil, description: nil, heading: nil, request_options: {})
107
+ #
108
+ # @param brand_id [String, nil] Brand for the hosted page - "default" (workspace default brand), "none" (no bran
109
+ #
110
+ # @param description [String, nil] Description shown under the heading on the hosted preferences page.
111
+ #
112
+ # @param heading [String, nil] Heading shown at the top of the hosted preferences page.
102
113
  #
103
114
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
104
115
  #
@@ -106,23 +117,30 @@ module Courier
106
117
  #
107
118
  # @see Courier::Models::WorkspacePreferencePublishParams
108
119
  def publish(params = {})
120
+ parsed, options = Courier::WorkspacePreferencePublishParams.dump_request(params)
109
121
  @client.request(
110
122
  method: :post,
111
123
  path: "preferences/publish",
124
+ body: parsed,
112
125
  model: Courier::PublishPreferencesResponse,
113
- options: params[:request_options]
126
+ options: options
114
127
  )
115
128
  end
116
129
 
130
+ # Some parameter documentations has been truncated, see
131
+ # {Courier::Models::WorkspacePreferenceReplaceParams} for more details.
132
+ #
117
133
  # Replace a workspace preference. Full document replacement; missing optional
118
134
  # fields are cleared. Topics attached to the workspace preference are unaffected.
119
135
  #
120
- # @overload replace(section_id, name:, has_custom_routing: nil, routing_options: nil, request_options: {})
136
+ # @overload replace(section_id, name:, description: nil, has_custom_routing: nil, routing_options: nil, request_options: {})
121
137
  #
122
138
  # @param section_id [String] Id of the workspace preference.
123
139
  #
124
140
  # @param name [String] Human-readable name for the workspace preference.
125
141
  #
142
+ # @param description [String, nil] Optional description shown under the section on the hosted preferences page. Omi
143
+ #
126
144
  # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
127
145
  #
128
146
  # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Omit to clear.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.18.1"
4
+ VERSION = "4.19.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -80,6 +80,7 @@ require_relative "courier/models/post_tenant_template_publish_request"
80
80
  require_relative "courier/models/put_tenant_template_request"
81
81
  require_relative "courier/models/users/user_token"
82
82
  require_relative "courier/models/workspace_preference_create_request"
83
+ require_relative "courier/models/publish_preferences_request"
83
84
  require_relative "courier/models/workspace_preference_replace_request"
84
85
  require_relative "courier/models/workspace_preference_topic_create_request"
85
86
  require_relative "courier/models/workspace_preference_topic_replace_request"
@@ -244,6 +245,8 @@ require_relative "courier/models/message_list_params"
244
245
  require_relative "courier/models/message_list_response"
245
246
  require_relative "courier/models/message_providers"
246
247
  require_relative "courier/models/message_providers_type"
248
+ require_relative "courier/models/message_resend_params"
249
+ require_relative "courier/models/message_resend_response"
247
250
  require_relative "courier/models/message_retrieve_params"
248
251
  require_relative "courier/models/message_retrieve_response"
249
252
  require_relative "courier/models/message_routing"
@@ -369,6 +372,11 @@ require_relative "courier/models/translation_update_params"
369
372
  require_relative "courier/models/user_profile"
370
373
  require_relative "courier/models/user_profile_firebase_token"
371
374
  require_relative "courier/models/user_recipient"
375
+ require_relative "courier/models/users/bulk_preference_topic"
376
+ require_relative "courier/models/users/preference_bulk_replace_params"
377
+ require_relative "courier/models/users/preference_bulk_replace_response"
378
+ require_relative "courier/models/users/preference_bulk_update_params"
379
+ require_relative "courier/models/users/preference_bulk_update_response"
372
380
  require_relative "courier/models/users/preference_delete_topic_params"
373
381
  require_relative "courier/models/users/preference_retrieve_params"
374
382
  require_relative "courier/models/users/preference_retrieve_response"
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class MessageResendParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::MessageResendParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :message_id
16
+
17
+ sig do
18
+ params(
19
+ message_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(message_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { message_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,32 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class MessageResendResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::Models::MessageResendResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ # The new message id for the resent message. It is distinct from the id of the
15
+ # original message that was resent.
16
+ sig { returns(String) }
17
+ attr_accessor :message_id
18
+
19
+ sig { params(message_id: String).returns(T.attached_class) }
20
+ def self.new(
21
+ # The new message id for the resent message. It is distinct from the id of the
22
+ # original message that was resent.
23
+ message_id:
24
+ )
25
+ end
26
+
27
+ sig { override.returns({ message_id: String }) }
28
+ def to_hash
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,58 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class PublishPreferencesRequest < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::PublishPreferencesRequest, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # Brand for the hosted page - "default" (workspace default brand), "none" (no
12
+ # brand), or a specific brand id. Defaults to "default".
13
+ sig { returns(T.nilable(String)) }
14
+ attr_accessor :brand_id
15
+
16
+ # Description shown under the heading on the hosted preferences page.
17
+ sig { returns(T.nilable(String)) }
18
+ attr_accessor :description
19
+
20
+ # Heading shown at the top of the hosted preferences page.
21
+ sig { returns(T.nilable(String)) }
22
+ attr_accessor :heading
23
+
24
+ # Optional page metadata to apply when publishing the workspace's preferences
25
+ # page. All fields are optional; omitted fields fall back to the page defaults
26
+ # (and the workspace default brand).
27
+ sig do
28
+ params(
29
+ brand_id: T.nilable(String),
30
+ description: T.nilable(String),
31
+ heading: T.nilable(String)
32
+ ).returns(T.attached_class)
33
+ end
34
+ def self.new(
35
+ # Brand for the hosted page - "default" (workspace default brand), "none" (no
36
+ # brand), or a specific brand id. Defaults to "default".
37
+ brand_id: nil,
38
+ # Description shown under the heading on the hosted preferences page.
39
+ description: nil,
40
+ # Heading shown at the top of the hosted preferences page.
41
+ heading: nil
42
+ )
43
+ end
44
+
45
+ sig do
46
+ override.returns(
47
+ {
48
+ brand_id: T.nilable(String),
49
+ description: T.nilable(String),
50
+ heading: T.nilable(String)
51
+ }
52
+ )
53
+ end
54
+ def to_hash
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,99 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Users
6
+ class BulkPreferenceTopic < Courier::Internal::Type::BaseModel
7
+ OrHash =
8
+ T.type_alias do
9
+ T.any(
10
+ Courier::Users::BulkPreferenceTopic,
11
+ Courier::Internal::AnyHash
12
+ )
13
+ end
14
+
15
+ sig { returns(T::Array[Courier::ChannelClassification::TaggedSymbol]) }
16
+ attr_accessor :custom_routing
17
+
18
+ sig { returns(T::Boolean) }
19
+ attr_accessor :has_custom_routing
20
+
21
+ # The applied subscription status. Echoes the requested value, so it is always
22
+ # OPTED_IN or OPTED_OUT.
23
+ sig do
24
+ returns(Courier::Users::BulkPreferenceTopic::Status::TaggedSymbol)
25
+ end
26
+ attr_accessor :status
27
+
28
+ sig { returns(String) }
29
+ attr_accessor :topic_id
30
+
31
+ # A single topic override echoed in a bulk preference response.
32
+ sig do
33
+ params(
34
+ custom_routing: T::Array[Courier::ChannelClassification::OrSymbol],
35
+ has_custom_routing: T::Boolean,
36
+ status: Courier::Users::BulkPreferenceTopic::Status::OrSymbol,
37
+ topic_id: String
38
+ ).returns(T.attached_class)
39
+ end
40
+ def self.new(
41
+ custom_routing:,
42
+ has_custom_routing:,
43
+ # The applied subscription status. Echoes the requested value, so it is always
44
+ # OPTED_IN or OPTED_OUT.
45
+ status:,
46
+ topic_id:
47
+ )
48
+ end
49
+
50
+ sig do
51
+ override.returns(
52
+ {
53
+ custom_routing:
54
+ T::Array[Courier::ChannelClassification::TaggedSymbol],
55
+ has_custom_routing: T::Boolean,
56
+ status: Courier::Users::BulkPreferenceTopic::Status::TaggedSymbol,
57
+ topic_id: String
58
+ }
59
+ )
60
+ end
61
+ def to_hash
62
+ end
63
+
64
+ # The applied subscription status. Echoes the requested value, so it is always
65
+ # OPTED_IN or OPTED_OUT.
66
+ module Status
67
+ extend Courier::Internal::Type::Enum
68
+
69
+ TaggedSymbol =
70
+ T.type_alias do
71
+ T.all(Symbol, Courier::Users::BulkPreferenceTopic::Status)
72
+ end
73
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
74
+
75
+ OPTED_IN =
76
+ T.let(
77
+ :OPTED_IN,
78
+ Courier::Users::BulkPreferenceTopic::Status::TaggedSymbol
79
+ )
80
+ OPTED_OUT =
81
+ T.let(
82
+ :OPTED_OUT,
83
+ Courier::Users::BulkPreferenceTopic::Status::TaggedSymbol
84
+ )
85
+
86
+ sig do
87
+ override.returns(
88
+ T::Array[
89
+ Courier::Users::BulkPreferenceTopic::Status::TaggedSymbol
90
+ ]
91
+ )
92
+ end
93
+ def self.values
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end