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
@@ -1,102 +0,0 @@
1
- # typed: strong
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
- sig do
12
- params(
13
- job_id: String,
14
- users: T::Array[Courier::InboundBulkMessageUser::OrHash],
15
- request_options: Courier::RequestOptions::OrHash
16
- ).void
17
- end
18
- def add_users(
19
- # A unique identifier representing the bulk job
20
- job_id,
21
- users:,
22
- request_options: {}
23
- )
24
- end
25
-
26
- # Creates a new bulk job for sending messages to multiple recipients.
27
- #
28
- # **Required**: `message.event` (event ID or notification ID)
29
- #
30
- # **Optional (V2 format)**: `message.template` (notification ID) or
31
- # `message.content` (Elemental content) can be provided to override the
32
- # notification associated with the event.
33
- sig do
34
- params(
35
- message: Courier::InboundBulkMessage::OrHash,
36
- request_options: Courier::RequestOptions::OrHash
37
- ).returns(Courier::Models::BulkCreateJobResponse)
38
- end
39
- def create_job(
40
- # Bulk message definition. Supports two formats:
41
- #
42
- # - V1 format: Requires `event` field (event ID or notification ID)
43
- # - V2 format: Optionally use `template` (notification ID) or `content` (Elemental
44
- # content) in addition to `event`
45
- message:,
46
- request_options: {}
47
- )
48
- end
49
-
50
- # Get Bulk Job Users
51
- sig do
52
- params(
53
- job_id: String,
54
- cursor: T.nilable(String),
55
- request_options: Courier::RequestOptions::OrHash
56
- ).returns(Courier::Models::BulkListUsersResponse)
57
- end
58
- def list_users(
59
- # A unique identifier representing the bulk job
60
- job_id,
61
- # A unique identifier that allows for fetching the next set of users added to the
62
- # bulk job
63
- cursor: nil,
64
- request_options: {}
65
- )
66
- end
67
-
68
- # Get a bulk job
69
- sig do
70
- params(
71
- job_id: String,
72
- request_options: Courier::RequestOptions::OrHash
73
- ).returns(Courier::Models::BulkRetrieveJobResponse)
74
- end
75
- def retrieve_job(
76
- # A unique identifier representing the bulk job
77
- job_id,
78
- request_options: {}
79
- )
80
- end
81
-
82
- # Run a bulk job
83
- sig do
84
- params(
85
- job_id: String,
86
- request_options: Courier::RequestOptions::OrHash
87
- ).void
88
- end
89
- def run_job(
90
- # A unique identifier representing the bulk job
91
- job_id,
92
- request_options: {}
93
- )
94
- end
95
-
96
- # @api private
97
- sig { params(client: Courier::Client).returns(T.attached_class) }
98
- def self.new(client:)
99
- end
100
- end
101
- end
102
- end
@@ -1,28 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_add_users_params =
4
- { job_id: String, users: ::Array[Courier::InboundBulkMessageUser] }
5
- & Courier::Internal::Type::request_parameters
6
-
7
- class BulkAddUsersParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- attr_accessor job_id: String
12
-
13
- attr_accessor users: ::Array[Courier::InboundBulkMessageUser]
14
-
15
- def initialize: (
16
- job_id: String,
17
- users: ::Array[Courier::InboundBulkMessageUser],
18
- ?request_options: Courier::request_opts
19
- ) -> void
20
-
21
- def to_hash: -> {
22
- job_id: String,
23
- users: ::Array[Courier::InboundBulkMessageUser],
24
- request_options: Courier::RequestOptions
25
- }
26
- end
27
- end
28
- end
@@ -1,24 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_create_job_params =
4
- { message: Courier::InboundBulkMessage }
5
- & Courier::Internal::Type::request_parameters
6
-
7
- class BulkCreateJobParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- attr_accessor message: Courier::InboundBulkMessage
12
-
13
- def initialize: (
14
- message: Courier::InboundBulkMessage,
15
- ?request_options: Courier::request_opts
16
- ) -> void
17
-
18
- def to_hash: -> {
19
- message: Courier::InboundBulkMessage,
20
- request_options: Courier::RequestOptions
21
- }
22
- end
23
- end
24
- end
@@ -1,13 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_create_job_response = { job_id: String }
4
-
5
- class BulkCreateJobResponse < Courier::Internal::Type::BaseModel
6
- attr_accessor job_id: String
7
-
8
- def initialize: (job_id: String) -> void
9
-
10
- def to_hash: -> { job_id: String }
11
- end
12
- end
13
- end
@@ -1,28 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_list_users_params =
4
- { job_id: String, cursor: String? }
5
- & Courier::Internal::Type::request_parameters
6
-
7
- class BulkListUsersParams < Courier::Internal::Type::BaseModel
8
- extend Courier::Internal::Type::RequestParameters::Converter
9
- include Courier::Internal::Type::RequestParameters
10
-
11
- attr_accessor job_id: String
12
-
13
- attr_accessor cursor: String?
14
-
15
- def initialize: (
16
- job_id: String,
17
- ?cursor: String?,
18
- ?request_options: Courier::request_opts
19
- ) -> void
20
-
21
- def to_hash: -> {
22
- job_id: String,
23
- cursor: String?,
24
- request_options: Courier::RequestOptions
25
- }
26
- end
27
- end
28
- end
@@ -1,65 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_list_users_response =
4
- {
5
- items: ::Array[Courier::Models::BulkListUsersResponse::Item],
6
- paging: Courier::Paging
7
- }
8
-
9
- class BulkListUsersResponse < Courier::Internal::Type::BaseModel
10
- attr_accessor items: ::Array[Courier::Models::BulkListUsersResponse::Item]
11
-
12
- attr_accessor paging: Courier::Paging
13
-
14
- def initialize: (
15
- items: ::Array[Courier::Models::BulkListUsersResponse::Item],
16
- paging: Courier::Paging
17
- ) -> void
18
-
19
- def to_hash: -> {
20
- items: ::Array[Courier::Models::BulkListUsersResponse::Item],
21
- paging: Courier::Paging
22
- }
23
-
24
- type item =
25
- {
26
- status: Courier::Models::BulkListUsersResponse::Item::status,
27
- message_id: String?
28
- }
29
-
30
- class Item < Courier::Models::InboundBulkMessageUser
31
- def status: -> Courier::Models::BulkListUsersResponse::Item::status
32
-
33
- def status=: (
34
- Courier::Models::BulkListUsersResponse::Item::status _
35
- ) -> Courier::Models::BulkListUsersResponse::Item::status
36
-
37
- def message_id: -> String?
38
-
39
- def message_id=: (String? _) -> String?
40
-
41
- def initialize: (
42
- status: Courier::Models::BulkListUsersResponse::Item::status,
43
- ?message_id: String?
44
- ) -> void
45
-
46
- def to_hash: -> {
47
- status: Courier::Models::BulkListUsersResponse::Item::status,
48
- message_id: String?
49
- }
50
-
51
- type status = :PENDING | :ENQUEUED | :ERROR
52
-
53
- module Status
54
- extend Courier::Internal::Type::Enum
55
-
56
- PENDING: :PENDING
57
- ENQUEUED: :ENQUEUED
58
- ERROR: :ERROR
59
-
60
- def self?.values: -> ::Array[Courier::Models::BulkListUsersResponse::Item::status]
61
- end
62
- end
63
- end
64
- end
65
- end
@@ -1,23 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_retrieve_job_params =
4
- { job_id: String } & Courier::Internal::Type::request_parameters
5
-
6
- class BulkRetrieveJobParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- attr_accessor job_id: String
11
-
12
- def initialize: (
13
- job_id: String,
14
- ?request_options: Courier::request_opts
15
- ) -> void
16
-
17
- def to_hash: -> {
18
- job_id: String,
19
- request_options: Courier::RequestOptions
20
- }
21
- end
22
- end
23
- end
@@ -1,66 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_retrieve_job_response =
4
- { job: Courier::Models::BulkRetrieveJobResponse::Job }
5
-
6
- class BulkRetrieveJobResponse < Courier::Internal::Type::BaseModel
7
- attr_accessor job: Courier::Models::BulkRetrieveJobResponse::Job
8
-
9
- def initialize: (
10
- job: Courier::Models::BulkRetrieveJobResponse::Job
11
- ) -> void
12
-
13
- def to_hash: -> { job: Courier::Models::BulkRetrieveJobResponse::Job }
14
-
15
- type job =
16
- {
17
- definition: Courier::InboundBulkMessage,
18
- enqueued: Integer,
19
- failures: Integer,
20
- received: Integer,
21
- status: Courier::Models::BulkRetrieveJobResponse::Job::status
22
- }
23
-
24
- class Job < Courier::Internal::Type::BaseModel
25
- attr_accessor definition: Courier::InboundBulkMessage
26
-
27
- attr_accessor enqueued: Integer
28
-
29
- attr_accessor failures: Integer
30
-
31
- attr_accessor received: Integer
32
-
33
- attr_accessor status: Courier::Models::BulkRetrieveJobResponse::Job::status
34
-
35
- def initialize: (
36
- definition: Courier::InboundBulkMessage,
37
- enqueued: Integer,
38
- failures: Integer,
39
- received: Integer,
40
- status: Courier::Models::BulkRetrieveJobResponse::Job::status
41
- ) -> void
42
-
43
- def to_hash: -> {
44
- definition: Courier::InboundBulkMessage,
45
- enqueued: Integer,
46
- failures: Integer,
47
- received: Integer,
48
- status: Courier::Models::BulkRetrieveJobResponse::Job::status
49
- }
50
-
51
- type status = :CREATED | :PROCESSING | :COMPLETED | :ERROR
52
-
53
- module Status
54
- extend Courier::Internal::Type::Enum
55
-
56
- CREATED: :CREATED
57
- PROCESSING: :PROCESSING
58
- COMPLETED: :COMPLETED
59
- ERROR: :ERROR
60
-
61
- def self?.values: -> ::Array[Courier::Models::BulkRetrieveJobResponse::Job::status]
62
- end
63
- end
64
- end
65
- end
66
- end
@@ -1,23 +0,0 @@
1
- module Courier
2
- module Models
3
- type bulk_run_job_params =
4
- { job_id: String } & Courier::Internal::Type::request_parameters
5
-
6
- class BulkRunJobParams < Courier::Internal::Type::BaseModel
7
- extend Courier::Internal::Type::RequestParameters::Converter
8
- include Courier::Internal::Type::RequestParameters
9
-
10
- attr_accessor job_id: String
11
-
12
- def initialize: (
13
- job_id: String,
14
- ?request_options: Courier::request_opts
15
- ) -> void
16
-
17
- def to_hash: -> {
18
- job_id: String,
19
- request_options: Courier::RequestOptions
20
- }
21
- end
22
- end
23
- end
@@ -1,58 +0,0 @@
1
- module Courier
2
- module Models
3
- type inbound_bulk_message =
4
- {
5
- event: String,
6
- brand: String?,
7
- content: Courier::Models::InboundBulkMessage::content?,
8
- data: ::Hash[Symbol, top]?,
9
- locale: ::Hash[Symbol, ::Hash[Symbol, top]]?,
10
- override: ::Hash[Symbol, top]?,
11
- template: String?
12
- }
13
-
14
- class InboundBulkMessage < Courier::Internal::Type::BaseModel
15
- attr_accessor event: String
16
-
17
- attr_accessor brand: String?
18
-
19
- attr_accessor content: Courier::Models::InboundBulkMessage::content?
20
-
21
- attr_accessor data: ::Hash[Symbol, top]?
22
-
23
- attr_accessor locale: ::Hash[Symbol, ::Hash[Symbol, top]]?
24
-
25
- attr_accessor override: ::Hash[Symbol, top]?
26
-
27
- attr_accessor template: String?
28
-
29
- def initialize: (
30
- event: String,
31
- ?brand: String?,
32
- ?content: Courier::Models::InboundBulkMessage::content?,
33
- ?data: ::Hash[Symbol, top]?,
34
- ?locale: ::Hash[Symbol, ::Hash[Symbol, top]]?,
35
- ?override: ::Hash[Symbol, top]?,
36
- ?template: String?
37
- ) -> void
38
-
39
- def to_hash: -> {
40
- event: String,
41
- brand: String?,
42
- content: Courier::Models::InboundBulkMessage::content?,
43
- data: ::Hash[Symbol, top]?,
44
- locale: ::Hash[Symbol, ::Hash[Symbol, top]]?,
45
- override: ::Hash[Symbol, top]?,
46
- template: String?
47
- }
48
-
49
- type content = Courier::ElementalContentSugar | Courier::ElementalContent
50
-
51
- module Content
52
- extend Courier::Internal::Type::Union
53
-
54
- def self?.variants: -> ::Array[Courier::Models::InboundBulkMessage::content]
55
- end
56
- end
57
- end
58
- end
@@ -1,42 +0,0 @@
1
- module Courier
2
- module Models
3
- type inbound_bulk_message_user =
4
- {
5
- data: top,
6
- preferences: Courier::RecipientPreferences?,
7
- profile: ::Hash[Symbol, top]?,
8
- recipient: String?,
9
- to: Courier::UserRecipient?
10
- }
11
-
12
- class InboundBulkMessageUser < Courier::Internal::Type::BaseModel
13
- attr_reader data: top?
14
-
15
- def data=: (top) -> top
16
-
17
- attr_accessor preferences: Courier::RecipientPreferences?
18
-
19
- attr_accessor profile: ::Hash[Symbol, top]?
20
-
21
- attr_accessor recipient: String?
22
-
23
- attr_accessor to: Courier::UserRecipient?
24
-
25
- def initialize: (
26
- ?data: top,
27
- ?preferences: Courier::RecipientPreferences?,
28
- ?profile: ::Hash[Symbol, top]?,
29
- ?recipient: String?,
30
- ?to: Courier::UserRecipient?
31
- ) -> void
32
-
33
- def to_hash: -> {
34
- data: top,
35
- preferences: Courier::RecipientPreferences?,
36
- profile: ::Hash[Symbol, top]?,
37
- recipient: String?,
38
- to: Courier::UserRecipient?
39
- }
40
- end
41
- end
42
- end
@@ -1,34 +0,0 @@
1
- module Courier
2
- module Resources
3
- class Bulk
4
- def add_users: (
5
- String job_id,
6
- users: ::Array[Courier::InboundBulkMessageUser],
7
- ?request_options: Courier::request_opts
8
- ) -> nil
9
-
10
- def create_job: (
11
- message: Courier::InboundBulkMessage,
12
- ?request_options: Courier::request_opts
13
- ) -> Courier::Models::BulkCreateJobResponse
14
-
15
- def list_users: (
16
- String job_id,
17
- ?cursor: String?,
18
- ?request_options: Courier::request_opts
19
- ) -> Courier::Models::BulkListUsersResponse
20
-
21
- def retrieve_job: (
22
- String job_id,
23
- ?request_options: Courier::request_opts
24
- ) -> Courier::Models::BulkRetrieveJobResponse
25
-
26
- def run_job: (
27
- String job_id,
28
- ?request_options: Courier::request_opts
29
- ) -> nil
30
-
31
- def initialize: (client: Courier::Client) -> void
32
- end
33
- end
34
- end