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
@@ -61,6 +61,10 @@ module Courier
61
61
  sig { returns(T.nilable(String)) }
62
62
  attr_accessor :creator
63
63
 
64
+ # Optional description shown under the topic on the hosted preferences page.
65
+ sig { returns(T.nilable(String)) }
66
+ attr_accessor :description
67
+
64
68
  # Id of the last updater.
65
69
  sig { returns(T.nilable(String)) }
66
70
  attr_accessor :updater
@@ -82,6 +86,7 @@ module Courier
82
86
  topic_data: T::Hash[Symbol, T.anything],
83
87
  updated: String,
84
88
  creator: T.nilable(String),
89
+ description: T.nilable(String),
85
90
  updater: T.nilable(String)
86
91
  ).returns(T.attached_class)
87
92
  end
@@ -106,6 +111,8 @@ module Courier
106
111
  updated:,
107
112
  # Id of the creator.
108
113
  creator: nil,
114
+ # Optional description shown under the topic on the hosted preferences page.
115
+ description: nil,
109
116
  # Id of the last updater.
110
117
  updater: nil
111
118
  )
@@ -129,6 +136,7 @@ module Courier
129
136
  topic_data: T::Hash[Symbol, T.anything],
130
137
  updated: String,
131
138
  creator: T.nilable(String),
139
+ description: T.nilable(String),
132
140
  updater: T.nilable(String)
133
141
  }
134
142
  )
@@ -35,6 +35,11 @@ module Courier
35
35
  end
36
36
  attr_accessor :allowed_preferences
37
37
 
38
+ # Optional description shown under the topic on the hosted preferences page. Omit
39
+ # to clear.
40
+ sig { returns(T.nilable(String)) }
41
+ attr_accessor :description
42
+
38
43
  # Whether to include a list-unsubscribe header on emails for this topic.
39
44
  sig { returns(T.nilable(T::Boolean)) }
40
45
  attr_accessor :include_unsubscribe_header
@@ -62,6 +67,7 @@ module Courier
62
67
  Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
63
68
  ]
64
69
  ),
70
+ description: T.nilable(String),
65
71
  include_unsubscribe_header: T.nilable(T::Boolean),
66
72
  routing_options:
67
73
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
@@ -75,6 +81,9 @@ module Courier
75
81
  name:,
76
82
  # Preference controls a recipient may customize. Omit to clear.
77
83
  allowed_preferences: nil,
84
+ # Optional description shown under the topic on the hosted preferences page. Omit
85
+ # to clear.
86
+ description: nil,
78
87
  # Whether to include a list-unsubscribe header on emails for this topic.
79
88
  include_unsubscribe_header: nil,
80
89
  # Default channels delivered for this topic. Omit to clear.
@@ -96,6 +105,7 @@ module Courier
96
105
  Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
97
106
  ]
98
107
  ),
108
+ description: T.nilable(String),
99
109
  include_unsubscribe_header: T.nilable(T::Boolean),
100
110
  routing_options:
101
111
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
@@ -299,6 +299,8 @@ module Courier
299
299
 
300
300
  MessageProvidersType = Courier::Models::MessageProvidersType
301
301
 
302
+ MessageResendParams = Courier::Models::MessageResendParams
303
+
302
304
  MessageRetrieveParams = Courier::Models::MessageRetrieveParams
303
305
 
304
306
  MessageRouting = Courier::Models::MessageRouting
@@ -421,6 +423,8 @@ module Courier
421
423
 
422
424
  ProviderUpdateParams = Courier::Models::ProviderUpdateParams
423
425
 
426
+ PublishPreferencesRequest = Courier::Models::PublishPreferencesRequest
427
+
424
428
  PublishPreferencesResponse = Courier::Models::PublishPreferencesResponse
425
429
 
426
430
  PutSubscriptionsRecipient = Courier::Models::PutSubscriptionsRecipient
@@ -130,6 +130,25 @@ module Courier
130
130
  )
131
131
  end
132
132
 
133
+ # Resend a previously sent message. The original send request is loaded from
134
+ # storage and a brand-new send is enqueued for the same recipient and content,
135
+ # producing a **new** `messageId` — the original message is not modified.
136
+ # Throttled by a per-message rate limit; a repeat inside the limit window returns
137
+ # `429 Too Many Requests`.
138
+ sig do
139
+ params(
140
+ message_id: String,
141
+ request_options: Courier::RequestOptions::OrHash
142
+ ).returns(Courier::Models::MessageResendResponse)
143
+ end
144
+ def resend(
145
+ # A unique identifier representing the message ID of the original message to
146
+ # resend.
147
+ message_id,
148
+ request_options: {}
149
+ )
150
+ end
151
+
133
152
  # @api private
134
153
  sig { params(client: Courier::Client).returns(T.attached_class) }
135
154
  def self.new(client:)
@@ -22,6 +22,89 @@ module Courier
22
22
  )
23
23
  end
24
24
 
25
+ # Replace a user's complete set of preference overrides in a single request. The
26
+ # topics in the request body become the recipient's entire set of overrides:
27
+ # listed topics are created or updated, and every existing override that is not
28
+ # included in the body is reset to its topic default. Submitting an empty `topics`
29
+ # array is a valid clear-all that resets every existing override.
30
+ #
31
+ # This operation is validation-atomic (all-or-nothing): structural validation
32
+ # fails fast with a single `400`, and if any topic is semantically invalid (an
33
+ # unknown topic, a `REQUIRED` topic that cannot be opted out, or a custom routing
34
+ # request that is not available on the workspace's plan) the request returns a
35
+ # single `400` aggregating every failure in `errors` and writes nothing. On
36
+ # success it returns `200` with `items` (the complete resulting override set) and
37
+ # `deleted` (the ids of the overrides that were reset to default).
38
+ #
39
+ # Every `topic_id` in the response — in `items`, `deleted`, and any `errors` — is
40
+ # returned in Courier's canonical topic id form, regardless of the form supplied
41
+ # in the request.
42
+ sig do
43
+ params(
44
+ user_id: String,
45
+ topics:
46
+ T::Array[
47
+ Courier::Users::PreferenceBulkReplaceParams::Topic::OrHash
48
+ ],
49
+ tenant_id: T.nilable(String),
50
+ request_options: Courier::RequestOptions::OrHash
51
+ ).returns(Courier::Models::Users::PreferenceBulkReplaceResponse)
52
+ end
53
+ def bulk_replace(
54
+ # Path param: A unique identifier associated with the user whose preferences you
55
+ # wish to update.
56
+ user_id,
57
+ # Body param: The complete set of topic overrides for the user. Up to 50 topics
58
+ # may be provided. Any existing override not listed here is reset to its topic
59
+ # default; an empty array resets every existing override.
60
+ topics:,
61
+ # Query param: Update the preferences of a user for this specific tenant context.
62
+ tenant_id: nil,
63
+ request_options: {}
64
+ )
65
+ end
66
+
67
+ # Additively create or update a user's preferences for one or more subscription
68
+ # topics in a single request. Only the topics included in the request body are
69
+ # created or updated; any existing overrides for topics not listed are left
70
+ # untouched.
71
+ #
72
+ # Structural validation of the request body fails fast with a single `400`. Beyond
73
+ # that, each topic is processed independently (partial-success, not
74
+ # all-or-nothing): valid topics are written and returned in `items`, while topics
75
+ # that cannot be applied are collected in `errors` with a per-topic `reason` (for
76
+ # example an unknown topic, a `REQUIRED` topic that cannot be opted out, a custom
77
+ # routing request that is not available on the workspace's plan, or a write
78
+ # failure). The request therefore returns `200` with both lists whenever the body
79
+ # is structurally valid.
80
+ #
81
+ # Every `topic_id` in the response — in both `items` and `errors` — is returned in
82
+ # Courier's canonical topic id form, regardless of the form supplied in the
83
+ # request.
84
+ sig do
85
+ params(
86
+ user_id: String,
87
+ topics:
88
+ T::Array[
89
+ Courier::Users::PreferenceBulkUpdateParams::Topic::OrHash
90
+ ],
91
+ tenant_id: T.nilable(String),
92
+ request_options: Courier::RequestOptions::OrHash
93
+ ).returns(Courier::Models::Users::PreferenceBulkUpdateResponse)
94
+ end
95
+ def bulk_update(
96
+ # Path param: A unique identifier associated with the user whose preferences you
97
+ # wish to update.
98
+ user_id,
99
+ # Body param: The topics to create or update. Between 1 and 50 topics may be
100
+ # provided in a single request.
101
+ topics:,
102
+ # Query param: Update the preferences of a user for this specific tenant context.
103
+ tenant_id: nil,
104
+ request_options: {}
105
+ )
106
+ end
107
+
25
108
  # Remove a user's preferences for a specific subscription topic, resetting the
26
109
  # topic to its effective default. This operation is idempotent: deleting a
27
110
  # preference that does not exist succeeds with no error.
@@ -19,6 +19,7 @@ module Courier
19
19
  Courier::WorkspacePreferenceTopicCreateRequest::AllowedPreference::OrSymbol
20
20
  ]
21
21
  ),
22
+ description: T.nilable(String),
22
23
  include_unsubscribe_header: T.nilable(T::Boolean),
23
24
  routing_options:
24
25
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
@@ -36,6 +37,8 @@ module Courier
36
37
  # Preference controls a recipient may customize for this topic. Defaults to empty
37
38
  # if omitted.
38
39
  allowed_preferences: nil,
40
+ # Optional description shown under the topic on the hosted preferences page.
41
+ description: nil,
39
42
  # Whether to include a list-unsubscribe header on emails for this topic.
40
43
  include_unsubscribe_header: nil,
41
44
  # Default channels delivered for this topic. Defaults to empty if omitted.
@@ -112,6 +115,7 @@ module Courier
112
115
  Courier::WorkspacePreferenceTopicReplaceRequest::AllowedPreference::OrSymbol
113
116
  ]
114
117
  ),
118
+ description: T.nilable(String),
115
119
  include_unsubscribe_header: T.nilable(T::Boolean),
116
120
  routing_options:
117
121
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
@@ -131,6 +135,9 @@ module Courier
131
135
  name:,
132
136
  # Body param: Preference controls a recipient may customize. Omit to clear.
133
137
  allowed_preferences: nil,
138
+ # Body param: Optional description shown under the topic on the hosted preferences
139
+ # page. Omit to clear.
140
+ description: nil,
134
141
  # Body param: Whether to include a list-unsubscribe header on emails for this
135
142
  # topic.
136
143
  include_unsubscribe_header: nil,
@@ -12,6 +12,7 @@ module Courier
12
12
  sig do
13
13
  params(
14
14
  name: String,
15
+ description: T.nilable(String),
15
16
  has_custom_routing: T.nilable(T::Boolean),
16
17
  routing_options:
17
18
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
@@ -21,6 +22,8 @@ module Courier
21
22
  def create(
22
23
  # Human-readable name for the workspace preference.
23
24
  name:,
25
+ # Optional description shown under the section on the hosted preferences page.
26
+ description: nil,
24
27
  # Whether the workspace preference defines custom routing for its topics.
25
28
  has_custom_routing: nil,
26
29
  # Default channels for the workspace preference. Defaults to empty if omitted.
@@ -72,11 +75,23 @@ module Courier
72
75
  # preference with its topics under a new published version, making the current
73
76
  # state visible on the hosted preferences page (non-draft).
74
77
  sig do
75
- params(request_options: Courier::RequestOptions::OrHash).returns(
76
- Courier::PublishPreferencesResponse
77
- )
78
+ params(
79
+ brand_id: T.nilable(String),
80
+ description: T.nilable(String),
81
+ heading: T.nilable(String),
82
+ request_options: Courier::RequestOptions::OrHash
83
+ ).returns(Courier::PublishPreferencesResponse)
78
84
  end
79
- def publish(request_options: {})
85
+ def publish(
86
+ # Brand for the hosted page - "default" (workspace default brand), "none" (no
87
+ # brand), or a specific brand id. Defaults to "default".
88
+ brand_id: nil,
89
+ # Description shown under the heading on the hosted preferences page.
90
+ description: nil,
91
+ # Heading shown at the top of the hosted preferences page.
92
+ heading: nil,
93
+ request_options: {}
94
+ )
80
95
  end
81
96
 
82
97
  # Replace a workspace preference. Full document replacement; missing optional
@@ -85,6 +100,7 @@ module Courier
85
100
  params(
86
101
  section_id: String,
87
102
  name: String,
103
+ description: T.nilable(String),
88
104
  has_custom_routing: T.nilable(T::Boolean),
89
105
  routing_options:
90
106
  T.nilable(T::Array[Courier::ChannelClassification::OrSymbol]),
@@ -96,6 +112,9 @@ module Courier
96
112
  section_id,
97
113
  # Human-readable name for the workspace preference.
98
114
  name:,
115
+ # Optional description shown under the section on the hosted preferences page.
116
+ # Omit to clear.
117
+ description: nil,
99
118
  # Whether the workspace preference defines custom routing for its topics.
100
119
  has_custom_routing: nil,
101
120
  # Default channels for the workspace preference. Omit to clear.
@@ -0,0 +1,23 @@
1
+ module Courier
2
+ module Models
3
+ type message_resend_params =
4
+ { message_id: String } & Courier::Internal::Type::request_parameters
5
+
6
+ class MessageResendParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ attr_accessor message_id: String
11
+
12
+ def initialize: (
13
+ message_id: String,
14
+ ?request_options: Courier::request_opts
15
+ ) -> void
16
+
17
+ def to_hash: -> {
18
+ message_id: String,
19
+ request_options: Courier::RequestOptions
20
+ }
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,13 @@
1
+ module Courier
2
+ module Models
3
+ type message_resend_response = { message_id: String }
4
+
5
+ class MessageResendResponse < Courier::Internal::Type::BaseModel
6
+ attr_accessor message_id: String
7
+
8
+ def initialize: (message_id: String) -> void
9
+
10
+ def to_hash: -> { message_id: String }
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,26 @@
1
+ module Courier
2
+ module Models
3
+ type publish_preferences_request =
4
+ { brand_id: String?, description: String?, heading: String? }
5
+
6
+ class PublishPreferencesRequest < Courier::Internal::Type::BaseModel
7
+ attr_accessor brand_id: String?
8
+
9
+ attr_accessor description: String?
10
+
11
+ attr_accessor heading: String?
12
+
13
+ def initialize: (
14
+ ?brand_id: String?,
15
+ ?description: String?,
16
+ ?heading: String?
17
+ ) -> void
18
+
19
+ def to_hash: -> {
20
+ brand_id: String?,
21
+ description: String?,
22
+ heading: String?
23
+ }
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,48 @@
1
+ module Courier
2
+ module Models
3
+ module Users
4
+ type bulk_preference_topic =
5
+ {
6
+ custom_routing: ::Array[Courier::Models::channel_classification],
7
+ has_custom_routing: bool,
8
+ status: Courier::Models::Users::BulkPreferenceTopic::status,
9
+ topic_id: String
10
+ }
11
+
12
+ class BulkPreferenceTopic < Courier::Internal::Type::BaseModel
13
+ attr_accessor custom_routing: ::Array[Courier::Models::channel_classification]
14
+
15
+ attr_accessor has_custom_routing: bool
16
+
17
+ attr_accessor status: Courier::Models::Users::BulkPreferenceTopic::status
18
+
19
+ attr_accessor topic_id: String
20
+
21
+ def initialize: (
22
+ custom_routing: ::Array[Courier::Models::channel_classification],
23
+ has_custom_routing: bool,
24
+ status: Courier::Models::Users::BulkPreferenceTopic::status,
25
+ topic_id: String
26
+ ) -> void
27
+
28
+ def to_hash: -> {
29
+ custom_routing: ::Array[Courier::Models::channel_classification],
30
+ has_custom_routing: bool,
31
+ status: Courier::Models::Users::BulkPreferenceTopic::status,
32
+ topic_id: String
33
+ }
34
+
35
+ type status = :OPTED_IN | :OPTED_OUT
36
+
37
+ module Status
38
+ extend Courier::Internal::Type::Enum
39
+
40
+ OPTED_IN: :OPTED_IN
41
+ OPTED_OUT: :OPTED_OUT
42
+
43
+ def self?.values: -> ::Array[Courier::Models::Users::BulkPreferenceTopic::status]
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,87 @@
1
+ module Courier
2
+ module Models
3
+ module Users
4
+ type preference_bulk_replace_params =
5
+ {
6
+ user_id: String,
7
+ topics: ::Array[Courier::Users::PreferenceBulkReplaceParams::Topic],
8
+ tenant_id: String?
9
+ }
10
+ & Courier::Internal::Type::request_parameters
11
+
12
+ class PreferenceBulkReplaceParams < Courier::Internal::Type::BaseModel
13
+ extend Courier::Internal::Type::RequestParameters::Converter
14
+ include Courier::Internal::Type::RequestParameters
15
+
16
+ attr_accessor user_id: String
17
+
18
+ attr_accessor topics: ::Array[Courier::Users::PreferenceBulkReplaceParams::Topic]
19
+
20
+ attr_accessor tenant_id: String?
21
+
22
+ def initialize: (
23
+ user_id: String,
24
+ topics: ::Array[Courier::Users::PreferenceBulkReplaceParams::Topic],
25
+ ?tenant_id: String?,
26
+ ?request_options: Courier::request_opts
27
+ ) -> void
28
+
29
+ def to_hash: -> {
30
+ user_id: String,
31
+ topics: ::Array[Courier::Users::PreferenceBulkReplaceParams::Topic],
32
+ tenant_id: String?,
33
+ request_options: Courier::RequestOptions
34
+ }
35
+
36
+ type topic =
37
+ {
38
+ status: Courier::Models::Users::PreferenceBulkReplaceParams::Topic::status,
39
+ topic_id: String,
40
+ custom_routing: ::Array[Courier::Models::channel_classification],
41
+ has_custom_routing: bool
42
+ }
43
+
44
+ class Topic < Courier::Internal::Type::BaseModel
45
+ attr_accessor status: Courier::Models::Users::PreferenceBulkReplaceParams::Topic::status
46
+
47
+ attr_accessor topic_id: String
48
+
49
+ attr_reader custom_routing: ::Array[Courier::Models::channel_classification]?
50
+
51
+ def custom_routing=: (
52
+ ::Array[Courier::Models::channel_classification]
53
+ ) -> ::Array[Courier::Models::channel_classification]
54
+
55
+ attr_reader has_custom_routing: bool?
56
+
57
+ def has_custom_routing=: (bool) -> bool
58
+
59
+ def initialize: (
60
+ status: Courier::Models::Users::PreferenceBulkReplaceParams::Topic::status,
61
+ topic_id: String,
62
+ ?custom_routing: ::Array[Courier::Models::channel_classification],
63
+ ?has_custom_routing: bool
64
+ ) -> void
65
+
66
+ def to_hash: -> {
67
+ status: Courier::Models::Users::PreferenceBulkReplaceParams::Topic::status,
68
+ topic_id: String,
69
+ custom_routing: ::Array[Courier::Models::channel_classification],
70
+ has_custom_routing: bool
71
+ }
72
+
73
+ type status = :OPTED_IN | :OPTED_OUT
74
+
75
+ module Status
76
+ extend Courier::Internal::Type::Enum
77
+
78
+ OPTED_IN: :OPTED_IN
79
+ OPTED_OUT: :OPTED_OUT
80
+
81
+ def self?.values: -> ::Array[Courier::Models::Users::PreferenceBulkReplaceParams::Topic::status]
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,27 @@
1
+ module Courier
2
+ module Models
3
+ module Users
4
+ type preference_bulk_replace_response =
5
+ {
6
+ deleted: ::Array[String],
7
+ items: ::Array[Courier::Users::BulkPreferenceTopic]
8
+ }
9
+
10
+ class PreferenceBulkReplaceResponse < Courier::Internal::Type::BaseModel
11
+ attr_accessor deleted: ::Array[String]
12
+
13
+ attr_accessor items: ::Array[Courier::Users::BulkPreferenceTopic]
14
+
15
+ def initialize: (
16
+ deleted: ::Array[String],
17
+ items: ::Array[Courier::Users::BulkPreferenceTopic]
18
+ ) -> void
19
+
20
+ def to_hash: -> {
21
+ deleted: ::Array[String],
22
+ items: ::Array[Courier::Users::BulkPreferenceTopic]
23
+ }
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,87 @@
1
+ module Courier
2
+ module Models
3
+ module Users
4
+ type preference_bulk_update_params =
5
+ {
6
+ user_id: String,
7
+ topics: ::Array[Courier::Users::PreferenceBulkUpdateParams::Topic],
8
+ tenant_id: String?
9
+ }
10
+ & Courier::Internal::Type::request_parameters
11
+
12
+ class PreferenceBulkUpdateParams < Courier::Internal::Type::BaseModel
13
+ extend Courier::Internal::Type::RequestParameters::Converter
14
+ include Courier::Internal::Type::RequestParameters
15
+
16
+ attr_accessor user_id: String
17
+
18
+ attr_accessor topics: ::Array[Courier::Users::PreferenceBulkUpdateParams::Topic]
19
+
20
+ attr_accessor tenant_id: String?
21
+
22
+ def initialize: (
23
+ user_id: String,
24
+ topics: ::Array[Courier::Users::PreferenceBulkUpdateParams::Topic],
25
+ ?tenant_id: String?,
26
+ ?request_options: Courier::request_opts
27
+ ) -> void
28
+
29
+ def to_hash: -> {
30
+ user_id: String,
31
+ topics: ::Array[Courier::Users::PreferenceBulkUpdateParams::Topic],
32
+ tenant_id: String?,
33
+ request_options: Courier::RequestOptions
34
+ }
35
+
36
+ type topic =
37
+ {
38
+ status: Courier::Models::Users::PreferenceBulkUpdateParams::Topic::status,
39
+ topic_id: String,
40
+ custom_routing: ::Array[Courier::Models::channel_classification],
41
+ has_custom_routing: bool
42
+ }
43
+
44
+ class Topic < Courier::Internal::Type::BaseModel
45
+ attr_accessor status: Courier::Models::Users::PreferenceBulkUpdateParams::Topic::status
46
+
47
+ attr_accessor topic_id: String
48
+
49
+ attr_reader custom_routing: ::Array[Courier::Models::channel_classification]?
50
+
51
+ def custom_routing=: (
52
+ ::Array[Courier::Models::channel_classification]
53
+ ) -> ::Array[Courier::Models::channel_classification]
54
+
55
+ attr_reader has_custom_routing: bool?
56
+
57
+ def has_custom_routing=: (bool) -> bool
58
+
59
+ def initialize: (
60
+ status: Courier::Models::Users::PreferenceBulkUpdateParams::Topic::status,
61
+ topic_id: String,
62
+ ?custom_routing: ::Array[Courier::Models::channel_classification],
63
+ ?has_custom_routing: bool
64
+ ) -> void
65
+
66
+ def to_hash: -> {
67
+ status: Courier::Models::Users::PreferenceBulkUpdateParams::Topic::status,
68
+ topic_id: String,
69
+ custom_routing: ::Array[Courier::Models::channel_classification],
70
+ has_custom_routing: bool
71
+ }
72
+
73
+ type status = :OPTED_IN | :OPTED_OUT
74
+
75
+ module Status
76
+ extend Courier::Internal::Type::Enum
77
+
78
+ OPTED_IN: :OPTED_IN
79
+ OPTED_OUT: :OPTED_OUT
80
+
81
+ def self?.values: -> ::Array[Courier::Models::Users::PreferenceBulkUpdateParams::Topic::status]
82
+ end
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
@@ -0,0 +1,39 @@
1
+ module Courier
2
+ module Models
3
+ module Users
4
+ type preference_bulk_update_response =
5
+ {
6
+ errors: ::Array[Courier::Models::Users::PreferenceBulkUpdateResponse::Error],
7
+ items: ::Array[Courier::Users::BulkPreferenceTopic]
8
+ }
9
+
10
+ class PreferenceBulkUpdateResponse < Courier::Internal::Type::BaseModel
11
+ attr_accessor errors: ::Array[Courier::Models::Users::PreferenceBulkUpdateResponse::Error]
12
+
13
+ attr_accessor items: ::Array[Courier::Users::BulkPreferenceTopic]
14
+
15
+ def initialize: (
16
+ errors: ::Array[Courier::Models::Users::PreferenceBulkUpdateResponse::Error],
17
+ items: ::Array[Courier::Users::BulkPreferenceTopic]
18
+ ) -> void
19
+
20
+ def to_hash: -> {
21
+ errors: ::Array[Courier::Models::Users::PreferenceBulkUpdateResponse::Error],
22
+ items: ::Array[Courier::Users::BulkPreferenceTopic]
23
+ }
24
+
25
+ type error = { reason: String, topic_id: String }
26
+
27
+ class Error < Courier::Internal::Type::BaseModel
28
+ attr_accessor reason: String
29
+
30
+ attr_accessor topic_id: String
31
+
32
+ def initialize: (reason: String, topic_id: String) -> void
33
+
34
+ def to_hash: -> { reason: String, topic_id: String }
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end