trycourier 4.19.2 → 4.21.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/lib/courier/client.rb +0 -4
  4. data/lib/courier/models/{bulk_run_job_params.rb → notification_duplicate_params.rb} +6 -6
  5. data/lib/courier/models/notification_template_summary.rb +22 -1
  6. data/lib/courier/models.rb +2 -14
  7. data/lib/courier/resources/notifications.rb +25 -0
  8. data/lib/courier/version.rb +1 -1
  9. data/lib/courier.rb +1 -11
  10. data/rbi/courier/client.rbi +0 -3
  11. data/rbi/courier/models/{bulk_retrieve_job_params.rbi → notification_duplicate_params.rbi} +9 -6
  12. data/rbi/courier/models/notification_template_summary.rbi +26 -0
  13. data/rbi/courier/models.rbi +2 -14
  14. data/rbi/courier/resources/notifications.rbi +19 -0
  15. data/sig/courier/client.rbs +0 -2
  16. data/sig/courier/models/notification_duplicate_params.rbs +20 -0
  17. data/sig/courier/models/notification_template_summary.rbs +14 -0
  18. data/sig/courier/models.rbs +2 -14
  19. data/sig/courier/resources/notifications.rbs +5 -0
  20. metadata +5 -35
  21. data/lib/courier/models/bulk_add_users_params.rb +0 -26
  22. data/lib/courier/models/bulk_create_job_params.rb +0 -29
  23. data/lib/courier/models/bulk_create_job_response.rb +0 -16
  24. data/lib/courier/models/bulk_list_users_params.rb +0 -33
  25. data/lib/courier/models/bulk_list_users_response.rb +0 -49
  26. data/lib/courier/models/bulk_retrieve_job_params.rb +0 -20
  27. data/lib/courier/models/bulk_retrieve_job_response.rb +0 -76
  28. data/lib/courier/models/inbound_bulk_message.rb +0 -91
  29. data/lib/courier/models/inbound_bulk_message_user.rb +0 -54
  30. data/lib/courier/resources/bulk.rb +0 -141
  31. data/rbi/courier/models/bulk_add_users_params.rbi +0 -43
  32. data/rbi/courier/models/bulk_create_job_params.rbi +0 -54
  33. data/rbi/courier/models/bulk_create_job_response.rbi +0 -26
  34. data/rbi/courier/models/bulk_list_users_params.rbi +0 -51
  35. data/rbi/courier/models/bulk_list_users_response.rbi +0 -125
  36. data/rbi/courier/models/bulk_retrieve_job_response.rbi +0 -157
  37. data/rbi/courier/models/bulk_run_job_params.rbi +0 -35
  38. data/rbi/courier/models/inbound_bulk_message.rbi +0 -124
  39. data/rbi/courier/models/inbound_bulk_message_user.rbi +0 -88
  40. data/rbi/courier/resources/bulk.rbi +0 -102
  41. data/sig/courier/models/bulk_add_users_params.rbs +0 -28
  42. data/sig/courier/models/bulk_create_job_params.rbs +0 -24
  43. data/sig/courier/models/bulk_create_job_response.rbs +0 -13
  44. data/sig/courier/models/bulk_list_users_params.rbs +0 -28
  45. data/sig/courier/models/bulk_list_users_response.rbs +0 -65
  46. data/sig/courier/models/bulk_retrieve_job_params.rbs +0 -23
  47. data/sig/courier/models/bulk_retrieve_job_response.rbs +0 -66
  48. data/sig/courier/models/bulk_run_job_params.rbs +0 -23
  49. data/sig/courier/models/inbound_bulk_message.rbs +0 -58
  50. data/sig/courier/models/inbound_bulk_message_user.rbs +0 -42
  51. data/sig/courier/resources/bulk.rbs +0 -34
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trycourier
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.19.2
4
+ version: 4.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Courier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-10 00:00:00.000000000 Z
11
+ date: 2026-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi
@@ -113,14 +113,6 @@ files:
113
113
  - lib/courier/models/brand_snippets.rb
114
114
  - lib/courier/models/brand_template.rb
115
115
  - lib/courier/models/brand_update_params.rb
116
- - lib/courier/models/bulk_add_users_params.rb
117
- - lib/courier/models/bulk_create_job_params.rb
118
- - lib/courier/models/bulk_create_job_response.rb
119
- - lib/courier/models/bulk_list_users_params.rb
120
- - lib/courier/models/bulk_list_users_response.rb
121
- - lib/courier/models/bulk_retrieve_job_params.rb
122
- - lib/courier/models/bulk_retrieve_job_response.rb
123
- - lib/courier/models/bulk_run_job_params.rb
124
116
  - lib/courier/models/cancel_journey_request.rb
125
117
  - lib/courier/models/cancel_journey_response.rb
126
118
  - lib/courier/models/channel.rb
@@ -157,8 +149,6 @@ files:
157
149
  - lib/courier/models/expo.rb
158
150
  - lib/courier/models/filter_config.rb
159
151
  - lib/courier/models/icons.rb
160
- - lib/courier/models/inbound_bulk_message.rb
161
- - lib/courier/models/inbound_bulk_message_user.rb
162
152
  - lib/courier/models/inbound_track_event_params.rb
163
153
  - lib/courier/models/inbound_track_event_response.rb
164
154
  - lib/courier/models/intercom.rb
@@ -260,6 +250,7 @@ files:
260
250
  - lib/courier/models/notification_content_mutation_response.rb
261
251
  - lib/courier/models/notification_content_put_request.rb
262
252
  - lib/courier/models/notification_create_params.rb
253
+ - lib/courier/models/notification_duplicate_params.rb
263
254
  - lib/courier/models/notification_element_put_request.rb
264
255
  - lib/courier/models/notification_get_content.rb
265
256
  - lib/courier/models/notification_list_params.rb
@@ -447,7 +438,6 @@ files:
447
438
  - lib/courier/resources/automations.rb
448
439
  - lib/courier/resources/automations/invoke.rb
449
440
  - lib/courier/resources/brands.rb
450
- - lib/courier/resources/bulk.rb
451
441
  - lib/courier/resources/digests.rb
452
442
  - lib/courier/resources/digests/schedules.rb
453
443
  - lib/courier/resources/inbound.rb
@@ -542,14 +532,6 @@ files:
542
532
  - rbi/courier/models/brand_snippets.rbi
543
533
  - rbi/courier/models/brand_template.rbi
544
534
  - rbi/courier/models/brand_update_params.rbi
545
- - rbi/courier/models/bulk_add_users_params.rbi
546
- - rbi/courier/models/bulk_create_job_params.rbi
547
- - rbi/courier/models/bulk_create_job_response.rbi
548
- - rbi/courier/models/bulk_list_users_params.rbi
549
- - rbi/courier/models/bulk_list_users_response.rbi
550
- - rbi/courier/models/bulk_retrieve_job_params.rbi
551
- - rbi/courier/models/bulk_retrieve_job_response.rbi
552
- - rbi/courier/models/bulk_run_job_params.rbi
553
535
  - rbi/courier/models/cancel_journey_request.rbi
554
536
  - rbi/courier/models/cancel_journey_response.rbi
555
537
  - rbi/courier/models/channel.rbi
@@ -586,8 +568,6 @@ files:
586
568
  - rbi/courier/models/expo.rbi
587
569
  - rbi/courier/models/filter_config.rbi
588
570
  - rbi/courier/models/icons.rbi
589
- - rbi/courier/models/inbound_bulk_message.rbi
590
- - rbi/courier/models/inbound_bulk_message_user.rbi
591
571
  - rbi/courier/models/inbound_track_event_params.rbi
592
572
  - rbi/courier/models/inbound_track_event_response.rbi
593
573
  - rbi/courier/models/intercom.rbi
@@ -689,6 +669,7 @@ files:
689
669
  - rbi/courier/models/notification_content_mutation_response.rbi
690
670
  - rbi/courier/models/notification_content_put_request.rbi
691
671
  - rbi/courier/models/notification_create_params.rbi
672
+ - rbi/courier/models/notification_duplicate_params.rbi
692
673
  - rbi/courier/models/notification_element_put_request.rbi
693
674
  - rbi/courier/models/notification_get_content.rbi
694
675
  - rbi/courier/models/notification_list_params.rbi
@@ -876,7 +857,6 @@ files:
876
857
  - rbi/courier/resources/automations.rbi
877
858
  - rbi/courier/resources/automations/invoke.rbi
878
859
  - rbi/courier/resources/brands.rbi
879
- - rbi/courier/resources/bulk.rbi
880
860
  - rbi/courier/resources/digests.rbi
881
861
  - rbi/courier/resources/digests/schedules.rbi
882
862
  - rbi/courier/resources/inbound.rbi
@@ -970,14 +950,6 @@ files:
970
950
  - sig/courier/models/brand_snippets.rbs
971
951
  - sig/courier/models/brand_template.rbs
972
952
  - sig/courier/models/brand_update_params.rbs
973
- - sig/courier/models/bulk_add_users_params.rbs
974
- - sig/courier/models/bulk_create_job_params.rbs
975
- - sig/courier/models/bulk_create_job_response.rbs
976
- - sig/courier/models/bulk_list_users_params.rbs
977
- - sig/courier/models/bulk_list_users_response.rbs
978
- - sig/courier/models/bulk_retrieve_job_params.rbs
979
- - sig/courier/models/bulk_retrieve_job_response.rbs
980
- - sig/courier/models/bulk_run_job_params.rbs
981
953
  - sig/courier/models/cancel_journey_request.rbs
982
954
  - sig/courier/models/cancel_journey_response.rbs
983
955
  - sig/courier/models/channel.rbs
@@ -1014,8 +986,6 @@ files:
1014
986
  - sig/courier/models/expo.rbs
1015
987
  - sig/courier/models/filter_config.rbs
1016
988
  - sig/courier/models/icons.rbs
1017
- - sig/courier/models/inbound_bulk_message.rbs
1018
- - sig/courier/models/inbound_bulk_message_user.rbs
1019
989
  - sig/courier/models/inbound_track_event_params.rbs
1020
990
  - sig/courier/models/inbound_track_event_response.rbs
1021
991
  - sig/courier/models/intercom.rbs
@@ -1117,6 +1087,7 @@ files:
1117
1087
  - sig/courier/models/notification_content_mutation_response.rbs
1118
1088
  - sig/courier/models/notification_content_put_request.rbs
1119
1089
  - sig/courier/models/notification_create_params.rbs
1090
+ - sig/courier/models/notification_duplicate_params.rbs
1120
1091
  - sig/courier/models/notification_element_put_request.rbs
1121
1092
  - sig/courier/models/notification_get_content.rbs
1122
1093
  - sig/courier/models/notification_list_params.rbs
@@ -1304,7 +1275,6 @@ files:
1304
1275
  - sig/courier/resources/automations.rbs
1305
1276
  - sig/courier/resources/automations/invoke.rbs
1306
1277
  - sig/courier/resources/brands.rbs
1307
- - sig/courier/resources/bulk.rbs
1308
1278
  - sig/courier/resources/digests.rbs
1309
1279
  - sig/courier/resources/digests/schedules.rbs
1310
1280
  - sig/courier/resources/inbound.rbs
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::Bulk#add_users
6
- class BulkAddUsersParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- # @!attribute job_id
11
- #
12
- # @return [String]
13
- required :job_id, String
14
-
15
- # @!attribute users
16
- #
17
- # @return [Array<Courier::Models::InboundBulkMessageUser>]
18
- required :users, -> { Courier::Internal::Type::ArrayOf[Courier::InboundBulkMessageUser] }
19
-
20
- # @!method initialize(job_id:, users:, request_options: {})
21
- # @param job_id [String]
22
- # @param users [Array<Courier::Models::InboundBulkMessageUser>]
23
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
24
- end
25
- end
26
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::Bulk#create_job
6
- class BulkCreateJobParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- # @!attribute message
11
- # Bulk message definition. Supports two formats:
12
- #
13
- # - V1 format: Requires `event` field (event ID or notification ID)
14
- # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
15
- # content) in addition to `event`
16
- #
17
- # @return [Courier::Models::InboundBulkMessage]
18
- required :message, -> { Courier::InboundBulkMessage }
19
-
20
- # @!method initialize(message:, request_options: {})
21
- # Some parameter documentations has been truncated, see
22
- # {Courier::Models::BulkCreateJobParams} for more details.
23
- #
24
- # @param message [Courier::Models::InboundBulkMessage] Bulk message definition. Supports two formats:
25
- #
26
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
27
- end
28
- end
29
- end
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::Bulk#create_job
6
- class BulkCreateJobResponse < Courier::Internal::Type::BaseModel
7
- # @!attribute job_id
8
- #
9
- # @return [String]
10
- required :job_id, String, api_name: :jobId
11
-
12
- # @!method initialize(job_id:)
13
- # @param job_id [String]
14
- end
15
- end
16
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::Bulk#list_users
6
- class BulkListUsersParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- # @!attribute job_id
11
- #
12
- # @return [String]
13
- required :job_id, String
14
-
15
- # @!attribute cursor
16
- # A unique identifier that allows for fetching the next set of users added to the
17
- # bulk job
18
- #
19
- # @return [String, nil]
20
- optional :cursor, String, nil?: true
21
-
22
- # @!method initialize(job_id:, cursor: nil, request_options: {})
23
- # Some parameter documentations has been truncated, see
24
- # {Courier::Models::BulkListUsersParams} for more details.
25
- #
26
- # @param job_id [String]
27
- #
28
- # @param cursor [String, nil] A unique identifier that allows for fetching the next set of users added to the
29
- #
30
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
31
- end
32
- end
33
- end
@@ -1,49 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::Bulk#list_users
6
- class BulkListUsersResponse < Courier::Internal::Type::BaseModel
7
- # @!attribute items
8
- #
9
- # @return [Array<Courier::Models::BulkListUsersResponse::Item>]
10
- required :items, -> { Courier::Internal::Type::ArrayOf[Courier::Models::BulkListUsersResponse::Item] }
11
-
12
- # @!attribute paging
13
- #
14
- # @return [Courier::Models::Paging]
15
- required :paging, -> { Courier::Paging }
16
-
17
- # @!method initialize(items:, paging:)
18
- # @param items [Array<Courier::Models::BulkListUsersResponse::Item>]
19
- # @param paging [Courier::Models::Paging]
20
-
21
- class Item < Courier::Models::InboundBulkMessageUser
22
- # @!attribute status
23
- #
24
- # @return [Symbol, Courier::Models::BulkListUsersResponse::Item::Status]
25
- required :status, enum: -> { Courier::Models::BulkListUsersResponse::Item::Status }
26
-
27
- # @!attribute message_id
28
- #
29
- # @return [String, nil]
30
- optional :message_id, String, api_name: :messageId, nil?: true
31
-
32
- # @!method initialize(status:, message_id: nil)
33
- # @param status [Symbol, Courier::Models::BulkListUsersResponse::Item::Status]
34
- # @param message_id [String, nil]
35
-
36
- module Status
37
- extend Courier::Internal::Type::Enum
38
-
39
- PENDING = :PENDING
40
- ENQUEUED = :ENQUEUED
41
- ERROR = :ERROR
42
-
43
- # @!method self.values
44
- # @return [Array<Symbol>]
45
- end
46
- end
47
- end
48
- end
49
- end
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::Bulk#retrieve_job
6
- class BulkRetrieveJobParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- # @!attribute job_id
11
- #
12
- # @return [String]
13
- required :job_id, String
14
-
15
- # @!method initialize(job_id:, request_options: {})
16
- # @param job_id [String]
17
- # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
18
- end
19
- end
20
- end
@@ -1,76 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- # @see Courier::Resources::Bulk#retrieve_job
6
- class BulkRetrieveJobResponse < Courier::Internal::Type::BaseModel
7
- # @!attribute job
8
- #
9
- # @return [Courier::Models::BulkRetrieveJobResponse::Job]
10
- required :job, -> { Courier::Models::BulkRetrieveJobResponse::Job }
11
-
12
- # @!method initialize(job:)
13
- # @param job [Courier::Models::BulkRetrieveJobResponse::Job]
14
-
15
- # @see Courier::Models::BulkRetrieveJobResponse#job
16
- class Job < Courier::Internal::Type::BaseModel
17
- # @!attribute definition
18
- # Bulk message definition. Supports two formats:
19
- #
20
- # - V1 format: Requires `event` field (event ID or notification ID)
21
- # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
22
- # content) in addition to `event`
23
- #
24
- # @return [Courier::Models::InboundBulkMessage]
25
- required :definition, -> { Courier::InboundBulkMessage }
26
-
27
- # @!attribute enqueued
28
- #
29
- # @return [Integer]
30
- required :enqueued, Integer
31
-
32
- # @!attribute failures
33
- #
34
- # @return [Integer]
35
- required :failures, Integer
36
-
37
- # @!attribute received
38
- #
39
- # @return [Integer]
40
- required :received, Integer
41
-
42
- # @!attribute status
43
- #
44
- # @return [Symbol, Courier::Models::BulkRetrieveJobResponse::Job::Status]
45
- required :status, enum: -> { Courier::Models::BulkRetrieveJobResponse::Job::Status }
46
-
47
- # @!method initialize(definition:, enqueued:, failures:, received:, status:)
48
- # Some parameter documentations has been truncated, see
49
- # {Courier::Models::BulkRetrieveJobResponse::Job} for more details.
50
- #
51
- # @param definition [Courier::Models::InboundBulkMessage] Bulk message definition. Supports two formats:
52
- #
53
- # @param enqueued [Integer]
54
- #
55
- # @param failures [Integer]
56
- #
57
- # @param received [Integer]
58
- #
59
- # @param status [Symbol, Courier::Models::BulkRetrieveJobResponse::Job::Status]
60
-
61
- # @see Courier::Models::BulkRetrieveJobResponse::Job#status
62
- module Status
63
- extend Courier::Internal::Type::Enum
64
-
65
- CREATED = :CREATED
66
- PROCESSING = :PROCESSING
67
- COMPLETED = :COMPLETED
68
- ERROR = :ERROR
69
-
70
- # @!method self.values
71
- # @return [Array<Symbol>]
72
- end
73
- end
74
- end
75
- end
76
- end
@@ -1,91 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- class InboundBulkMessage < Courier::Internal::Type::BaseModel
6
- # @!attribute event
7
- # Event ID or Notification ID (required). Can be either a Notification ID (e.g.,
8
- # "FRH3QXM9E34W4RKP7MRC8NZ1T8V8") or a custom Event ID (e.g., "welcome-email")
9
- # mapped to a notification.
10
- #
11
- # @return [String]
12
- required :event, String
13
-
14
- # @!attribute brand
15
- #
16
- # @return [String, nil]
17
- optional :brand, String, nil?: true
18
-
19
- # @!attribute content
20
- # Elemental content (optional, for V2 format). When provided, this will be used
21
- # instead of the notification associated with the `event` field.
22
- #
23
- # @return [Courier::Models::ElementalContentSugar, Courier::Models::ElementalContent, nil]
24
- optional :content, union: -> { Courier::InboundBulkMessage::Content }, nil?: true
25
-
26
- # @!attribute data
27
- #
28
- # @return [Hash{Symbol=>Object}, nil]
29
- optional :data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
30
-
31
- # @!attribute locale
32
- #
33
- # @return [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
34
- optional :locale,
35
- Courier::Internal::Type::HashOf[Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]],
36
- nil?: true
37
-
38
- # @!attribute override
39
- #
40
- # @return [Hash{Symbol=>Object}, nil]
41
- optional :override, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
42
-
43
- # @!attribute template
44
- # Notification ID or template ID (optional, for V2 format). When provided, this
45
- # will be used instead of the notification associated with the `event` field.
46
- #
47
- # @return [String, nil]
48
- optional :template, String, nil?: true
49
-
50
- # @!method initialize(event:, brand: nil, content: nil, data: nil, locale: nil, override: nil, template: nil)
51
- # Some parameter documentations has been truncated, see
52
- # {Courier::Models::InboundBulkMessage} for more details.
53
- #
54
- # Bulk message definition. Supports two formats:
55
- #
56
- # - V1 format: Requires `event` field (event ID or notification ID)
57
- # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
58
- # content) in addition to `event`
59
- #
60
- # @param event [String] Event ID or Notification ID (required). Can be either a
61
- #
62
- # @param brand [String, nil]
63
- #
64
- # @param content [Courier::Models::ElementalContentSugar, Courier::Models::ElementalContent, nil] Elemental content (optional, for V2 format). When provided, this will be used
65
- #
66
- # @param data [Hash{Symbol=>Object}, nil]
67
- #
68
- # @param locale [Hash{Symbol=>Hash{Symbol=>Object}}, nil]
69
- #
70
- # @param override [Hash{Symbol=>Object}, nil]
71
- #
72
- # @param template [String, nil] Notification ID or template ID (optional, for V2 format). When provided,
73
-
74
- # Elemental content (optional, for V2 format). When provided, this will be used
75
- # instead of the notification associated with the `event` field.
76
- #
77
- # @see Courier::Models::InboundBulkMessage#content
78
- module Content
79
- extend Courier::Internal::Type::Union
80
-
81
- # Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
82
- variant -> { Courier::ElementalContentSugar }
83
-
84
- variant -> { Courier::ElementalContent }
85
-
86
- # @!method self.variants
87
- # @return [Array(Courier::Models::ElementalContentSugar, Courier::Models::ElementalContent)]
88
- end
89
- end
90
- end
91
- end
@@ -1,54 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Courier
4
- module Models
5
- class InboundBulkMessageUser < Courier::Internal::Type::BaseModel
6
- # @!attribute data
7
- # User-specific data that will be merged with message.data
8
- #
9
- # @return [Object, nil]
10
- optional :data, Courier::Internal::Type::Unknown
11
-
12
- # @!attribute preferences
13
- #
14
- # @return [Courier::Models::RecipientPreferences, nil]
15
- optional :preferences, -> { Courier::RecipientPreferences }, nil?: true
16
-
17
- # @!attribute profile
18
- # User profile information. For email-based bulk jobs, `profile.email` is required
19
- # for provider routing to determine if the message can be delivered. The email
20
- # address should be provided here rather than in `to.email`.
21
- #
22
- # @return [Hash{Symbol=>Object}, nil]
23
- optional :profile, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
24
-
25
- # @!attribute recipient
26
- # User ID (legacy field, use profile or to.user_id instead)
27
- #
28
- # @return [String, nil]
29
- optional :recipient, String, nil?: true
30
-
31
- # @!attribute to
32
- # Optional recipient information. Note: For email provider routing, use
33
- # `profile.email` instead of `to.email`. The `to` field is primarily used for
34
- # recipient identification and data merging.
35
- #
36
- # @return [Courier::Models::UserRecipient, nil]
37
- optional :to, -> { Courier::UserRecipient }, nil?: true
38
-
39
- # @!method initialize(data: nil, preferences: nil, profile: nil, recipient: nil, to: nil)
40
- # Some parameter documentations has been truncated, see
41
- # {Courier::Models::InboundBulkMessageUser} for more details.
42
- #
43
- # @param data [Object] User-specific data that will be merged with message.data
44
- #
45
- # @param preferences [Courier::Models::RecipientPreferences, nil]
46
- #
47
- # @param profile [Hash{Symbol=>Object}, nil] User profile information. For email-based bulk jobs, `profile.email` is required
48
- #
49
- # @param recipient [String, nil] User ID (legacy field, use profile or to.user_id instead)
50
- #
51
- # @param to [Courier::Models::UserRecipient, nil] Optional recipient information. Note: For email provider routing, use
52
- end
53
- end
54
- end
@@ -1,141 +0,0 @@
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