trycourier 4.26.0 → 4.26.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +16 -19
- data/lib/courier/client.rb +4 -0
- data/lib/courier/models/bulk_add_users_params.rb +26 -0
- data/lib/courier/models/bulk_create_job_params.rb +29 -0
- data/lib/courier/models/bulk_create_job_response.rb +16 -0
- data/lib/courier/models/bulk_list_users_params.rb +33 -0
- data/lib/courier/models/bulk_list_users_response.rb +49 -0
- data/lib/courier/models/bulk_retrieve_job_params.rb +20 -0
- data/lib/courier/models/bulk_retrieve_job_response.rb +76 -0
- data/lib/courier/models/bulk_run_job_params.rb +20 -0
- data/lib/courier/models/inbound_bulk_message.rb +91 -0
- data/lib/courier/models/inbound_bulk_message_user.rb +54 -0
- data/lib/courier/models.rb +14 -0
- data/lib/courier/resources/broadcasts.rb +16 -9
- data/lib/courier/resources/bulk.rb +146 -0
- data/lib/courier/resources/send.rb +2 -1
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +11 -0
- data/rbi/courier/client.rbi +3 -0
- data/rbi/courier/models/bulk_add_users_params.rbi +43 -0
- data/rbi/courier/models/bulk_create_job_params.rbi +54 -0
- data/rbi/courier/models/bulk_create_job_response.rbi +26 -0
- data/rbi/courier/models/bulk_list_users_params.rbi +51 -0
- data/rbi/courier/models/bulk_list_users_response.rbi +125 -0
- data/rbi/courier/models/bulk_retrieve_job_params.rbi +35 -0
- data/rbi/courier/models/bulk_retrieve_job_response.rbi +157 -0
- data/rbi/courier/models/bulk_run_job_params.rbi +35 -0
- data/rbi/courier/models/inbound_bulk_message.rbi +124 -0
- data/rbi/courier/models/inbound_bulk_message_user.rbi +88 -0
- data/rbi/courier/models.rbi +14 -0
- data/rbi/courier/resources/broadcasts.rbi +26 -4
- data/rbi/courier/resources/bulk.rbi +107 -0
- data/rbi/courier/resources/send.rbi +2 -1
- data/sig/courier/client.rbs +2 -0
- data/sig/courier/models/bulk_add_users_params.rbs +28 -0
- data/sig/courier/models/bulk_create_job_params.rbs +24 -0
- data/sig/courier/models/bulk_create_job_response.rbs +13 -0
- data/sig/courier/models/bulk_list_users_params.rbs +28 -0
- data/sig/courier/models/bulk_list_users_response.rbs +65 -0
- data/sig/courier/models/bulk_retrieve_job_params.rbs +23 -0
- data/sig/courier/models/bulk_retrieve_job_response.rbs +66 -0
- data/sig/courier/models/bulk_run_job_params.rbs +23 -0
- data/sig/courier/models/inbound_bulk_message.rbs +58 -0
- data/sig/courier/models/inbound_bulk_message_user.rbs +42 -0
- data/sig/courier/models.rbs +14 -0
- data/sig/courier/resources/bulk.rbs +34 -0
- metadata +35 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9f62c9ba0ccf68a6be91bb13460ab3d7ed38815cd7d2827eba3f0b6c5460598b
|
|
4
|
+
data.tar.gz: 7d3026d94cc1db562eb020e2e145eacbb67bd5adeada9e29010e60143bdba7ce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aed6dce51f5f53597c0b64f394f29cec87c693790996d74d7fc6aaac652a724fe31dda9c3068e0c355888349cf0cb2249db1f8c70126c6f4eea85af0c75c70e6
|
|
7
|
+
data.tar.gz: b2b494e23b204e033f15d79fe44aa38b601443a515915955c678770878268e68700793bd1542036c405a7e8b0cef24db72d4d33576dd73bdd94d295bc51fe148
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.26.2](https://github.com/trycourier/courier-ruby/compare/v4.26.1...v4.26.2) (2026-08-13)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Documentation
|
|
7
|
+
|
|
8
|
+
* **api:** describe every broadcast id path parameter ([#120](https://github.com/trycourier/courier-ruby/issues/120)) ([2f4031e](https://github.com/trycourier/courier-ruby/commit/2f4031e65786588609fcf21e8cc7b42b3813eed7))
|
|
9
|
+
* **api:** say what the bulk job endpoints return ([#122](https://github.com/trycourier/courier-ruby/issues/122)) ([e5f3d75](https://github.com/trycourier/courier-ruby/commit/e5f3d7576f1b682fa395d3d7ef05c7dfb69ea922))
|
|
10
|
+
|
|
11
|
+
## [4.26.1](https://github.com/trycourier/courier-ruby/compare/v4.26.0...v4.26.1) (2026-08-13)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Chores
|
|
15
|
+
|
|
16
|
+
* **api:** regenerate SDK ([#115](https://github.com/trycourier/courier-ruby/issues/115)) ([27dadbf](https://github.com/trycourier/courier-ruby/commit/27dadbfd9a49b7f2fe7970d8a63f956f76d484e6))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Documentation
|
|
20
|
+
|
|
21
|
+
* **api:** give every request body an example, and correct the archive status code ([#119](https://github.com/trycourier/courier-ruby/issues/119)) ([b4ad8e9](https://github.com/trycourier/courier-ruby/commit/b4ad8e90341bc2a7a0a34c04aeddcb60a91124e7))
|
|
22
|
+
* sync README from api-spec ([#113](https://github.com/trycourier/courier-ruby/issues/113)) ([8d479fe](https://github.com/trycourier/courier-ruby/commit/8d479fe04eea80c8f307e054e78098fe7cde253e))
|
|
23
|
+
|
|
3
24
|
## 4.26.0 (2026-08-10)
|
|
4
25
|
|
|
5
26
|
Full Changelog: [v4.25.0...v4.26.0](https://github.com/trycourier/courier-ruby/compare/v4.25.0...v4.26.0)
|
data/README.md
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
<!-- AUTO-GENERATED-OVERVIEW:START — Do not edit this section. It is synced from mintlify-docs. -->
|
|
2
1
|
# Courier Ruby SDK
|
|
3
2
|
|
|
4
|
-
The Courier Ruby SDK provides typed access to the Courier REST API from
|
|
3
|
+
The Courier Ruby SDK provides typed access to the Courier REST API from Ruby applications. Use it to send notifications, manage user profiles, check message status, issue JWT tokens for client-side SDKs, and more.
|
|
5
4
|
|
|
6
5
|
## Installation
|
|
7
6
|
|
|
8
|
-
Add to your `Gemfile`:
|
|
7
|
+
Add the gem to your `Gemfile`:
|
|
8
|
+
|
|
9
|
+
<!-- x-release-please-start-version -->
|
|
9
10
|
|
|
10
11
|
```ruby
|
|
11
|
-
gem "trycourier"
|
|
12
|
+
gem "trycourier", "~> 4.26.2"
|
|
12
13
|
```
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
<!-- x-release-please-end -->
|
|
16
|
+
|
|
17
|
+
Then run `bundle install`. Requires Ruby 3.2+.
|
|
15
18
|
|
|
16
19
|
## Quick Start
|
|
17
20
|
|
|
@@ -19,24 +22,20 @@ Then run `bundle install`.
|
|
|
19
22
|
require "bundler/setup"
|
|
20
23
|
require "courier"
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
courier = Courier::Client.new(
|
|
26
|
+
api_key: ENV["COURIER_API_KEY"] # the default, can be omitted
|
|
27
|
+
)
|
|
23
28
|
|
|
24
|
-
response =
|
|
25
|
-
message: {
|
|
26
|
-
to: { email: "you@example.com" },
|
|
27
|
-
content: {
|
|
28
|
-
title: "Hello from Courier!",
|
|
29
|
-
body: "Your first notification, sent with the Ruby SDK."
|
|
30
|
-
}
|
|
31
|
-
}
|
|
29
|
+
response = courier.send_.message(
|
|
30
|
+
message: {to: {user_id: "your_user_id"}, template: "your_template_id", data: {foo: "bar"}}
|
|
32
31
|
)
|
|
33
32
|
|
|
34
|
-
puts
|
|
33
|
+
puts(response.requestId)
|
|
35
34
|
```
|
|
36
35
|
|
|
37
|
-
The client reads `COURIER_API_KEY` from your environment automatically.
|
|
36
|
+
The client reads `COURIER_API_KEY` from your environment automatically.
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
Note the trailing underscore on `send_` — `send` is reserved in Ruby.
|
|
40
39
|
|
|
41
40
|
## Documentation
|
|
42
41
|
|
|
@@ -45,5 +44,3 @@ Full documentation: **[courier.com/docs/sdk-libraries/ruby](https://www.courier.
|
|
|
45
44
|
- [Quickstart](https://www.courier.com/docs/getting-started/quickstart/)
|
|
46
45
|
- [Send API](https://www.courier.com/docs/platform/sending/send-message/)
|
|
47
46
|
- [API Reference](https://www.courier.com/docs/reference/get-started/)
|
|
48
|
-
- [RubyDoc](https://gemdocs.org/gems/trycourier)
|
|
49
|
-
<!-- AUTO-GENERATED-OVERVIEW:END -->
|
data/lib/courier/client.rb
CHANGED
|
@@ -58,6 +58,9 @@ module Courier
|
|
|
58
58
|
# @return [Courier::Resources::Broadcasts]
|
|
59
59
|
attr_reader :broadcasts
|
|
60
60
|
|
|
61
|
+
# @return [Courier::Resources::Bulk]
|
|
62
|
+
attr_reader :bulk
|
|
63
|
+
|
|
61
64
|
# Manage the logos, colors, and layout that give the templates you send a
|
|
62
65
|
# consistent look.
|
|
63
66
|
# @return [Courier::Resources::Brands]
|
|
@@ -187,6 +190,7 @@ module Courier
|
|
|
187
190
|
@automations = Courier::Resources::Automations.new(client: self)
|
|
188
191
|
@journeys = Courier::Resources::Journeys.new(client: self)
|
|
189
192
|
@broadcasts = Courier::Resources::Broadcasts.new(client: self)
|
|
193
|
+
@bulk = Courier::Resources::Bulk.new(client: self)
|
|
190
194
|
@brands = Courier::Resources::Brands.new(client: self)
|
|
191
195
|
@digests = Courier::Resources::Digests.new(client: self)
|
|
192
196
|
@inbound = Courier::Resources::Inbound.new(client: self)
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
|
@@ -0,0 +1,49 @@
|
|
|
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
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Bulk#run_job
|
|
6
|
+
class BulkRunJobParams < 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
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
data/lib/courier/models.rb
CHANGED
|
@@ -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
|
|
@@ -35,7 +35,8 @@ module Courier
|
|
|
35
35
|
#
|
|
36
36
|
# @overload retrieve(broadcast_id, request_options: {})
|
|
37
37
|
#
|
|
38
|
-
# @param broadcast_id [String]
|
|
38
|
+
# @param broadcast_id [String] The broadcast to retrieve, identified by the `id` returned when it was created.
|
|
39
|
+
#
|
|
39
40
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
40
41
|
#
|
|
41
42
|
# @return [Courier::Models::Broadcast]
|
|
@@ -55,7 +56,7 @@ module Courier
|
|
|
55
56
|
#
|
|
56
57
|
# @overload update(broadcast_id, name:, request_options: {})
|
|
57
58
|
#
|
|
58
|
-
# @param broadcast_id [String]
|
|
59
|
+
# @param broadcast_id [String] The broadcast to rename.
|
|
59
60
|
#
|
|
60
61
|
# @param name [String] New human-readable name.
|
|
61
62
|
#
|
|
@@ -106,7 +107,8 @@ module Courier
|
|
|
106
107
|
#
|
|
107
108
|
# @overload archive(broadcast_id, request_options: {})
|
|
108
109
|
#
|
|
109
|
-
# @param broadcast_id [String]
|
|
110
|
+
# @param broadcast_id [String] The broadcast to archive.
|
|
111
|
+
#
|
|
110
112
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
111
113
|
#
|
|
112
114
|
# @return [Courier::Models::Broadcast]
|
|
@@ -126,7 +128,8 @@ module Courier
|
|
|
126
128
|
#
|
|
127
129
|
# @overload cancel(broadcast_id, request_options: {})
|
|
128
130
|
#
|
|
129
|
-
# @param broadcast_id [String]
|
|
131
|
+
# @param broadcast_id [String] The broadcast to cancel.
|
|
132
|
+
#
|
|
130
133
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
131
134
|
#
|
|
132
135
|
# @return [Courier::Models::Broadcast]
|
|
@@ -141,12 +144,16 @@ module Courier
|
|
|
141
144
|
)
|
|
142
145
|
end
|
|
143
146
|
|
|
147
|
+
# Some parameter documentations has been truncated, see
|
|
148
|
+
# {Courier::Models::BroadcastDuplicateParams} for more details.
|
|
149
|
+
#
|
|
144
150
|
# Duplicate a broadcast (and its template) into a new draft named "{source name}
|
|
145
151
|
# (copy)".
|
|
146
152
|
#
|
|
147
153
|
# @overload duplicate(broadcast_id, request_options: {})
|
|
148
154
|
#
|
|
149
|
-
# @param broadcast_id [String]
|
|
155
|
+
# @param broadcast_id [String] The broadcast to copy. The duplicate is created as a new draft and this broadcas
|
|
156
|
+
#
|
|
150
157
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
151
158
|
#
|
|
152
159
|
# @return [Courier::Models::Broadcast]
|
|
@@ -167,7 +174,7 @@ module Courier
|
|
|
167
174
|
#
|
|
168
175
|
# @overload put_content(broadcast_id, content:, state: nil, request_options: {})
|
|
169
176
|
#
|
|
170
|
-
# @param broadcast_id [String]
|
|
177
|
+
# @param broadcast_id [String] The broadcast whose content you want to replace.
|
|
171
178
|
#
|
|
172
179
|
# @param content [Courier::Models::NotificationContentPutRequest::Content] Elemental content payload. The server defaults `version` when omitted.
|
|
173
180
|
#
|
|
@@ -198,7 +205,7 @@ module Courier
|
|
|
198
205
|
#
|
|
199
206
|
# @overload retrieve_content(broadcast_id, version: nil, request_options: {})
|
|
200
207
|
#
|
|
201
|
-
# @param broadcast_id [String]
|
|
208
|
+
# @param broadcast_id [String] The broadcast whose content you want to read.
|
|
202
209
|
#
|
|
203
210
|
# @param version [String] Accepts `draft`, `published`, or a version string (e.g. `v001`). Defaults to `dr
|
|
204
211
|
#
|
|
@@ -228,7 +235,7 @@ module Courier
|
|
|
228
235
|
#
|
|
229
236
|
# @overload schedule(broadcast_id, recipient_id:, recipient_type:, scheduled_to:, timezone: nil, request_options: {})
|
|
230
237
|
#
|
|
231
|
-
# @param broadcast_id [String]
|
|
238
|
+
# @param broadcast_id [String] The broadcast to schedule.
|
|
232
239
|
#
|
|
233
240
|
# @param recipient_id [String] ID of the target list or audience.
|
|
234
241
|
#
|
|
@@ -259,7 +266,7 @@ module Courier
|
|
|
259
266
|
#
|
|
260
267
|
# @overload send_(broadcast_id, recipient_id:, recipient_type:, request_options: {})
|
|
261
268
|
#
|
|
262
|
-
# @param broadcast_id [String]
|
|
269
|
+
# @param broadcast_id [String] The broadcast to send.
|
|
263
270
|
#
|
|
264
271
|
# @param recipient_id [String] ID of the target list or audience.
|
|
265
272
|
#
|