trycourier 4.9.0 → 4.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/lib/courier/internal/util.rb +3 -1
- data/lib/courier/models/associated_notification_list_response.rb +24 -0
- data/lib/courier/models/element_with_checksums.rb +60 -0
- data/lib/courier/models/notification_content_get_response.rb +26 -0
- data/lib/courier/models/notification_content_mutation_response.rb +61 -0
- data/lib/courier/models/notification_content_put_request.rb +51 -0
- data/lib/courier/models/notification_element_put_request.rb +62 -0
- data/lib/courier/models/notification_get_content.rb +0 -1
- data/lib/courier/models/notification_locale_put_request.rb +39 -0
- data/lib/courier/models/notification_put_content_params.rb +20 -0
- data/lib/courier/models/notification_put_element_params.rb +26 -0
- data/lib/courier/models/notification_put_locale_params.rb +26 -0
- data/lib/courier/models/notification_retrieve_content_params.rb +14 -1
- data/lib/courier/models/notification_retrieve_content_response.rb +21 -0
- data/lib/courier/models/notification_template_get_response.rb +1 -1
- data/lib/courier/models/notification_template_state.rb +16 -0
- data/lib/courier/models/provider_update_params.rb +3 -2
- data/lib/courier/models/routing_strategy_get_response.rb +1 -1
- data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
- data/lib/courier/models.rb +24 -4
- data/lib/courier/resources/notifications.rb +128 -13
- data/lib/courier/resources/providers.rb +7 -5
- data/lib/courier/resources/routing_strategies.rb +32 -4
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +13 -4
- data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
- data/rbi/courier/models/element_with_checksums.rbi +109 -0
- data/rbi/courier/models/notification_content_get_response.rbi +45 -0
- data/rbi/courier/models/notification_content_mutation_response.rbi +95 -0
- data/rbi/courier/models/notification_content_put_request.rbi +145 -0
- data/rbi/courier/models/notification_element_put_request.rbi +98 -0
- data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
- data/rbi/courier/models/notification_put_content_params.rbi +38 -0
- data/rbi/courier/models/notification_put_element_params.rbi +46 -0
- data/rbi/courier/models/notification_put_locale_params.rbi +46 -0
- data/rbi/courier/models/notification_retrieve_content_params.rbi +21 -2
- data/rbi/courier/models/notification_retrieve_content_response.rbi +29 -0
- data/rbi/courier/models/notification_template_state.rbi +26 -0
- data/rbi/courier/models/provider_update_params.rbi +4 -2
- data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
- data/rbi/courier/models.rbi +28 -6
- data/rbi/courier/resources/notifications.rbi +105 -7
- data/rbi/courier/resources/providers.rbi +7 -4
- data/rbi/courier/resources/routing_strategies.rbi +23 -2
- data/sig/courier/models/associated_notification_list_response.rbs +25 -0
- data/sig/courier/models/element_with_checksums.rbs +60 -0
- data/sig/courier/models/notification_content_get_response.rbs +22 -0
- data/sig/courier/models/notification_content_mutation_response.rbs +47 -0
- data/sig/courier/models/notification_content_put_request.rbs +50 -0
- data/sig/courier/models/notification_element_put_request.rbs +64 -0
- data/sig/courier/models/notification_locale_put_request.rbs +39 -0
- data/sig/courier/models/notification_put_content_params.rbs +22 -0
- data/sig/courier/models/notification_put_element_params.rbs +32 -0
- data/sig/courier/models/notification_put_locale_params.rbs +32 -0
- data/sig/courier/models/notification_retrieve_content_params.rbs +12 -2
- data/sig/courier/models/notification_retrieve_content_response.rbs +12 -0
- data/sig/courier/models/notification_template_state.rbs +14 -0
- data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
- data/sig/courier/models.rbs +24 -4
- data/sig/courier/resources/notifications.rbs +32 -5
- data/sig/courier/resources/routing_strategies.rbs +9 -2
- metadata +41 -14
- data/lib/courier/models/notification_template_mutation_response.rb +0 -51
- data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
- data/lib/courier/models/routing_strategy_mutation_response.rb +0 -19
- data/lib/courier/resources/notifications/draft.rb +0 -33
- data/rbi/courier/models/notification_template_mutation_response.rbi +0 -121
- data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
- data/rbi/courier/models/routing_strategy_mutation_response.rbi +0 -31
- data/rbi/courier/resources/notifications/draft.rbi +0 -23
- data/sig/courier/models/notification_template_mutation_response.rbs +0 -46
- data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
- data/sig/courier/models/routing_strategy_mutation_response.rbs +0 -13
- data/sig/courier/resources/notifications/draft.rbs +0 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f858f38c4f9b150bb7ae15d41485742e215ee802b55ebf66eaa03f2fbd1ac02
|
|
4
|
+
data.tar.gz: 42e013bd3562dfcce1b12bd980c02f481cd7f8c5290d364e16a3a395d957569b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 91849f5ef3635836ff2976f9bbcad8f337464d89aea6728e377a3c39b45db79116cb2bf13b0946f3d1ed98fa8f584b8e8a38fa0cd52b6cc186563e203c2ad583
|
|
7
|
+
data.tar.gz: 4dcd5c0b990e1e4e121078106637462a3894d5d8b5350bf1074e1101f695d7782e63691144d1255e680b4feeb1c15c91e3ac04bf9eb499593e4914828ce9e088
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.10.1 (2026-04-13)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.10.0...v4.10.1](https://github.com/trycourier/courier-ruby/compare/v4.10.0...v4.10.1)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* multipart encoding for file arrays ([6f54534](https://github.com/trycourier/courier-ruby/commit/6f545347ec738929c45b89476d4fc02aa185760b))
|
|
10
|
+
* **types:** correct notifications/routing_strategies return types, remove mutation models ([8020a8f](https://github.com/trycourier/courier-ruby/commit/8020a8fa2015d5f5b4c4703a4354acd3283193bc))
|
|
11
|
+
|
|
12
|
+
## 4.10.0 (2026-04-08)
|
|
13
|
+
|
|
14
|
+
Full Changelog: [v4.9.0...v4.10.0](https://github.com/trycourier/courier-ruby/compare/v4.9.0...v4.10.0)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **api:** add list_notifications method to routing_strategies ([ce8f121](https://github.com/trycourier/courier-ruby/commit/ce8f1217d52377144e053e51497310e71fef1dea))
|
|
19
|
+
* **api:** add put_content/put_element/put_locale, remove draft resource, update retrieve_content ([ecb21e4](https://github.com/trycourier/courier-ruby/commit/ecb21e4913ec80513471153abab2e75d80afffb5))
|
|
20
|
+
|
|
3
21
|
## 4.9.0 (2026-04-01)
|
|
4
22
|
|
|
5
23
|
Full Changelog: [v4.8.0...v4.9.0](https://github.com/trycourier/courier-ruby/compare/v4.8.0...v4.9.0)
|
|
@@ -610,6 +610,7 @@ module Courier
|
|
|
610
610
|
#
|
|
611
611
|
# @return [Array(String, Enumerable<String>)]
|
|
612
612
|
private def encode_multipart_streaming(body)
|
|
613
|
+
# rubocop:disable Style/CaseEquality
|
|
613
614
|
# RFC 1521 Section 7.2.1 says we should have 70 char maximum for boundary length
|
|
614
615
|
boundary = SecureRandom.urlsafe_base64(46)
|
|
615
616
|
|
|
@@ -619,7 +620,7 @@ module Courier
|
|
|
619
620
|
in Hash
|
|
620
621
|
body.each do |key, val|
|
|
621
622
|
case val
|
|
622
|
-
in Array if val.all? { primitive?(_1) }
|
|
623
|
+
in Array if val.all? { primitive?(_1) || Courier::Internal::Type::FileInput === _1 }
|
|
623
624
|
val.each do |v|
|
|
624
625
|
write_multipart_chunk(y, boundary: boundary, key: key, val: v, closing: closing)
|
|
625
626
|
end
|
|
@@ -635,6 +636,7 @@ module Courier
|
|
|
635
636
|
|
|
636
637
|
fused_io = fused_enum(strio) { closing.each(&:call) }
|
|
637
638
|
[boundary, fused_io]
|
|
639
|
+
# rubocop:enable Style/CaseEquality
|
|
638
640
|
end
|
|
639
641
|
|
|
640
642
|
# @api private
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::RoutingStrategies#list_notifications
|
|
6
|
+
class AssociatedNotificationListResponse < 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::NotificationTemplateSummary>]
|
|
15
|
+
required :results, -> { Courier::Internal::Type::ArrayOf[Courier::NotificationTemplateSummary] }
|
|
16
|
+
|
|
17
|
+
# @!method initialize(paging:, results:)
|
|
18
|
+
# Paginated list of notification templates associated with a routing strategy.
|
|
19
|
+
#
|
|
20
|
+
# @param paging [Courier::Models::Paging]
|
|
21
|
+
# @param results [Array<Courier::Models::NotificationTemplateSummary>]
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementWithChecksums < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute checksum
|
|
7
|
+
# MD5 hash of translatable content.
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :checksum, String
|
|
11
|
+
|
|
12
|
+
# @!attribute type
|
|
13
|
+
# Element type (text, meta, action, etc.).
|
|
14
|
+
#
|
|
15
|
+
# @return [String]
|
|
16
|
+
required :type, String
|
|
17
|
+
|
|
18
|
+
# @!attribute id
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :id, String
|
|
22
|
+
|
|
23
|
+
# @!attribute elements
|
|
24
|
+
# Nested child elements (for group-type elements).
|
|
25
|
+
#
|
|
26
|
+
# @return [Array<Courier::Models::ElementWithChecksums>, nil]
|
|
27
|
+
optional :elements, -> { Courier::Internal::Type::ArrayOf[Courier::ElementWithChecksums] }
|
|
28
|
+
|
|
29
|
+
# @!attribute locales
|
|
30
|
+
# Locale-specific content with checksums.
|
|
31
|
+
#
|
|
32
|
+
# @return [Hash{Symbol=>Courier::Models::ElementWithChecksums::Locale}, nil]
|
|
33
|
+
optional :locales, -> { Courier::Internal::Type::HashOf[Courier::ElementWithChecksums::Locale] }
|
|
34
|
+
|
|
35
|
+
# @!method initialize(checksum:, type:, id: nil, elements: nil, locales: nil)
|
|
36
|
+
# An element with its content checksum and optional nested elements and locale
|
|
37
|
+
# checksums.
|
|
38
|
+
#
|
|
39
|
+
# @param checksum [String] MD5 hash of translatable content.
|
|
40
|
+
#
|
|
41
|
+
# @param type [String] Element type (text, meta, action, etc.).
|
|
42
|
+
#
|
|
43
|
+
# @param id [String]
|
|
44
|
+
#
|
|
45
|
+
# @param elements [Array<Courier::Models::ElementWithChecksums>] Nested child elements (for group-type elements).
|
|
46
|
+
#
|
|
47
|
+
# @param locales [Hash{Symbol=>Courier::Models::ElementWithChecksums::Locale}] Locale-specific content with checksums.
|
|
48
|
+
|
|
49
|
+
class Locale < Courier::Internal::Type::BaseModel
|
|
50
|
+
# @!attribute checksum
|
|
51
|
+
#
|
|
52
|
+
# @return [String]
|
|
53
|
+
required :checksum, String
|
|
54
|
+
|
|
55
|
+
# @!method initialize(checksum:)
|
|
56
|
+
# @param checksum [String]
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationContentGetResponse < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute elements
|
|
7
|
+
#
|
|
8
|
+
# @return [Array<Courier::Models::ElementWithChecksums>]
|
|
9
|
+
required :elements, -> { Courier::Internal::Type::ArrayOf[Courier::ElementWithChecksums] }
|
|
10
|
+
|
|
11
|
+
# @!attribute version
|
|
12
|
+
# Content version identifier.
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
required :version, String
|
|
16
|
+
|
|
17
|
+
# @!method initialize(elements:, version:)
|
|
18
|
+
# Elemental content response for V2 templates. Contains versioned elements with
|
|
19
|
+
# content checksums.
|
|
20
|
+
#
|
|
21
|
+
# @param elements [Array<Courier::Models::ElementWithChecksums>]
|
|
22
|
+
#
|
|
23
|
+
# @param version [String] Content version identifier.
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#put_content
|
|
6
|
+
class NotificationContentMutationResponse < Courier::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute id
|
|
8
|
+
# Template ID.
|
|
9
|
+
#
|
|
10
|
+
# @return [String]
|
|
11
|
+
required :id, String
|
|
12
|
+
|
|
13
|
+
# @!attribute elements
|
|
14
|
+
#
|
|
15
|
+
# @return [Array<Courier::Models::NotificationContentMutationResponse::Element>]
|
|
16
|
+
required :elements,
|
|
17
|
+
-> { Courier::Internal::Type::ArrayOf[Courier::NotificationContentMutationResponse::Element] }
|
|
18
|
+
|
|
19
|
+
# @!attribute state
|
|
20
|
+
# Template state. Defaults to `DRAFT`.
|
|
21
|
+
#
|
|
22
|
+
# @return [Symbol, Courier::Models::NotificationTemplateState]
|
|
23
|
+
required :state, enum: -> { Courier::NotificationTemplateState }
|
|
24
|
+
|
|
25
|
+
# @!attribute version
|
|
26
|
+
# Content version identifier.
|
|
27
|
+
#
|
|
28
|
+
# @return [String]
|
|
29
|
+
required :version, String
|
|
30
|
+
|
|
31
|
+
# @!method initialize(id:, elements:, state:, version:)
|
|
32
|
+
# Shared mutation response for `PUT` content, `PUT` element, and `PUT` locale
|
|
33
|
+
# operations. Contains the template ID, content version, per-element checksums,
|
|
34
|
+
# and resulting state.
|
|
35
|
+
#
|
|
36
|
+
# @param id [String] Template ID.
|
|
37
|
+
#
|
|
38
|
+
# @param elements [Array<Courier::Models::NotificationContentMutationResponse::Element>]
|
|
39
|
+
#
|
|
40
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateState] Template state. Defaults to `DRAFT`.
|
|
41
|
+
#
|
|
42
|
+
# @param version [String] Content version identifier.
|
|
43
|
+
|
|
44
|
+
class Element < Courier::Internal::Type::BaseModel
|
|
45
|
+
# @!attribute id
|
|
46
|
+
#
|
|
47
|
+
# @return [String]
|
|
48
|
+
required :id, String
|
|
49
|
+
|
|
50
|
+
# @!attribute checksum
|
|
51
|
+
#
|
|
52
|
+
# @return [String]
|
|
53
|
+
required :checksum, String
|
|
54
|
+
|
|
55
|
+
# @!method initialize(id:, checksum:)
|
|
56
|
+
# @param id [String]
|
|
57
|
+
# @param checksum [String]
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationContentPutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute content
|
|
7
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
8
|
+
#
|
|
9
|
+
# @return [Courier::Models::NotificationContentPutRequest::Content]
|
|
10
|
+
required :content, -> { Courier::NotificationContentPutRequest::Content }
|
|
11
|
+
|
|
12
|
+
# @!attribute state
|
|
13
|
+
# Template state. Defaults to `DRAFT`.
|
|
14
|
+
#
|
|
15
|
+
# @return [Symbol, Courier::Models::NotificationTemplateState, nil]
|
|
16
|
+
optional :state, enum: -> { Courier::NotificationTemplateState }
|
|
17
|
+
|
|
18
|
+
# @!method initialize(content:, state: nil)
|
|
19
|
+
# Request body for replacing the elemental content of a notification template.
|
|
20
|
+
#
|
|
21
|
+
# @param content [Courier::Models::NotificationContentPutRequest::Content] Elemental content payload. The server defaults `version` when omitted.
|
|
22
|
+
#
|
|
23
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateState] Template state. Defaults to `DRAFT`.
|
|
24
|
+
|
|
25
|
+
# @see Courier::Models::NotificationContentPutRequest#content
|
|
26
|
+
class Content < Courier::Internal::Type::BaseModel
|
|
27
|
+
# @!attribute elements
|
|
28
|
+
#
|
|
29
|
+
# @return [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType, Courier::Models::ElementalHTMLNodeWithType>]
|
|
30
|
+
required :elements, -> { Courier::Internal::Type::ArrayOf[union: Courier::ElementalNode] }
|
|
31
|
+
|
|
32
|
+
# @!attribute version
|
|
33
|
+
# Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
34
|
+
# omitted.
|
|
35
|
+
#
|
|
36
|
+
# @return [String, nil]
|
|
37
|
+
optional :version, String
|
|
38
|
+
|
|
39
|
+
# @!method initialize(elements:, version: nil)
|
|
40
|
+
# Some parameter documentations has been truncated, see
|
|
41
|
+
# {Courier::Models::NotificationContentPutRequest::Content} for more details.
|
|
42
|
+
#
|
|
43
|
+
# Elemental content payload. The server defaults `version` when omitted.
|
|
44
|
+
#
|
|
45
|
+
# @param elements [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType, Courier::Models::ElementalHTMLNodeWithType>]
|
|
46
|
+
#
|
|
47
|
+
# @param version [String] Content version identifier (e.g., `2022-01-01`). Optional; server defaults when
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationElementPutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute type
|
|
7
|
+
# Element type (text, meta, action, image, etc.).
|
|
8
|
+
#
|
|
9
|
+
# @return [String]
|
|
10
|
+
required :type, String
|
|
11
|
+
|
|
12
|
+
# @!attribute channels
|
|
13
|
+
#
|
|
14
|
+
# @return [Array<String>, nil]
|
|
15
|
+
optional :channels, Courier::Internal::Type::ArrayOf[String]
|
|
16
|
+
|
|
17
|
+
# @!attribute data
|
|
18
|
+
#
|
|
19
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
20
|
+
optional :data, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
|
|
21
|
+
|
|
22
|
+
# @!attribute if_
|
|
23
|
+
#
|
|
24
|
+
# @return [String, nil]
|
|
25
|
+
optional :if_, String, api_name: :if
|
|
26
|
+
|
|
27
|
+
# @!attribute loop_
|
|
28
|
+
#
|
|
29
|
+
# @return [String, nil]
|
|
30
|
+
optional :loop_, String, api_name: :loop
|
|
31
|
+
|
|
32
|
+
# @!attribute ref
|
|
33
|
+
#
|
|
34
|
+
# @return [String, nil]
|
|
35
|
+
optional :ref, String
|
|
36
|
+
|
|
37
|
+
# @!attribute state
|
|
38
|
+
# Template state. Defaults to `DRAFT`.
|
|
39
|
+
#
|
|
40
|
+
# @return [Symbol, Courier::Models::NotificationTemplateState, nil]
|
|
41
|
+
optional :state, enum: -> { Courier::NotificationTemplateState }
|
|
42
|
+
|
|
43
|
+
# @!method initialize(type:, channels: nil, data: nil, if_: nil, loop_: nil, ref: nil, state: nil)
|
|
44
|
+
# Request body for updating a single element. Additional type-specific fields are
|
|
45
|
+
# allowed.
|
|
46
|
+
#
|
|
47
|
+
# @param type [String] Element type (text, meta, action, image, etc.).
|
|
48
|
+
#
|
|
49
|
+
# @param channels [Array<String>]
|
|
50
|
+
#
|
|
51
|
+
# @param data [Hash{Symbol=>Object}]
|
|
52
|
+
#
|
|
53
|
+
# @param if_ [String]
|
|
54
|
+
#
|
|
55
|
+
# @param loop_ [String]
|
|
56
|
+
#
|
|
57
|
+
# @param ref [String]
|
|
58
|
+
#
|
|
59
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateState] Template state. Defaults to `DRAFT`.
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class NotificationLocalePutRequest < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute elements
|
|
7
|
+
# Elements with locale-specific content overrides.
|
|
8
|
+
#
|
|
9
|
+
# @return [Array<Courier::Models::NotificationLocalePutRequest::Element>]
|
|
10
|
+
required :elements,
|
|
11
|
+
-> { Courier::Internal::Type::ArrayOf[Courier::NotificationLocalePutRequest::Element] }
|
|
12
|
+
|
|
13
|
+
# @!attribute state
|
|
14
|
+
# Template state. Defaults to `DRAFT`.
|
|
15
|
+
#
|
|
16
|
+
# @return [Symbol, Courier::Models::NotificationTemplateState, nil]
|
|
17
|
+
optional :state, enum: -> { Courier::NotificationTemplateState }
|
|
18
|
+
|
|
19
|
+
# @!method initialize(elements:, state: nil)
|
|
20
|
+
# Request body for setting locale-specific content overrides. Each element
|
|
21
|
+
# override must include the target element ID.
|
|
22
|
+
#
|
|
23
|
+
# @param elements [Array<Courier::Models::NotificationLocalePutRequest::Element>] Elements with locale-specific content overrides.
|
|
24
|
+
#
|
|
25
|
+
# @param state [Symbol, Courier::Models::NotificationTemplateState] Template state. Defaults to `DRAFT`.
|
|
26
|
+
|
|
27
|
+
class Element < Courier::Internal::Type::BaseModel
|
|
28
|
+
# @!attribute id
|
|
29
|
+
# Target element ID.
|
|
30
|
+
#
|
|
31
|
+
# @return [String]
|
|
32
|
+
required :id, String
|
|
33
|
+
|
|
34
|
+
# @!method initialize(id:)
|
|
35
|
+
# @param id [String] Target element ID.
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#put_content
|
|
6
|
+
class NotificationPutContentParams < Courier::Models::NotificationContentPutRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!method initialize(id:, request_options: {})
|
|
16
|
+
# @param id [String]
|
|
17
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#put_element
|
|
6
|
+
class NotificationPutElementParams < Courier::Models::NotificationElementPutRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute element_id
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
required :element_id, String
|
|
19
|
+
|
|
20
|
+
# @!method initialize(id:, element_id:, request_options: {})
|
|
21
|
+
# @param id [String]
|
|
22
|
+
# @param element_id [String]
|
|
23
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#put_locale
|
|
6
|
+
class NotificationPutLocaleParams < Courier::Models::NotificationLocalePutRequest
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute locale_id
|
|
16
|
+
#
|
|
17
|
+
# @return [String]
|
|
18
|
+
required :locale_id, String
|
|
19
|
+
|
|
20
|
+
# @!method initialize(id:, locale_id:, request_options: {})
|
|
21
|
+
# @param id [String]
|
|
22
|
+
# @param locale_id [String]
|
|
23
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -12,8 +12,21 @@ module Courier
|
|
|
12
12
|
# @return [String]
|
|
13
13
|
required :id, String
|
|
14
14
|
|
|
15
|
-
# @!
|
|
15
|
+
# @!attribute version
|
|
16
|
+
# Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to
|
|
17
|
+
# `published`.
|
|
18
|
+
#
|
|
19
|
+
# @return [String, nil]
|
|
20
|
+
optional :version, String
|
|
21
|
+
|
|
22
|
+
# @!method initialize(id:, version: nil, request_options: {})
|
|
23
|
+
# Some parameter documentations has been truncated, see
|
|
24
|
+
# {Courier::Models::NotificationRetrieveContentParams} for more details.
|
|
25
|
+
#
|
|
16
26
|
# @param id [String]
|
|
27
|
+
#
|
|
28
|
+
# @param version [String] Accepts `draft`, `published`, or a version string (e.g., `v001`). Defaults to `p
|
|
29
|
+
#
|
|
17
30
|
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
18
31
|
end
|
|
19
32
|
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Elemental content response for V2 templates. Contains versioned elements with
|
|
6
|
+
# content checksums.
|
|
7
|
+
#
|
|
8
|
+
# @see Courier::Resources::Notifications#retrieve_content
|
|
9
|
+
module NotificationRetrieveContentResponse
|
|
10
|
+
extend Courier::Internal::Type::Union
|
|
11
|
+
|
|
12
|
+
# Elemental content response for V2 templates. Contains versioned elements with content checksums.
|
|
13
|
+
variant -> { Courier::NotificationContentGetResponse }
|
|
14
|
+
|
|
15
|
+
variant -> { Courier::NotificationGetContent }
|
|
16
|
+
|
|
17
|
+
# @!method self.variants
|
|
18
|
+
# @return [Array(Courier::Models::NotificationContentGetResponse, Courier::Models::NotificationGetContent)]
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
|
-
# @see Courier::Resources::Notifications#
|
|
5
|
+
# @see Courier::Resources::Notifications#create
|
|
6
6
|
class NotificationTemplateGetResponse < Courier::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute created
|
|
8
8
|
# Epoch milliseconds when the template was created.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# Template state. Defaults to `DRAFT`.
|
|
6
|
+
module NotificationTemplateState
|
|
7
|
+
extend Courier::Internal::Type::Enum
|
|
8
|
+
|
|
9
|
+
DRAFT = :DRAFT
|
|
10
|
+
PUBLISHED = :PUBLISHED
|
|
11
|
+
|
|
12
|
+
# @!method self.values
|
|
13
|
+
# @return [Array<Symbol>]
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -13,7 +13,8 @@ module Courier
|
|
|
13
13
|
required :id, String
|
|
14
14
|
|
|
15
15
|
# @!attribute provider
|
|
16
|
-
# The provider key identifying the type.
|
|
16
|
+
# The provider key identifying the type. Required on every request because it
|
|
17
|
+
# selects the provider-specific settings schema for validation.
|
|
17
18
|
#
|
|
18
19
|
# @return [String]
|
|
19
20
|
required :provider, String
|
|
@@ -44,7 +45,7 @@ module Courier
|
|
|
44
45
|
#
|
|
45
46
|
# @param id [String]
|
|
46
47
|
#
|
|
47
|
-
# @param provider [String] The provider key identifying the type.
|
|
48
|
+
# @param provider [String] The provider key identifying the type. Required on every request because it sele
|
|
48
49
|
#
|
|
49
50
|
# @param alias_ [String] Updated alias. Omit to clear.
|
|
50
51
|
#
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Courier
|
|
4
4
|
module Models
|
|
5
|
-
# @see Courier::Resources::RoutingStrategies#
|
|
5
|
+
# @see Courier::Resources::RoutingStrategies#create
|
|
6
6
|
class RoutingStrategyGetResponse < Courier::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute id
|
|
8
8
|
# The routing strategy ID (rs\_ prefix).
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::RoutingStrategies#list_notifications
|
|
6
|
+
class RoutingStrategyListNotificationsParams < Courier::Internal::Type::BaseModel
|
|
7
|
+
extend Courier::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include Courier::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute id
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
required :id, String
|
|
14
|
+
|
|
15
|
+
# @!attribute cursor
|
|
16
|
+
# Opaque pagination cursor from a previous response. Omit for the first page.
|
|
17
|
+
#
|
|
18
|
+
# @return [String, nil]
|
|
19
|
+
optional :cursor, String, nil?: true
|
|
20
|
+
|
|
21
|
+
# @!attribute limit
|
|
22
|
+
# Maximum number of results per page. Default 20, max 100.
|
|
23
|
+
#
|
|
24
|
+
# @return [Integer, nil]
|
|
25
|
+
optional :limit, Integer
|
|
26
|
+
|
|
27
|
+
# @!method initialize(id:, cursor: nil, limit: nil, request_options: {})
|
|
28
|
+
# @param id [String]
|
|
29
|
+
#
|
|
30
|
+
# @param cursor [String, nil] Opaque pagination cursor from a previous response. Omit for the first page.
|
|
31
|
+
#
|
|
32
|
+
# @param limit [Integer] Maximum number of results per page. Default 20, max 100.
|
|
33
|
+
#
|
|
34
|
+
# @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|