trycourier 4.22.0 → 4.23.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/courier/client.rb +4 -0
- data/lib/courier/models/broadcast.rb +132 -0
- data/lib/courier/models/broadcast_archive_params.rb +20 -0
- data/lib/courier/models/broadcast_cancel_params.rb +20 -0
- data/lib/courier/models/broadcast_create_params.rb +14 -0
- data/lib/courier/models/broadcast_duplicate_params.rb +20 -0
- data/lib/courier/models/broadcast_list_params.rb +30 -0
- data/lib/courier/models/broadcast_list_response.rb +24 -0
- data/lib/courier/models/broadcast_put_content_params.rb +20 -0
- data/lib/courier/models/broadcast_retrieve_content_params.rb +33 -0
- data/lib/courier/models/broadcast_retrieve_params.rb +20 -0
- data/lib/courier/models/broadcast_schedule.rb +59 -0
- data/lib/courier/models/broadcast_schedule_params.rb +20 -0
- data/lib/courier/models/broadcast_send_params.rb +20 -0
- data/lib/courier/models/broadcast_update_params.rb +20 -0
- data/lib/courier/models/create_broadcast_request.rb +43 -0
- data/lib/courier/models/schedule_broadcast_request.rb +59 -0
- data/lib/courier/models/send_broadcast_request.rb +39 -0
- data/lib/courier/models/update_broadcast_request.rb +18 -0
- data/lib/courier/models.rb +36 -0
- data/lib/courier/resources/broadcasts.rb +290 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +20 -1
- data/rbi/courier/client.rbi +3 -0
- data/rbi/courier/models/broadcast.rbi +164 -0
- data/rbi/courier/models/broadcast_archive_params.rbi +35 -0
- data/rbi/courier/models/broadcast_cancel_params.rbi +35 -0
- data/rbi/courier/models/broadcast_create_params.rbi +27 -0
- data/rbi/courier/models/broadcast_duplicate_params.rbi +35 -0
- data/rbi/courier/models/broadcast_list_params.rbi +54 -0
- data/rbi/courier/models/broadcast_list_response.rbi +39 -0
- data/rbi/courier/models/broadcast_put_content_params.rbi +35 -0
- data/rbi/courier/models/broadcast_retrieve_content_params.rbi +57 -0
- data/rbi/courier/models/broadcast_retrieve_params.rbi +35 -0
- data/rbi/courier/models/broadcast_schedule.rbi +92 -0
- data/rbi/courier/models/broadcast_schedule_params.rbi +35 -0
- data/rbi/courier/models/broadcast_send_params.rbi +35 -0
- data/rbi/courier/models/broadcast_update_params.rbi +35 -0
- data/rbi/courier/models/create_broadcast_request.rbi +81 -0
- data/rbi/courier/models/schedule_broadcast_request.rbi +103 -0
- data/rbi/courier/models/send_broadcast_request.rbi +77 -0
- data/rbi/courier/models/update_broadcast_request.rbi +28 -0
- data/rbi/courier/models.rbi +37 -0
- data/rbi/courier/resources/broadcasts.rbi +199 -0
- data/sig/courier/client.rbs +2 -0
- data/sig/courier/models/broadcast.rbs +98 -0
- data/sig/courier/models/broadcast_archive_params.rbs +23 -0
- data/sig/courier/models/broadcast_cancel_params.rbs +23 -0
- data/sig/courier/models/broadcast_create_params.rbs +15 -0
- data/sig/courier/models/broadcast_duplicate_params.rbs +23 -0
- data/sig/courier/models/broadcast_list_params.rbs +30 -0
- data/sig/courier/models/broadcast_list_response.rbs +22 -0
- data/sig/courier/models/broadcast_put_content_params.rbs +25 -0
- data/sig/courier/models/broadcast_retrieve_content_params.rbs +30 -0
- data/sig/courier/models/broadcast_retrieve_params.rbs +23 -0
- data/sig/courier/models/broadcast_schedule.rbs +46 -0
- data/sig/courier/models/broadcast_schedule_params.rbs +25 -0
- data/sig/courier/models/broadcast_send_params.rbs +25 -0
- data/sig/courier/models/broadcast_update_params.rbs +25 -0
- data/sig/courier/models/create_broadcast_request.rbs +40 -0
- data/sig/courier/models/schedule_broadcast_request.rbs +48 -0
- data/sig/courier/models/send_broadcast_request.rbs +36 -0
- data/sig/courier/models/update_broadcast_request.rbs +13 -0
- data/sig/courier/models.rbs +36 -0
- data/sig/courier/resources/broadcasts.rbs +74 -0
- metadata +58 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 309ea61f0125b25e2bbafb9fc11e87220259bd66b2af26971ccb657a60f24b7c
|
|
4
|
+
data.tar.gz: 529a8bf37ffa589a91591aff67e192fe4429263ab008d0f156cdf8aca00e7933
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf7596a35ed847033067727fe8699e6a22fd57e927f560b8e81fb43618bc32ca5166d571782a478ba48d6b6bed7ef16878bcc842d78fb3804c81754f169d7e8e
|
|
7
|
+
data.tar.gz: f807364e550ef500ae2a837aa7fcd657d6163dd6b71b67cd303c15e09d6f308240c08470cf69b15fcdfa96e91e818d19f65a0f2ad5518881e21b33c6fe2d96d0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.23.0 (2026-07-29)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.22.0...v4.23.0](https://github.com/trycourier/courier-ruby/compare/v4.22.0...v4.23.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **broadcasts:** document Broadcasts CRUD REST API ([#170](https://github.com/trycourier/courier-ruby/issues/170)) ([122e598](https://github.com/trycourier/courier-ruby/commit/122e5984cc48c30473a81fd3003c4fd899fc1cc6))
|
|
10
|
+
|
|
3
11
|
## 4.22.0 (2026-07-29)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v4.21.0...v4.22.0](https://github.com/trycourier/courier-ruby/compare/v4.21.0...v4.22.0)
|
data/lib/courier/client.rb
CHANGED
|
@@ -53,6 +53,9 @@ module Courier
|
|
|
53
53
|
# @return [Courier::Resources::Journeys]
|
|
54
54
|
attr_reader :journeys
|
|
55
55
|
|
|
56
|
+
# @return [Courier::Resources::Broadcasts]
|
|
57
|
+
attr_reader :broadcasts
|
|
58
|
+
|
|
56
59
|
# Manage the logos, colors, and layout that give the templates you send a
|
|
57
60
|
# consistent look.
|
|
58
61
|
# @return [Courier::Resources::Brands]
|
|
@@ -184,6 +187,7 @@ module Courier
|
|
|
184
187
|
@auth = Courier::Resources::Auth.new(client: self)
|
|
185
188
|
@automations = Courier::Resources::Automations.new(client: self)
|
|
186
189
|
@journeys = Courier::Resources::Journeys.new(client: self)
|
|
190
|
+
@broadcasts = Courier::Resources::Broadcasts.new(client: self)
|
|
187
191
|
@brands = Courier::Resources::Brands.new(client: self)
|
|
188
192
|
@digests = Courier::Resources::Digests.new(client: self)
|
|
189
193
|
@inbound = Courier::Resources::Inbound.new(client: self)
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#create
|
|
6
|
+
class Broadcast < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# The broadcast ID (bst\_ prefix).
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute channel
|
|
14
|
+
# The broadcast's delivery channel.
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, Courier::Models::Broadcast::Channel]
|
|
17
|
+
required :channel, enum: -> { Courier::Broadcast::Channel }
|
|
18
|
+
|
|
19
|
+
# @!attribute created_at
|
|
20
|
+
# ISO 8601 timestamp when the broadcast was created.
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :created_at, String
|
|
24
|
+
|
|
25
|
+
# @!attribute created_by
|
|
26
|
+
# Actor that created the broadcast.
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :created_by, String
|
|
30
|
+
|
|
31
|
+
# @!attribute name
|
|
32
|
+
# Human-readable name.
|
|
33
|
+
#
|
|
34
|
+
# @return [String]
|
|
35
|
+
required :name, String
|
|
36
|
+
|
|
37
|
+
# @!attribute status
|
|
38
|
+
# Lifecycle status of the broadcast.
|
|
39
|
+
#
|
|
40
|
+
# @return [Symbol, Courier::Models::Broadcast::Status]
|
|
41
|
+
required :status, enum: -> { Courier::Broadcast::Status }
|
|
42
|
+
|
|
43
|
+
# @!attribute updated_at
|
|
44
|
+
# ISO 8601 timestamp of the last update.
|
|
45
|
+
#
|
|
46
|
+
# @return [String]
|
|
47
|
+
required :updated_at, String
|
|
48
|
+
|
|
49
|
+
# @!attribute updated_by
|
|
50
|
+
# Actor that last updated the broadcast.
|
|
51
|
+
#
|
|
52
|
+
# @return [String]
|
|
53
|
+
required :updated_by, String
|
|
54
|
+
|
|
55
|
+
# @!attribute archived_at
|
|
56
|
+
# ISO 8601 timestamp when the broadcast was archived, if archived.
|
|
57
|
+
#
|
|
58
|
+
# @return [String, nil]
|
|
59
|
+
optional :archived_at, String, nil?: true
|
|
60
|
+
|
|
61
|
+
# @!attribute archived_by
|
|
62
|
+
# Actor that archived the broadcast, if archived.
|
|
63
|
+
#
|
|
64
|
+
# @return [String, nil]
|
|
65
|
+
optional :archived_by, String, nil?: true
|
|
66
|
+
|
|
67
|
+
# @!attribute schedule
|
|
68
|
+
# The delivery schedule and recipient targeting for a broadcast.
|
|
69
|
+
#
|
|
70
|
+
# @return [Courier::Models::BroadcastSchedule, nil]
|
|
71
|
+
optional :schedule, -> { Courier::BroadcastSchedule }, nil?: true
|
|
72
|
+
|
|
73
|
+
# @!method initialize(id:, channel:, created_at:, created_by:, name:, status:, updated_at:, updated_by:, archived_at: nil, archived_by: nil, schedule: nil)
|
|
74
|
+
# A broadcast — a single-channel message delivered to a known set of recipients (a
|
|
75
|
+
# list or audience).
|
|
76
|
+
#
|
|
77
|
+
# @param id [String] The broadcast ID (bst\_ prefix).
|
|
78
|
+
#
|
|
79
|
+
# @param channel [Symbol, Courier::Models::Broadcast::Channel] The broadcast's delivery channel.
|
|
80
|
+
#
|
|
81
|
+
# @param created_at [String] ISO 8601 timestamp when the broadcast was created.
|
|
82
|
+
#
|
|
83
|
+
# @param created_by [String] Actor that created the broadcast.
|
|
84
|
+
#
|
|
85
|
+
# @param name [String] Human-readable name.
|
|
86
|
+
#
|
|
87
|
+
# @param status [Symbol, Courier::Models::Broadcast::Status] Lifecycle status of the broadcast.
|
|
88
|
+
#
|
|
89
|
+
# @param updated_at [String] ISO 8601 timestamp of the last update.
|
|
90
|
+
#
|
|
91
|
+
# @param updated_by [String] Actor that last updated the broadcast.
|
|
92
|
+
#
|
|
93
|
+
# @param archived_at [String, nil] ISO 8601 timestamp when the broadcast was archived, if archived.
|
|
94
|
+
#
|
|
95
|
+
# @param archived_by [String, nil] Actor that archived the broadcast, if archived.
|
|
96
|
+
#
|
|
97
|
+
# @param schedule [Courier::Models::BroadcastSchedule, nil] The delivery schedule and recipient targeting for a broadcast.
|
|
98
|
+
|
|
99
|
+
# The broadcast's delivery channel.
|
|
100
|
+
#
|
|
101
|
+
# @see Courier::Models::Broadcast#channel
|
|
102
|
+
module Channel
|
|
103
|
+
extend Courier::Internal::Type::Enum
|
|
104
|
+
|
|
105
|
+
EMAIL = :email
|
|
106
|
+
SMS = :sms
|
|
107
|
+
PUSH = :push
|
|
108
|
+
INBOX = :inbox
|
|
109
|
+
SLACK = :slack
|
|
110
|
+
MSTEAMS = :msteams
|
|
111
|
+
|
|
112
|
+
# @!method self.values
|
|
113
|
+
# @return [Array<Symbol>]
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Lifecycle status of the broadcast.
|
|
117
|
+
#
|
|
118
|
+
# @see Courier::Models::Broadcast#status
|
|
119
|
+
module Status
|
|
120
|
+
extend Courier::Internal::Type::Enum
|
|
121
|
+
|
|
122
|
+
DRAFT = :draft
|
|
123
|
+
SCHEDULED = :scheduled
|
|
124
|
+
SENDING = :sending
|
|
125
|
+
SENT = :sent
|
|
126
|
+
|
|
127
|
+
# @!method self.values
|
|
128
|
+
# @return [Array<Symbol>]
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#archive
|
|
6
|
+
class BroadcastArchiveParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#cancel
|
|
6
|
+
class BroadcastCancelParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#create
|
|
6
|
+
class BroadcastCreateParams < Courier::Models::CreateBroadcastRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!method initialize(request_options: {})
|
|
11
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#duplicate
|
|
6
|
+
class BroadcastDuplicateParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#list
|
|
6
|
+
class BroadcastListParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute cursor
|
|
11
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
12
|
+
#
|
|
13
|
+
# @return [String, nil]
|
|
14
|
+
optional :cursor, String, nil?: true
|
|
15
|
+
|
|
16
|
+
# @!attribute limit
|
|
17
|
+
# Maximum number of results per page.
|
|
18
|
+
#
|
|
19
|
+
# @return [Integer, nil]
|
|
20
|
+
optional :limit, Integer
|
|
21
|
+
|
|
22
|
+
# @!method initialize(cursor: nil, limit: nil, request_options: {})
|
|
23
|
+
# @param cursor [String, nil] Opaque pagination cursor from a previous response. Omit for the first page.
|
|
24
|
+
#
|
|
25
|
+
# @param limit [Integer] Maximum number of results per page.
|
|
26
|
+
#
|
|
27
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#list
|
|
6
|
+
class BroadcastListResponse < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute paging
|
|
8
|
+
#
|
|
9
|
+
# @return [Courier::Models::Paging]
|
|
10
|
+
required :paging, -> { Courier::Paging }
|
|
11
|
+
|
|
12
|
+
# @!attribute results
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<Courier::Models::Broadcast>]
|
|
15
|
+
required :results, -> { Courier::Internal::Type::ArrayOf[Courier::Broadcast] }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(paging:, results:)
|
|
18
|
+
# Paginated list of broadcasts.
|
|
19
|
+
#
|
|
20
|
+
# @param paging [Courier::Models::Paging]
|
|
21
|
+
# @param results [Array<Courier::Models::Broadcast>]
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#put_content
|
|
6
|
+
class BroadcastPutContentParams < Courier::Models::NotificationContentPutRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#retrieve_content
|
|
6
|
+
class BroadcastRetrieveContentParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute version
|
|
16
|
+
# Accepts `draft`, `published`, or a version string (e.g. `v001`). Defaults to
|
|
17
|
+
# `draft`.
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :version, String
|
|
21
|
+
|
|
22
|
+
# @!method initialize(broadcast_id:, version: nil, request_options: {})
|
|
23
|
+
# Some parameter documentations has been truncated, see
|
|
24
|
+
# {Courier::Models::BroadcastRetrieveContentParams} for more details.
|
|
25
|
+
#
|
|
26
|
+
# @param broadcast_id [String]
|
|
27
|
+
#
|
|
28
|
+
# @param version [String] Accepts `draft`, `published`, or a version string (e.g. `v001`). Defaults to `dr
|
|
29
|
+
#
|
|
30
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#retrieve
|
|
6
|
+
class BroadcastRetrieveParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class BroadcastSchedule < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute recipient_id
|
|
7
|
+
# ID of the target list or audience.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :recipient_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute recipient_type
|
|
13
|
+
# Whether the broadcast targets a list or an audience.
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Courier::Models::BroadcastSchedule::RecipientType]
|
|
16
|
+
required :recipient_type, enum: -> { Courier::BroadcastSchedule::RecipientType }
|
|
17
|
+
|
|
18
|
+
# @!attribute scheduled_to
|
|
19
|
+
# Wall-clock timestamp of the scheduled send, no timezone offset (e.g.
|
|
20
|
+
# "2026-07-21T20:00:00").
|
|
21
|
+
#
|
|
22
|
+
# @return [String, nil]
|
|
23
|
+
optional :scheduled_to, String, nil?: true
|
|
24
|
+
|
|
25
|
+
# @!attribute timezone
|
|
26
|
+
# IANA timezone for the scheduled send (e.g. America/New_York).
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
optional :timezone, String, nil?: true
|
|
30
|
+
|
|
31
|
+
# @!method initialize(recipient_id:, recipient_type:, scheduled_to: nil, timezone: nil)
|
|
32
|
+
# Some parameter documentations has been truncated, see
|
|
33
|
+
# {Courier::Models::BroadcastSchedule} for more details.
|
|
34
|
+
#
|
|
35
|
+
# The delivery schedule and recipient targeting for a broadcast.
|
|
36
|
+
#
|
|
37
|
+
# @param recipient_id [String] ID of the target list or audience.
|
|
38
|
+
#
|
|
39
|
+
# @param recipient_type [Symbol, Courier::Models::BroadcastSchedule::RecipientType] Whether the broadcast targets a list or an audience.
|
|
40
|
+
#
|
|
41
|
+
# @param scheduled_to [String, nil] Wall-clock timestamp of the scheduled send, no timezone offset (e.g. "2026-07-21
|
|
42
|
+
#
|
|
43
|
+
# @param timezone [String, nil] IANA timezone for the scheduled send (e.g. America/New_York).
|
|
44
|
+
|
|
45
|
+
# Whether the broadcast targets a list or an audience.
|
|
46
|
+
#
|
|
47
|
+
# @see Courier::Models::BroadcastSchedule#recipient_type
|
|
48
|
+
module RecipientType
|
|
49
|
+
extend Courier::Internal::Type::Enum
|
|
50
|
+
|
|
51
|
+
LIST = :list
|
|
52
|
+
AUDIENCE = :audience
|
|
53
|
+
|
|
54
|
+
# @!method self.values
|
|
55
|
+
# @return [Array<Symbol>]
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#schedule
|
|
6
|
+
class BroadcastScheduleParams < Courier::Models::ScheduleBroadcastRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#send_
|
|
6
|
+
class BroadcastSendParams < Courier::Models::SendBroadcastRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Broadcasts#update
|
|
6
|
+
class BroadcastUpdateParams < Courier::Models::UpdateBroadcastRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute broadcast_id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :broadcast_id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(broadcast_id:, request_options: {})
|
|
16
|
+
# @param broadcast_id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class CreateBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute channel
|
|
7
|
+
# The single delivery channel for this broadcast.
|
|
8
|
+
#
|
|
9
|
+
# @return [Symbol, Courier::Models::CreateBroadcastRequest::Channel]
|
|
10
|
+
required :channel, enum: -> { Courier::CreateBroadcastRequest::Channel }
|
|
11
|
+
|
|
12
|
+
# @!attribute name
|
|
13
|
+
# Human-readable name.
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
required :name, String
|
|
17
|
+
|
|
18
|
+
# @!method initialize(channel:, name:)
|
|
19
|
+
# Request body for creating a broadcast.
|
|
20
|
+
#
|
|
21
|
+
# @param channel [Symbol, Courier::Models::CreateBroadcastRequest::Channel] The single delivery channel for this broadcast.
|
|
22
|
+
#
|
|
23
|
+
# @param name [String] Human-readable name.
|
|
24
|
+
|
|
25
|
+
# The single delivery channel for this broadcast.
|
|
26
|
+
#
|
|
27
|
+
# @see Courier::Models::CreateBroadcastRequest#channel
|
|
28
|
+
module Channel
|
|
29
|
+
extend Courier::Internal::Type::Enum
|
|
30
|
+
|
|
31
|
+
EMAIL = :email
|
|
32
|
+
SMS = :sms
|
|
33
|
+
PUSH = :push
|
|
34
|
+
INBOX = :inbox
|
|
35
|
+
SLACK = :slack
|
|
36
|
+
MSTEAMS = :msteams
|
|
37
|
+
|
|
38
|
+
# @!method self.values
|
|
39
|
+
# @return [Array<Symbol>]
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ScheduleBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute recipient_id
|
|
7
|
+
# ID of the target list or audience.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :recipient_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute recipient_type
|
|
13
|
+
# Whether the broadcast targets a list or an audience.
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Courier::Models::ScheduleBroadcastRequest::RecipientType]
|
|
16
|
+
required :recipient_type, enum: -> { Courier::ScheduleBroadcastRequest::RecipientType }
|
|
17
|
+
|
|
18
|
+
# @!attribute scheduled_to
|
|
19
|
+
# Wall-clock timestamp of the future send, no timezone offset (e.g.
|
|
20
|
+
# "2026-07-21T20:00:00"). The zone is given by `timezone`.
|
|
21
|
+
#
|
|
22
|
+
# @return [String]
|
|
23
|
+
required :scheduled_to, String
|
|
24
|
+
|
|
25
|
+
# @!attribute timezone
|
|
26
|
+
# IANA timezone for the scheduled send (e.g. America/New_York).
|
|
27
|
+
#
|
|
28
|
+
# @return [String, nil]
|
|
29
|
+
optional :timezone, String
|
|
30
|
+
|
|
31
|
+
# @!method initialize(recipient_id:, recipient_type:, scheduled_to:, timezone: nil)
|
|
32
|
+
# Some parameter documentations has been truncated, see
|
|
33
|
+
# {Courier::Models::ScheduleBroadcastRequest} for more details.
|
|
34
|
+
#
|
|
35
|
+
# Request body for scheduling a broadcast for a future send.
|
|
36
|
+
#
|
|
37
|
+
# @param recipient_id [String] ID of the target list or audience.
|
|
38
|
+
#
|
|
39
|
+
# @param recipient_type [Symbol, Courier::Models::ScheduleBroadcastRequest::RecipientType] Whether the broadcast targets a list or an audience.
|
|
40
|
+
#
|
|
41
|
+
# @param scheduled_to [String] Wall-clock timestamp of the future send, no timezone offset (e.g. "2026-07-21T20
|
|
42
|
+
#
|
|
43
|
+
# @param timezone [String] IANA timezone for the scheduled send (e.g. America/New_York).
|
|
44
|
+
|
|
45
|
+
# Whether the broadcast targets a list or an audience.
|
|
46
|
+
#
|
|
47
|
+
# @see Courier::Models::ScheduleBroadcastRequest#recipient_type
|
|
48
|
+
module RecipientType
|
|
49
|
+
extend Courier::Internal::Type::Enum
|
|
50
|
+
|
|
51
|
+
LIST = :list
|
|
52
|
+
AUDIENCE = :audience
|
|
53
|
+
|
|
54
|
+
# @!method self.values
|
|
55
|
+
# @return [Array<Symbol>]
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class SendBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute recipient_id
|
|
7
|
+
# ID of the target list or audience.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :recipient_id, String
|
|
11
|
+
|
|
12
|
+
# @!attribute recipient_type
|
|
13
|
+
# Whether the broadcast targets a list or an audience.
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Courier::Models::SendBroadcastRequest::RecipientType]
|
|
16
|
+
required :recipient_type, enum: -> { Courier::SendBroadcastRequest::RecipientType }
|
|
17
|
+
|
|
18
|
+
# @!method initialize(recipient_id:, recipient_type:)
|
|
19
|
+
# Request body for sending a broadcast immediately.
|
|
20
|
+
#
|
|
21
|
+
# @param recipient_id [String] ID of the target list or audience.
|
|
22
|
+
#
|
|
23
|
+
# @param recipient_type [Symbol, Courier::Models::SendBroadcastRequest::RecipientType] Whether the broadcast targets a list or an audience.
|
|
24
|
+
|
|
25
|
+
# Whether the broadcast targets a list or an audience.
|
|
26
|
+
#
|
|
27
|
+
# @see Courier::Models::SendBroadcastRequest#recipient_type
|
|
28
|
+
module RecipientType
|
|
29
|
+
extend Courier::Internal::Type::Enum
|
|
30
|
+
|
|
31
|
+
LIST = :list
|
|
32
|
+
AUDIENCE = :audience
|
|
33
|
+
|
|
34
|
+
# @!method self.values
|
|
35
|
+
# @return [Array<Symbol>]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class UpdateBroadcastRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute name
|
|
7
|
+
# New human-readable name.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :name, String
|
|
11
|
+
|
|
12
|
+
# @!method initialize(name:)
|
|
13
|
+
# Request body for updating a broadcast. Only the name is mutable.
|
|
14
|
+
#
|
|
15
|
+
# @param name [String] New human-readable name.
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|