trycourier 4.25.0 → 4.26.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/README.md +16 -19
  4. data/lib/courier/client.rb +4 -0
  5. data/lib/courier/models/bulk_add_users_params.rb +26 -0
  6. data/lib/courier/models/bulk_create_job_params.rb +29 -0
  7. data/lib/courier/models/bulk_create_job_response.rb +16 -0
  8. data/lib/courier/models/bulk_list_users_params.rb +33 -0
  9. data/lib/courier/models/bulk_list_users_response.rb +49 -0
  10. data/lib/courier/models/bulk_retrieve_job_params.rb +20 -0
  11. data/lib/courier/models/bulk_retrieve_job_response.rb +76 -0
  12. data/lib/courier/models/bulk_run_job_params.rb +20 -0
  13. data/lib/courier/models/inbound_bulk_message.rb +91 -0
  14. data/lib/courier/models/inbound_bulk_message_user.rb +54 -0
  15. data/lib/courier/models/notification_template_alias.rb +24 -0
  16. data/lib/courier/models/notification_template_create_request.rb +5 -5
  17. data/lib/courier/models/notification_template_response.rb +16 -1
  18. data/lib/courier/models/notification_template_update_request.rb +7 -6
  19. data/lib/courier/models/notification_template_write_payload.rb +28 -0
  20. data/lib/courier/models.rb +18 -0
  21. data/lib/courier/resources/bulk.rb +141 -0
  22. data/lib/courier/resources/notifications.rb +2 -2
  23. data/lib/courier/resources/send.rb +2 -1
  24. data/lib/courier/version.rb +1 -1
  25. data/lib/courier.rb +13 -0
  26. data/rbi/courier/client.rbi +3 -0
  27. data/rbi/courier/models/bulk_add_users_params.rbi +43 -0
  28. data/rbi/courier/models/bulk_create_job_params.rbi +54 -0
  29. data/rbi/courier/models/bulk_create_job_response.rbi +26 -0
  30. data/rbi/courier/models/bulk_list_users_params.rbi +51 -0
  31. data/rbi/courier/models/bulk_list_users_response.rbi +125 -0
  32. data/rbi/courier/models/bulk_retrieve_job_params.rbi +35 -0
  33. data/rbi/courier/models/bulk_retrieve_job_response.rbi +157 -0
  34. data/rbi/courier/models/bulk_run_job_params.rbi +35 -0
  35. data/rbi/courier/models/inbound_bulk_message.rbi +124 -0
  36. data/rbi/courier/models/inbound_bulk_message_user.rbi +88 -0
  37. data/rbi/courier/models/notification_template_alias.rbi +28 -0
  38. data/rbi/courier/models/notification_template_create_request.rbi +10 -8
  39. data/rbi/courier/models/notification_template_response.rbi +19 -0
  40. data/rbi/courier/models/notification_template_update_request.rbi +12 -9
  41. data/rbi/courier/models/notification_template_write_payload.rbi +44 -0
  42. data/rbi/courier/models.rbi +19 -0
  43. data/rbi/courier/resources/bulk.rbi +102 -0
  44. data/rbi/courier/resources/notifications.rbi +6 -6
  45. data/rbi/courier/resources/send.rbi +2 -1
  46. data/sig/courier/client.rbs +2 -0
  47. data/sig/courier/models/bulk_add_users_params.rbs +28 -0
  48. data/sig/courier/models/bulk_create_job_params.rbs +24 -0
  49. data/sig/courier/models/bulk_create_job_response.rbs +13 -0
  50. data/sig/courier/models/bulk_list_users_params.rbs +28 -0
  51. data/sig/courier/models/bulk_list_users_response.rbs +65 -0
  52. data/sig/courier/models/bulk_retrieve_job_params.rbs +23 -0
  53. data/sig/courier/models/bulk_retrieve_job_response.rbs +66 -0
  54. data/sig/courier/models/bulk_run_job_params.rbs +23 -0
  55. data/sig/courier/models/inbound_bulk_message.rbs +58 -0
  56. data/sig/courier/models/inbound_bulk_message_user.rbs +42 -0
  57. data/sig/courier/models/notification_template_alias.rbs +13 -0
  58. data/sig/courier/models/notification_template_create_request.rbs +4 -4
  59. data/sig/courier/models/notification_template_response.rbs +9 -0
  60. data/sig/courier/models/notification_template_update_request.rbs +4 -4
  61. data/sig/courier/models/notification_template_write_payload.rbs +15 -0
  62. data/sig/courier/models.rbs +18 -0
  63. data/sig/courier/resources/bulk.rbs +34 -0
  64. data/sig/courier/resources/notifications.rbs +2 -2
  65. metadata +41 -2
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateWritePayload < Courier::Models::NotificationTemplatePayload
6
+ # @!attribute alias_
7
+ # Send-time alias for this template — the value you pass as `event` to POST /send.
8
+ # Writes accept a single alias only. Optional, with three distinct meanings. Omit
9
+ # it to leave any existing aliases untouched. Send a string to make this the
10
+ # template's only alias — a template that already resolved from several aliases
11
+ # keeps just this one and the rest are detached. Send null to remove every alias
12
+ # from the template. An alias may not be claimed by another template — doing so
13
+ # returns 409 — and may not begin with "tenant/".
14
+ #
15
+ # @return [String, nil]
16
+ optional :alias_, String, api_name: :alias, nil?: true
17
+
18
+ # @!method initialize(alias_: nil)
19
+ # Some parameter documentations has been truncated, see
20
+ # {Courier::Models::NotificationTemplateWritePayload} for more details.
21
+ #
22
+ # Template fields accepted in POST and PUT request bodies, nested under a
23
+ # `notification` key.
24
+ #
25
+ # @param alias_ [String, nil] Send-time alias for this template — the value you pass as `event` to POST /send.
26
+ end
27
+ end
28
+ end
@@ -141,6 +141,16 @@ module Courier
141
141
 
142
142
  BroadcastUpdateParams = Courier::Models::BroadcastUpdateParams
143
143
 
144
+ BulkAddUsersParams = Courier::Models::BulkAddUsersParams
145
+
146
+ BulkCreateJobParams = Courier::Models::BulkCreateJobParams
147
+
148
+ BulkListUsersParams = Courier::Models::BulkListUsersParams
149
+
150
+ BulkRetrieveJobParams = Courier::Models::BulkRetrieveJobParams
151
+
152
+ BulkRunJobParams = Courier::Models::BulkRunJobParams
153
+
144
154
  CancelJourneyRequest = Courier::Models::CancelJourneyRequest
145
155
 
146
156
  CancelJourneyResponse = Courier::Models::CancelJourneyResponse
@@ -213,6 +223,10 @@ module Courier
213
223
 
214
224
  Icons = Courier::Models::Icons
215
225
 
226
+ InboundBulkMessage = Courier::Models::InboundBulkMessage
227
+
228
+ InboundBulkMessageUser = Courier::Models::InboundBulkMessageUser
229
+
216
230
  InboundTrackEventParams = Courier::Models::InboundTrackEventParams
217
231
 
218
232
  Intercom = Courier::Models::Intercom
@@ -406,6 +420,8 @@ module Courier
406
420
 
407
421
  Notifications = Courier::Models::Notifications
408
422
 
423
+ NotificationTemplateAlias = Courier::Models::NotificationTemplateAlias
424
+
409
425
  NotificationTemplateCreateRequest = Courier::Models::NotificationTemplateCreateRequest
410
426
 
411
427
  NotificationTemplatePayload = Courier::Models::NotificationTemplatePayload
@@ -422,6 +438,8 @@ module Courier
422
438
 
423
439
  NotificationTemplateVersionListResponse = Courier::Models::NotificationTemplateVersionListResponse
424
440
 
441
+ NotificationTemplateWritePayload = Courier::Models::NotificationTemplateWritePayload
442
+
425
443
  Pagerduty = Courier::Models::Pagerduty
426
444
 
427
445
  PagerdutyRecipient = Courier::Models::PagerdutyRecipient
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Resources
5
+ class Bulk
6
+ # Ingest user data into a Bulk Job.
7
+ #
8
+ # **Important**: For email-based bulk jobs, each user must include `profile.email`
9
+ # for provider routing to work correctly. The `to.email` field is not sufficient
10
+ # for email provider routing.
11
+ #
12
+ # @overload add_users(job_id, users:, request_options: {})
13
+ #
14
+ # @param job_id [String] A unique identifier representing the bulk job
15
+ #
16
+ # @param users [Array<Courier::Models::InboundBulkMessageUser>]
17
+ #
18
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
19
+ #
20
+ # @return [nil]
21
+ #
22
+ # @see Courier::Models::BulkAddUsersParams
23
+ def add_users(job_id, params)
24
+ parsed, options = Courier::BulkAddUsersParams.dump_request(params)
25
+ @client.request(
26
+ method: :post,
27
+ path: ["bulk/%1$s", job_id],
28
+ body: parsed,
29
+ model: NilClass,
30
+ options: options
31
+ )
32
+ end
33
+
34
+ # Some parameter documentations has been truncated, see
35
+ # {Courier::Models::BulkCreateJobParams} for more details.
36
+ #
37
+ # Creates a new bulk job for sending messages to multiple recipients.
38
+ #
39
+ # **Required**: `message.event` (event ID or notification ID)
40
+ #
41
+ # **Optional (V2 format)**: `message.template` (notification ID) or
42
+ # `message.content` (Elemental content) can be provided to override the
43
+ # notification associated with the event.
44
+ #
45
+ # @overload create_job(message:, request_options: {})
46
+ #
47
+ # @param message [Courier::Models::InboundBulkMessage] Bulk message definition. Supports two formats:
48
+ #
49
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
50
+ #
51
+ # @return [Courier::Models::BulkCreateJobResponse]
52
+ #
53
+ # @see Courier::Models::BulkCreateJobParams
54
+ def create_job(params)
55
+ parsed, options = Courier::BulkCreateJobParams.dump_request(params)
56
+ @client.request(
57
+ method: :post,
58
+ path: "bulk",
59
+ body: parsed,
60
+ model: Courier::Models::BulkCreateJobResponse,
61
+ options: options
62
+ )
63
+ end
64
+
65
+ # Some parameter documentations has been truncated, see
66
+ # {Courier::Models::BulkListUsersParams} for more details.
67
+ #
68
+ # Get Bulk Job Users
69
+ #
70
+ # @overload list_users(job_id, cursor: nil, request_options: {})
71
+ #
72
+ # @param job_id [String] A unique identifier representing the bulk job
73
+ #
74
+ # @param cursor [String, nil] A unique identifier that allows for fetching the next set of users added to the
75
+ #
76
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
77
+ #
78
+ # @return [Courier::Models::BulkListUsersResponse]
79
+ #
80
+ # @see Courier::Models::BulkListUsersParams
81
+ def list_users(job_id, params = {})
82
+ parsed, options = Courier::BulkListUsersParams.dump_request(params)
83
+ query = Courier::Internal::Util.encode_query_params(parsed)
84
+ @client.request(
85
+ method: :get,
86
+ path: ["bulk/%1$s/users", job_id],
87
+ query: query,
88
+ model: Courier::Models::BulkListUsersResponse,
89
+ options: options
90
+ )
91
+ end
92
+
93
+ # Get a bulk job
94
+ #
95
+ # @overload retrieve_job(job_id, request_options: {})
96
+ #
97
+ # @param job_id [String] A unique identifier representing the bulk job
98
+ #
99
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
100
+ #
101
+ # @return [Courier::Models::BulkRetrieveJobResponse]
102
+ #
103
+ # @see Courier::Models::BulkRetrieveJobParams
104
+ def retrieve_job(job_id, params = {})
105
+ @client.request(
106
+ method: :get,
107
+ path: ["bulk/%1$s", job_id],
108
+ model: Courier::Models::BulkRetrieveJobResponse,
109
+ options: params[:request_options]
110
+ )
111
+ end
112
+
113
+ # Run a bulk job
114
+ #
115
+ # @overload run_job(job_id, request_options: {})
116
+ #
117
+ # @param job_id [String] A unique identifier representing the bulk job
118
+ #
119
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
120
+ #
121
+ # @return [nil]
122
+ #
123
+ # @see Courier::Models::BulkRunJobParams
124
+ def run_job(job_id, params = {})
125
+ @client.request(
126
+ method: :post,
127
+ path: ["bulk/%1$s/run", job_id],
128
+ model: NilClass,
129
+ options: params[:request_options]
130
+ )
131
+ end
132
+
133
+ # @api private
134
+ #
135
+ # @param client [Courier::Client]
136
+ def initialize(client:)
137
+ @client = client
138
+ end
139
+ end
140
+ end
141
+ end
@@ -18,7 +18,7 @@ module Courier
18
18
  #
19
19
  # @overload create(notification:, state: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
20
20
  #
21
- # @param notification [Courier::Models::NotificationTemplatePayload] Body param: Core template fields used in POST and PUT request bodies (nested und
21
+ # @param notification [Courier::Models::NotificationTemplateWritePayload] Body param: Template fields accepted in POST and PUT request bodies, nested unde
22
22
  #
23
23
  # @param state [Symbol, Courier::Models::NotificationTemplateCreateRequest::State] Body param: Template state after creation. Case-insensitive input, normalized to
24
24
  #
@@ -321,7 +321,7 @@ module Courier
321
321
  #
322
322
  # @param id [String] Template ID (nt\_ prefix).
323
323
  #
324
- # @param notification [Courier::Models::NotificationTemplatePayload] Core template fields used in POST and PUT request bodies (nested under a `notifi
324
+ # @param notification [Courier::Models::NotificationTemplateWritePayload] Template fields accepted in POST and PUT request bodies, nested under a `notific
325
325
  #
326
326
  # @param state [Symbol, Courier::Models::NotificationTemplateUpdateRequest::State] Template state after update. Case-insensitive input, normalized to uppercase in
327
327
  #
@@ -9,7 +9,8 @@ module Courier
9
9
  # {Courier::Models::SendMessageParams} for more details.
10
10
  #
11
11
  # Sends a message to one or more recipients and returns a requestId. Courier
12
- # routes it to email, SMS, push, chat, or in-app based on your rules.
12
+ # routes it to email, SMS, push, chat, or in-app based on your rules. Use the
13
+ # returned requestId to look up delivery status via the Messages API.
13
14
  #
14
15
  # @overload message(message:, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
15
16
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.25.0"
4
+ VERSION = "4.26.1"
5
5
  end
data/lib/courier.rb CHANGED
@@ -59,6 +59,7 @@ require_relative "courier/models/notification_content_put_request"
59
59
  require_relative "courier/models/schedule_broadcast_request"
60
60
  require_relative "courier/models/send_broadcast_request"
61
61
  require_relative "courier/models/update_broadcast_request"
62
+ require_relative "courier/models/inbound_bulk_message_user"
62
63
  require_relative "courier/models/base_check"
63
64
  require_relative "courier/models/subscription_topic_new"
64
65
  require_relative "courier/models/elemental_channel_node"
@@ -142,6 +143,14 @@ require_relative "courier/models/broadcast_schedule"
142
143
  require_relative "courier/models/broadcast_schedule_params"
143
144
  require_relative "courier/models/broadcast_send_params"
144
145
  require_relative "courier/models/broadcast_update_params"
146
+ require_relative "courier/models/bulk_add_users_params"
147
+ require_relative "courier/models/bulk_create_job_params"
148
+ require_relative "courier/models/bulk_create_job_response"
149
+ require_relative "courier/models/bulk_list_users_params"
150
+ require_relative "courier/models/bulk_list_users_response"
151
+ require_relative "courier/models/bulk_retrieve_job_params"
152
+ require_relative "courier/models/bulk_retrieve_job_response"
153
+ require_relative "courier/models/bulk_run_job_params"
145
154
  require_relative "courier/models/cancel_journey_response"
146
155
  require_relative "courier/models/channel"
147
156
  require_relative "courier/models/channel_classification"
@@ -174,6 +183,7 @@ require_relative "courier/models/email_header"
174
183
  require_relative "courier/models/expo"
175
184
  require_relative "courier/models/filter_config"
176
185
  require_relative "courier/models/icons"
186
+ require_relative "courier/models/inbound_bulk_message"
177
187
  require_relative "courier/models/inbound_track_event_params"
178
188
  require_relative "courier/models/inbound_track_event_response"
179
189
  require_relative "courier/models/intercom"
@@ -287,10 +297,12 @@ require_relative "courier/models/notifications/check_list_params"
287
297
  require_relative "courier/models/notifications/check_list_response"
288
298
  require_relative "courier/models/notifications/check_update_params"
289
299
  require_relative "courier/models/notifications/check_update_response"
300
+ require_relative "courier/models/notification_template_alias"
290
301
  require_relative "courier/models/notification_template_response"
291
302
  require_relative "courier/models/notification_template_state"
292
303
  require_relative "courier/models/notification_template_summary"
293
304
  require_relative "courier/models/notification_template_version_list_response"
305
+ require_relative "courier/models/notification_template_write_payload"
294
306
  require_relative "courier/models/pagerduty"
295
307
  require_relative "courier/models/pagerduty_recipient"
296
308
  require_relative "courier/models/paging"
@@ -440,6 +452,7 @@ require_relative "courier/resources/automations"
440
452
  require_relative "courier/resources/automations/invoke"
441
453
  require_relative "courier/resources/brands"
442
454
  require_relative "courier/resources/broadcasts"
455
+ require_relative "courier/resources/bulk"
443
456
  require_relative "courier/resources/digests"
444
457
  require_relative "courier/resources/digests/schedules"
445
458
  require_relative "courier/resources/inbound"
@@ -53,6 +53,9 @@ module Courier
53
53
  sig { returns(Courier::Resources::Broadcasts) }
54
54
  attr_reader :broadcasts
55
55
 
56
+ sig { returns(Courier::Resources::Bulk) }
57
+ attr_reader :bulk
58
+
56
59
  # Manage the logos, colors, and layout that give the templates you send a
57
60
  # consistent look.
58
61
  sig { returns(Courier::Resources::Brands) }
@@ -0,0 +1,43 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkAddUsersParams < 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::BulkAddUsersParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :job_id
16
+
17
+ sig { returns(T::Array[Courier::InboundBulkMessageUser]) }
18
+ attr_accessor :users
19
+
20
+ sig do
21
+ params(
22
+ job_id: String,
23
+ users: T::Array[Courier::InboundBulkMessageUser::OrHash],
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(job_id:, users:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ {
33
+ job_id: String,
34
+ users: T::Array[Courier::InboundBulkMessageUser],
35
+ request_options: Courier::RequestOptions
36
+ }
37
+ )
38
+ end
39
+ def to_hash
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkCreateJobParams < 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::BulkCreateJobParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ # Bulk message definition. Supports two formats:
15
+ #
16
+ # - V1 format: Requires `event` field (event ID or notification ID)
17
+ # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
18
+ # content) in addition to `event`
19
+ sig { returns(Courier::InboundBulkMessage) }
20
+ attr_reader :message
21
+
22
+ sig { params(message: Courier::InboundBulkMessage::OrHash).void }
23
+ attr_writer :message
24
+
25
+ sig do
26
+ params(
27
+ message: Courier::InboundBulkMessage::OrHash,
28
+ request_options: Courier::RequestOptions::OrHash
29
+ ).returns(T.attached_class)
30
+ end
31
+ def self.new(
32
+ # Bulk message definition. Supports two formats:
33
+ #
34
+ # - V1 format: Requires `event` field (event ID or notification ID)
35
+ # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
36
+ # content) in addition to `event`
37
+ message:,
38
+ request_options: {}
39
+ )
40
+ end
41
+
42
+ sig do
43
+ override.returns(
44
+ {
45
+ message: Courier::InboundBulkMessage,
46
+ request_options: Courier::RequestOptions
47
+ }
48
+ )
49
+ end
50
+ def to_hash
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkCreateJobResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::Models::BulkCreateJobResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :job_id
16
+
17
+ sig { params(job_id: String).returns(T.attached_class) }
18
+ def self.new(job_id:)
19
+ end
20
+
21
+ sig { override.returns({ job_id: String }) }
22
+ def to_hash
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,51 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkListUsersParams < 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::BulkListUsersParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :job_id
16
+
17
+ # A unique identifier that allows for fetching the next set of users added to the
18
+ # bulk job
19
+ sig { returns(T.nilable(String)) }
20
+ attr_accessor :cursor
21
+
22
+ sig do
23
+ params(
24
+ job_id: String,
25
+ cursor: T.nilable(String),
26
+ request_options: Courier::RequestOptions::OrHash
27
+ ).returns(T.attached_class)
28
+ end
29
+ def self.new(
30
+ job_id:,
31
+ # A unique identifier that allows for fetching the next set of users added to the
32
+ # bulk job
33
+ cursor: nil,
34
+ request_options: {}
35
+ )
36
+ end
37
+
38
+ sig do
39
+ override.returns(
40
+ {
41
+ job_id: String,
42
+ cursor: T.nilable(String),
43
+ request_options: Courier::RequestOptions
44
+ }
45
+ )
46
+ end
47
+ def to_hash
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,125 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkListUsersResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(
9
+ Courier::Models::BulkListUsersResponse,
10
+ Courier::Internal::AnyHash
11
+ )
12
+ end
13
+
14
+ sig { returns(T::Array[Courier::Models::BulkListUsersResponse::Item]) }
15
+ attr_accessor :items
16
+
17
+ sig { returns(Courier::Paging) }
18
+ attr_reader :paging
19
+
20
+ sig { params(paging: Courier::Paging::OrHash).void }
21
+ attr_writer :paging
22
+
23
+ sig do
24
+ params(
25
+ items: T::Array[Courier::Models::BulkListUsersResponse::Item::OrHash],
26
+ paging: Courier::Paging::OrHash
27
+ ).returns(T.attached_class)
28
+ end
29
+ def self.new(items:, paging:)
30
+ end
31
+
32
+ sig do
33
+ override.returns(
34
+ {
35
+ items: T::Array[Courier::Models::BulkListUsersResponse::Item],
36
+ paging: Courier::Paging
37
+ }
38
+ )
39
+ end
40
+ def to_hash
41
+ end
42
+
43
+ class Item < Courier::Models::InboundBulkMessageUser
44
+ OrHash =
45
+ T.type_alias do
46
+ T.any(
47
+ Courier::Models::BulkListUsersResponse::Item,
48
+ Courier::Internal::AnyHash
49
+ )
50
+ end
51
+
52
+ sig do
53
+ returns(
54
+ Courier::Models::BulkListUsersResponse::Item::Status::TaggedSymbol
55
+ )
56
+ end
57
+ attr_accessor :status
58
+
59
+ sig { returns(T.nilable(String)) }
60
+ attr_accessor :message_id
61
+
62
+ sig do
63
+ params(
64
+ status:
65
+ Courier::Models::BulkListUsersResponse::Item::Status::OrSymbol,
66
+ message_id: T.nilable(String)
67
+ ).returns(T.attached_class)
68
+ end
69
+ def self.new(status:, message_id: nil)
70
+ end
71
+
72
+ sig do
73
+ override.returns(
74
+ {
75
+ status:
76
+ Courier::Models::BulkListUsersResponse::Item::Status::TaggedSymbol,
77
+ message_id: T.nilable(String)
78
+ }
79
+ )
80
+ end
81
+ def to_hash
82
+ end
83
+
84
+ module Status
85
+ extend Courier::Internal::Type::Enum
86
+
87
+ TaggedSymbol =
88
+ T.type_alias do
89
+ T.all(
90
+ Symbol,
91
+ Courier::Models::BulkListUsersResponse::Item::Status
92
+ )
93
+ end
94
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
95
+
96
+ PENDING =
97
+ T.let(
98
+ :PENDING,
99
+ Courier::Models::BulkListUsersResponse::Item::Status::TaggedSymbol
100
+ )
101
+ ENQUEUED =
102
+ T.let(
103
+ :ENQUEUED,
104
+ Courier::Models::BulkListUsersResponse::Item::Status::TaggedSymbol
105
+ )
106
+ ERROR =
107
+ T.let(
108
+ :ERROR,
109
+ Courier::Models::BulkListUsersResponse::Item::Status::TaggedSymbol
110
+ )
111
+
112
+ sig do
113
+ override.returns(
114
+ T::Array[
115
+ Courier::Models::BulkListUsersResponse::Item::Status::TaggedSymbol
116
+ ]
117
+ )
118
+ end
119
+ def self.values
120
+ end
121
+ end
122
+ end
123
+ end
124
+ end
125
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BulkRetrieveJobParams < 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::BulkRetrieveJobParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :job_id
16
+
17
+ sig do
18
+ params(
19
+ job_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(job_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { job_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end