trycourier 4.8.0 → 4.10.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 +41 -0
- data/README.md +1 -1
- data/lib/courier/client.rb +8 -0
- data/lib/courier/internal/util.rb +19 -6
- data/lib/courier/models/associated_notification_list_response.rb +24 -0
- data/lib/courier/models/channel.rb +75 -0
- data/lib/courier/models/channel_metadata.rb +15 -0
- data/lib/courier/models/element_with_checksums.rb +60 -0
- data/lib/courier/models/elemental_content.rb +2 -2
- data/lib/courier/models/elemental_html_node_with_type.rb +24 -0
- data/lib/courier/models/elemental_node.rb +3 -1
- data/lib/courier/models/message_channels.rb +8 -0
- data/lib/courier/models/message_providers.rb +8 -0
- data/lib/courier/models/message_providers_type.rb +38 -0
- data/lib/courier/models/metadata.rb +15 -0
- data/lib/courier/models/notification_archive_params.rb +20 -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_create_params.rb +14 -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_list_params.rb +13 -4
- data/lib/courier/models/notification_list_response.rb +108 -93
- data/lib/courier/models/notification_list_versions_params.rb +37 -0
- data/lib/courier/models/notification_locale_put_request.rb +39 -0
- data/lib/courier/models/notification_publish_params.rb +20 -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_replace_params.rb +20 -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_retrieve_params.rb +33 -0
- data/lib/courier/models/notification_template_create_request.rb +45 -0
- data/lib/courier/models/notification_template_get_response.rb +92 -0
- data/lib/courier/models/notification_template_mutation_response.rb +51 -0
- data/lib/courier/models/notification_template_payload.rb +98 -0
- data/lib/courier/models/notification_template_publish_request.rb +19 -0
- data/lib/courier/models/notification_template_state.rb +16 -0
- data/lib/courier/models/notification_template_summary.rb +81 -0
- data/lib/courier/models/notification_template_update_request.rb +46 -0
- data/lib/courier/models/notification_template_version_list_response.rb +22 -0
- data/lib/courier/models/provider.rb +67 -0
- data/lib/courier/models/provider_create_params.rb +52 -0
- data/lib/courier/models/provider_delete_params.rb +20 -0
- data/lib/courier/models/provider_list_params.rb +22 -0
- data/lib/courier/models/provider_list_response.rb +24 -0
- data/lib/courier/models/provider_retrieve_params.rb +20 -0
- data/lib/courier/models/provider_update_params.rb +58 -0
- data/lib/courier/models/providers/catalog_list_params.rb +44 -0
- data/lib/courier/models/providers/catalog_list_response.rb +26 -0
- data/lib/courier/models/providers_catalog_entry.rb +86 -0
- data/lib/courier/models/routing_strategy_archive_params.rb +20 -0
- data/lib/courier/models/routing_strategy_create_params.rb +14 -0
- data/lib/courier/models/routing_strategy_create_request.rb +58 -0
- data/lib/courier/models/routing_strategy_get_response.rb +99 -0
- data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
- data/lib/courier/models/routing_strategy_list_params.rb +30 -0
- data/lib/courier/models/routing_strategy_list_response.rb +24 -0
- data/lib/courier/models/routing_strategy_mutation_response.rb +19 -0
- data/lib/courier/models/routing_strategy_replace_params.rb +20 -0
- data/lib/courier/models/routing_strategy_replace_request.rb +59 -0
- data/lib/courier/models/routing_strategy_retrieve_params.rb +20 -0
- data/lib/courier/models/routing_strategy_summary.rb +75 -0
- data/lib/courier/models/send_message_params.rb +6 -154
- data/lib/courier/models/tenant_template_input.rb +6 -152
- data/lib/courier/models/timeouts.rb +21 -0
- data/lib/courier/models/version_node.rb +46 -0
- data/lib/courier/models.rb +110 -0
- data/lib/courier/resources/notifications.rb +289 -12
- data/lib/courier/resources/providers/catalog.rb +49 -0
- data/lib/courier/resources/providers.rb +150 -0
- data/lib/courier/resources/routing_strategies.rb +179 -0
- data/lib/courier/version.rb +1 -1
- data/lib/courier.rb +60 -2
- data/rbi/courier/client.rbi +6 -0
- data/rbi/courier/internal/util.rbi +8 -0
- data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
- data/rbi/courier/models/channel.rbi +106 -0
- data/rbi/courier/models/channel_metadata.rbi +28 -0
- data/rbi/courier/models/element_with_checksums.rbi +109 -0
- data/rbi/courier/models/elemental_content.rbi +6 -3
- data/rbi/courier/models/elemental_html_node_with_type.rbi +59 -0
- data/rbi/courier/models/elemental_node.rbi +2 -1
- data/rbi/courier/models/message_channels.rbi +11 -0
- data/rbi/courier/models/message_providers.rbi +11 -0
- data/rbi/courier/models/message_providers_type.rbi +60 -0
- data/rbi/courier/models/metadata.rbi +26 -0
- data/rbi/courier/models/notification_archive_params.rbi +35 -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_create_params.rbi +27 -0
- data/rbi/courier/models/notification_element_put_request.rbi +98 -0
- data/rbi/courier/models/notification_list_params.rbi +15 -2
- data/rbi/courier/models/notification_list_response.rbi +159 -119
- data/rbi/courier/models/notification_list_versions_params.rbi +66 -0
- data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
- data/rbi/courier/models/notification_publish_params.rbi +35 -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_replace_params.rbi +35 -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_retrieve_params.rbi +54 -0
- data/rbi/courier/models/notification_template_create_request.rbi +102 -0
- data/rbi/courier/models/notification_template_get_response.rbi +162 -0
- data/rbi/courier/models/notification_template_mutation_response.rbi +121 -0
- data/rbi/courier/models/notification_template_payload.rbi +183 -0
- data/rbi/courier/models/notification_template_publish_request.rbi +35 -0
- data/rbi/courier/models/notification_template_state.rbi +26 -0
- data/rbi/courier/models/notification_template_summary.rbi +124 -0
- data/rbi/courier/models/notification_template_update_request.rbi +103 -0
- data/rbi/courier/models/notification_template_version_list_response.rbi +41 -0
- data/rbi/courier/models/provider.rbi +87 -0
- data/rbi/courier/models/provider_create_params.rbi +82 -0
- data/rbi/courier/models/provider_delete_params.rbi +35 -0
- data/rbi/courier/models/provider_list_params.rbi +43 -0
- data/rbi/courier/models/provider_list_response.rbi +42 -0
- data/rbi/courier/models/provider_retrieve_params.rbi +35 -0
- data/rbi/courier/models/provider_update_params.rbi +86 -0
- data/rbi/courier/models/providers/catalog_list_params.rbi +75 -0
- data/rbi/courier/models/providers/catalog_list_response.rbi +47 -0
- data/rbi/courier/models/providers_catalog_entry.rbi +129 -0
- data/rbi/courier/models/routing_strategy_archive_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_create_params.rbi +30 -0
- data/rbi/courier/models/routing_strategy_create_request.rbi +86 -0
- data/rbi/courier/models/routing_strategy_get_response.rbi +121 -0
- data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
- data/rbi/courier/models/routing_strategy_list_params.rbi +54 -0
- data/rbi/courier/models/routing_strategy_list_response.rbi +45 -0
- data/rbi/courier/models/routing_strategy_mutation_response.rbi +31 -0
- data/rbi/courier/models/routing_strategy_replace_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_replace_request.rbi +87 -0
- data/rbi/courier/models/routing_strategy_retrieve_params.rbi +38 -0
- data/rbi/courier/models/routing_strategy_summary.rbi +95 -0
- data/rbi/courier/models/send_message_params.rbi +6 -362
- data/rbi/courier/models/tenant_template_input.rbi +8 -336
- data/rbi/courier/models/timeouts.rbi +33 -0
- data/rbi/courier/models/version_node.rbi +65 -0
- data/rbi/courier/models.rbi +122 -0
- data/rbi/courier/resources/notifications.rbi +222 -6
- data/rbi/courier/resources/providers/catalog.rbi +38 -0
- data/rbi/courier/resources/providers.rbi +116 -0
- data/rbi/courier/resources/routing_strategies.rbi +147 -0
- data/sig/courier/client.rbs +4 -0
- data/sig/courier/internal/util.rbs +4 -0
- data/sig/courier/models/associated_notification_list_response.rbs +25 -0
- data/sig/courier/models/channel.rbs +61 -0
- data/sig/courier/models/channel_metadata.rbs +13 -0
- data/sig/courier/models/element_with_checksums.rbs +60 -0
- data/sig/courier/models/elemental_html_node_with_type.rbs +32 -0
- data/sig/courier/models/elemental_node.rbs +1 -0
- data/sig/courier/models/message_channels.rbs +7 -0
- data/sig/courier/models/message_providers.rbs +7 -0
- data/sig/courier/models/message_providers_type.rbs +35 -0
- data/sig/courier/models/metadata.rbs +13 -0
- data/sig/courier/models/notification_archive_params.rbs +20 -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_create_params.rbs +15 -0
- data/sig/courier/models/notification_element_put_request.rbs +64 -0
- data/sig/courier/models/notification_list_params.rbs +7 -1
- data/sig/courier/models/notification_list_response.rbs +81 -71
- data/sig/courier/models/notification_list_versions_params.rbs +36 -0
- data/sig/courier/models/notification_locale_put_request.rbs +39 -0
- data/sig/courier/models/notification_publish_params.rbs +22 -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_replace_params.rbs +22 -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_retrieve_params.rbs +30 -0
- data/sig/courier/models/notification_template_create_request.rbs +40 -0
- data/sig/courier/models/notification_template_get_response.rbs +72 -0
- data/sig/courier/models/notification_template_mutation_response.rbs +46 -0
- data/sig/courier/models/notification_template_payload.rbs +75 -0
- data/sig/courier/models/notification_template_publish_request.rbs +15 -0
- data/sig/courier/models/notification_template_state.rbs +14 -0
- data/sig/courier/models/notification_template_summary.rbs +70 -0
- data/sig/courier/models/notification_template_update_request.rbs +40 -0
- data/sig/courier/models/notification_template_version_list_response.rbs +22 -0
- data/sig/courier/models/provider.rbs +52 -0
- data/sig/courier/models/provider_create_params.rbs +47 -0
- data/sig/courier/models/provider_delete_params.rbs +20 -0
- data/sig/courier/models/provider_list_params.rbs +25 -0
- data/sig/courier/models/provider_list_response.rbs +22 -0
- data/sig/courier/models/provider_retrieve_params.rbs +20 -0
- data/sig/courier/models/provider_update_params.rbs +52 -0
- data/sig/courier/models/providers/catalog_list_params.rbs +40 -0
- data/sig/courier/models/providers/catalog_list_response.rbs +27 -0
- data/sig/courier/models/providers_catalog_entry.rbs +64 -0
- data/sig/courier/models/routing_strategy_archive_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_create_params.rbs +15 -0
- data/sig/courier/models/routing_strategy_create_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_get_response.rbs +70 -0
- data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
- data/sig/courier/models/routing_strategy_list_params.rbs +30 -0
- data/sig/courier/models/routing_strategy_list_response.rbs +25 -0
- data/sig/courier/models/routing_strategy_mutation_response.rbs +13 -0
- data/sig/courier/models/routing_strategy_replace_params.rbs +22 -0
- data/sig/courier/models/routing_strategy_replace_request.rbs +45 -0
- data/sig/courier/models/routing_strategy_retrieve_params.rbs +20 -0
- data/sig/courier/models/routing_strategy_summary.rbs +55 -0
- data/sig/courier/models/send_message_params.rbs +8 -130
- data/sig/courier/models/tenant_template_input.rbs +12 -134
- data/sig/courier/models/timeouts.rbs +15 -0
- data/sig/courier/models/version_node.rbs +32 -0
- data/sig/courier/models.rbs +108 -0
- data/sig/courier/resources/notifications.rbs +65 -3
- data/sig/courier/resources/providers/catalog.rbs +16 -0
- data/sig/courier/resources/providers.rbs +38 -0
- data/sig/courier/resources/routing_strategies.rbs +48 -0
- metadata +182 -8
- data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
- data/lib/courier/resources/notifications/draft.rb +0 -33
- data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
- data/rbi/courier/resources/notifications/draft.rbi +0 -23
- data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
- 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: d71ef55224ae3a498561c16171a3a2f4d7043cdd17d9c505ef34e70179a6c35b
|
|
4
|
+
data.tar.gz: da26b63925075f65d3d953a4a810ea535431e65274528b902000121d928c7fcb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 237604be72c50aa572c525addf58d4e3f723142ffbd5863c9dfb301882bf9efa4c77e4eae7a143cafc3ed1981fb0602be0bb7a1046d4be8e5587c2c15988fd52
|
|
7
|
+
data.tar.gz: cfdb4b9bcf90da1d34e9aabbe994404f49e6df75d4d56368509034b60ceb55eb0461d492cbaf2d2cb7a4b92e17f54a6050f7b605a0f2c00a8b9788c6142255d1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.10.0 (2026-04-08)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v4.9.0...v4.10.0](https://github.com/trycourier/courier-ruby/compare/v4.9.0...v4.10.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** add list_notifications method to routing_strategies ([ce8f121](https://github.com/trycourier/courier-ruby/commit/ce8f1217d52377144e053e51497310e71fef1dea))
|
|
10
|
+
* **api:** add put_content/put_element/put_locale, remove draft resource, update retrieve_content ([ecb21e4](https://github.com/trycourier/courier-ruby/commit/ecb21e4913ec80513471153abab2e75d80afffb5))
|
|
11
|
+
|
|
12
|
+
## 4.9.0 (2026-04-01)
|
|
13
|
+
|
|
14
|
+
Full Changelog: [v4.8.0...v4.9.0](https://github.com/trycourier/courier-ruby/compare/v4.8.0...v4.9.0)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **api:** add html variant to elemental_node union ([a5a5a5d](https://github.com/trycourier/courier-ruby/commit/a5a5a5d025d5ddb27a79872b15efaaa08785b032))
|
|
19
|
+
* **api:** add notification template CRUD methods, update list params/types ([4861f87](https://github.com/trycourier/courier-ruby/commit/4861f87ead15aba7b148dc8d2790fe2d018157c9))
|
|
20
|
+
* **api:** add providers resource with create/retrieve/update/list/delete and catalog ([5191261](https://github.com/trycourier/courier-ruby/commit/519126120e84dea8276094325e49d350eff3f7bc))
|
|
21
|
+
* **api:** add routing_strategies resource with create/retrieve/list/replace/archive ([6c64599](https://github.com/trycourier/courier-ruby/commit/6c645999dd54ac75bdb777745363d662f7d9da64))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* align path encoding with RFC 3986 section 3.3 ([916afaa](https://github.com/trycourier/courier-ruby/commit/916afaafd525d4d77a42a0739e892c4d4cf5d933))
|
|
27
|
+
* **internal:** correct multipart form field name encoding ([7925b72](https://github.com/trycourier/courier-ruby/commit/7925b72544622783dd17527da1729f6f48ddb744))
|
|
28
|
+
* variable name typo ([1f59fd2](https://github.com/trycourier/courier-ruby/commit/1f59fd2c73459908b337b98135efbd79bf0bfb9a))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Chores
|
|
32
|
+
|
|
33
|
+
* **ci:** skip lint on metadata-only changes ([22a3e8d](https://github.com/trycourier/courier-ruby/commit/22a3e8d5bbfe6953bca20ba54b7bb2007f4f37c0))
|
|
34
|
+
* **ci:** support opting out of skipping builds on metadata-only commits ([a6c047e](https://github.com/trycourier/courier-ruby/commit/a6c047eaa9730f8c398082cd422bf0bc1087e882))
|
|
35
|
+
* **internal:** tweak CI branches ([08eccfe](https://github.com/trycourier/courier-ruby/commit/08eccfe4c37358304a97686df7248dc02f6ea0f4))
|
|
36
|
+
* **internal:** update gitignore ([95860ac](https://github.com/trycourier/courier-ruby/commit/95860acf54c665132e957913d0fc6187cadaf64c))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Documentation
|
|
40
|
+
|
|
41
|
+
* add AGENTS.md for AI coding assistants ([#81](https://github.com/trycourier/courier-ruby/issues/81)) ([ff1b8c2](https://github.com/trycourier/courier-ruby/commit/ff1b8c2e58007e1ccd5e631e07f28daf2027cef2))
|
|
42
|
+
* sync README from mintlify-docs (2026-03-23 19:54 UTC) ([#79](https://github.com/trycourier/courier-ruby/issues/79)) ([4b83d99](https://github.com/trycourier/courier-ruby/commit/4b83d99126c8ddedf8e137cfc683bc6be998cc35))
|
|
43
|
+
|
|
3
44
|
## 4.8.0 (2026-03-12)
|
|
4
45
|
|
|
5
46
|
Full Changelog: [v4.7.1...v4.8.0](https://github.com/trycourier/courier-ruby/compare/v4.7.1...v4.8.0)
|
data/README.md
CHANGED
data/lib/courier/client.rb
CHANGED
|
@@ -24,6 +24,9 @@ module Courier
|
|
|
24
24
|
# @return [Courier::Resources::Audiences]
|
|
25
25
|
attr_reader :audiences
|
|
26
26
|
|
|
27
|
+
# @return [Courier::Resources::Providers]
|
|
28
|
+
attr_reader :providers
|
|
29
|
+
|
|
27
30
|
# @return [Courier::Resources::AuditEvents]
|
|
28
31
|
attr_reader :audit_events
|
|
29
32
|
|
|
@@ -57,6 +60,9 @@ module Courier
|
|
|
57
60
|
# @return [Courier::Resources::Notifications]
|
|
58
61
|
attr_reader :notifications
|
|
59
62
|
|
|
63
|
+
# @return [Courier::Resources::RoutingStrategies]
|
|
64
|
+
attr_reader :routing_strategies
|
|
65
|
+
|
|
60
66
|
# @return [Courier::Resources::Profiles]
|
|
61
67
|
attr_reader :profiles
|
|
62
68
|
|
|
@@ -118,6 +124,7 @@ module Courier
|
|
|
118
124
|
|
|
119
125
|
@send_ = Courier::Resources::Send.new(client: self)
|
|
120
126
|
@audiences = Courier::Resources::Audiences.new(client: self)
|
|
127
|
+
@providers = Courier::Resources::Providers.new(client: self)
|
|
121
128
|
@audit_events = Courier::Resources::AuditEvents.new(client: self)
|
|
122
129
|
@auth = Courier::Resources::Auth.new(client: self)
|
|
123
130
|
@automations = Courier::Resources::Automations.new(client: self)
|
|
@@ -129,6 +136,7 @@ module Courier
|
|
|
129
136
|
@messages = Courier::Resources::Messages.new(client: self)
|
|
130
137
|
@requests = Courier::Resources::Requests.new(client: self)
|
|
131
138
|
@notifications = Courier::Resources::Notifications.new(client: self)
|
|
139
|
+
@routing_strategies = Courier::Resources::RoutingStrategies.new(client: self)
|
|
132
140
|
@profiles = Courier::Resources::Profiles.new(client: self)
|
|
133
141
|
@tenants = Courier::Resources::Tenants.new(client: self)
|
|
134
142
|
@translations = Courier::Resources::Translations.new(client: self)
|
|
@@ -157,7 +157,7 @@ module Courier
|
|
|
157
157
|
in Hash | nil => coerced
|
|
158
158
|
coerced
|
|
159
159
|
else
|
|
160
|
-
message = "Expected a #{Hash} or #{Courier::Internal::Type::BaseModel}, got #{
|
|
160
|
+
message = "Expected a #{Hash} or #{Courier::Internal::Type::BaseModel}, got #{input.inspect}"
|
|
161
161
|
raise ArgumentError.new(message)
|
|
162
162
|
end
|
|
163
163
|
end
|
|
@@ -237,6 +237,11 @@ module Courier
|
|
|
237
237
|
end
|
|
238
238
|
end
|
|
239
239
|
|
|
240
|
+
# @type [Regexp]
|
|
241
|
+
#
|
|
242
|
+
# https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
|
|
243
|
+
RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
|
|
244
|
+
|
|
240
245
|
class << self
|
|
241
246
|
# @api private
|
|
242
247
|
#
|
|
@@ -247,6 +252,15 @@ module Courier
|
|
|
247
252
|
"#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
|
|
248
253
|
end
|
|
249
254
|
|
|
255
|
+
# @api private
|
|
256
|
+
#
|
|
257
|
+
# @param path [String, Integer]
|
|
258
|
+
#
|
|
259
|
+
# @return [String]
|
|
260
|
+
def encode_path(path)
|
|
261
|
+
path.to_s.gsub(Courier::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
|
|
262
|
+
end
|
|
263
|
+
|
|
250
264
|
# @api private
|
|
251
265
|
#
|
|
252
266
|
# @param path [String, Array<String>]
|
|
@@ -259,7 +273,7 @@ module Courier
|
|
|
259
273
|
in []
|
|
260
274
|
""
|
|
261
275
|
in [String => p, *interpolations]
|
|
262
|
-
encoded = interpolations.map {
|
|
276
|
+
encoded = interpolations.map { encode_path(_1) }
|
|
263
277
|
format(p, *encoded)
|
|
264
278
|
end
|
|
265
279
|
end
|
|
@@ -571,16 +585,15 @@ module Courier
|
|
|
571
585
|
y << "Content-Disposition: form-data"
|
|
572
586
|
|
|
573
587
|
unless key.nil?
|
|
574
|
-
|
|
575
|
-
y << "; name=\"#{name}\""
|
|
588
|
+
y << "; name=\"#{key}\""
|
|
576
589
|
end
|
|
577
590
|
|
|
578
591
|
case val
|
|
579
592
|
in Courier::FilePart unless val.filename.nil?
|
|
580
|
-
filename =
|
|
593
|
+
filename = encode_path(val.filename)
|
|
581
594
|
y << "; filename=\"#{filename}\""
|
|
582
595
|
in Pathname | IO
|
|
583
|
-
filename =
|
|
596
|
+
filename = encode_path(::File.basename(val.to_path))
|
|
584
597
|
y << "; filename=\"#{filename}\""
|
|
585
598
|
else
|
|
586
599
|
end
|
|
@@ -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,75 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class Channel < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute brand_id
|
|
7
|
+
# Brand id used for rendering.
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :brand_id, String, nil?: true
|
|
11
|
+
|
|
12
|
+
# @!attribute if_
|
|
13
|
+
# JS conditional with access to data/profile.
|
|
14
|
+
#
|
|
15
|
+
# @return [String, nil]
|
|
16
|
+
optional :if_, String, api_name: :if, nil?: true
|
|
17
|
+
|
|
18
|
+
# @!attribute metadata
|
|
19
|
+
#
|
|
20
|
+
# @return [Courier::Models::ChannelMetadata, nil]
|
|
21
|
+
optional :metadata, -> { Courier::ChannelMetadata }, nil?: true
|
|
22
|
+
|
|
23
|
+
# @!attribute override
|
|
24
|
+
# Channel specific overrides.
|
|
25
|
+
#
|
|
26
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
27
|
+
optional :override, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
|
|
28
|
+
|
|
29
|
+
# @!attribute providers
|
|
30
|
+
# Providers enabled for this channel.
|
|
31
|
+
#
|
|
32
|
+
# @return [Array<String>, nil]
|
|
33
|
+
optional :providers, Courier::Internal::Type::ArrayOf[String], nil?: true
|
|
34
|
+
|
|
35
|
+
# @!attribute routing_method
|
|
36
|
+
# Defaults to `single`.
|
|
37
|
+
#
|
|
38
|
+
# @return [Symbol, Courier::Models::Channel::RoutingMethod, nil]
|
|
39
|
+
optional :routing_method, enum: -> { Courier::Channel::RoutingMethod }, nil?: true
|
|
40
|
+
|
|
41
|
+
# @!attribute timeouts
|
|
42
|
+
#
|
|
43
|
+
# @return [Courier::Models::Timeouts, nil]
|
|
44
|
+
optional :timeouts, -> { Courier::Timeouts }, nil?: true
|
|
45
|
+
|
|
46
|
+
# @!method initialize(brand_id: nil, if_: nil, metadata: nil, override: nil, providers: nil, routing_method: nil, timeouts: nil)
|
|
47
|
+
# @param brand_id [String, nil] Brand id used for rendering.
|
|
48
|
+
#
|
|
49
|
+
# @param if_ [String, nil] JS conditional with access to data/profile.
|
|
50
|
+
#
|
|
51
|
+
# @param metadata [Courier::Models::ChannelMetadata, nil]
|
|
52
|
+
#
|
|
53
|
+
# @param override [Hash{Symbol=>Object}, nil] Channel specific overrides.
|
|
54
|
+
#
|
|
55
|
+
# @param providers [Array<String>, nil] Providers enabled for this channel.
|
|
56
|
+
#
|
|
57
|
+
# @param routing_method [Symbol, Courier::Models::Channel::RoutingMethod, nil] Defaults to `single`.
|
|
58
|
+
#
|
|
59
|
+
# @param timeouts [Courier::Models::Timeouts, nil]
|
|
60
|
+
|
|
61
|
+
# Defaults to `single`.
|
|
62
|
+
#
|
|
63
|
+
# @see Courier::Models::Channel#routing_method
|
|
64
|
+
module RoutingMethod
|
|
65
|
+
extend Courier::Internal::Type::Enum
|
|
66
|
+
|
|
67
|
+
ALL = :all
|
|
68
|
+
SINGLE = :single
|
|
69
|
+
|
|
70
|
+
# @!method self.values
|
|
71
|
+
# @return [Array<Symbol>]
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ChannelMetadata < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute utm
|
|
7
|
+
#
|
|
8
|
+
# @return [Courier::Models::Utm, nil]
|
|
9
|
+
optional :utm, -> { Courier::Utm }, nil?: true
|
|
10
|
+
|
|
11
|
+
# @!method initialize(utm: nil)
|
|
12
|
+
# @param utm [Courier::Models::Utm, nil]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
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
|
|
@@ -5,7 +5,7 @@ module Courier
|
|
|
5
5
|
class ElementalContent < Courier::Internal::Type::BaseModel
|
|
6
6
|
# @!attribute elements
|
|
7
7
|
#
|
|
8
|
-
# @return [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType>]
|
|
8
|
+
# @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>]
|
|
9
9
|
required :elements, -> { Courier::Internal::Type::ArrayOf[union: Courier::ElementalNode] }
|
|
10
10
|
|
|
11
11
|
# @!attribute version
|
|
@@ -15,7 +15,7 @@ module Courier
|
|
|
15
15
|
required :version, String
|
|
16
16
|
|
|
17
17
|
# @!method initialize(elements:, version:)
|
|
18
|
-
# @param elements [Array<Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType>]
|
|
18
|
+
# @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>]
|
|
19
19
|
#
|
|
20
20
|
# @param version [String] For example, "2022-01-01"
|
|
21
21
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class ElementalHTMLNodeWithType < Courier::Models::ElementalBaseNode
|
|
6
|
+
# @!attribute type
|
|
7
|
+
#
|
|
8
|
+
# @return [Symbol, Courier::Models::ElementalHTMLNodeWithType::Type, nil]
|
|
9
|
+
optional :type, enum: -> { Courier::ElementalHTMLNodeWithType::Type }
|
|
10
|
+
|
|
11
|
+
# @!method initialize(type: nil)
|
|
12
|
+
# @param type [Symbol, Courier::Models::ElementalHTMLNodeWithType::Type]
|
|
13
|
+
|
|
14
|
+
module Type
|
|
15
|
+
extend Courier::Internal::Type::Enum
|
|
16
|
+
|
|
17
|
+
HTML = :html
|
|
18
|
+
|
|
19
|
+
# @!method self.values
|
|
20
|
+
# @return [Array<Symbol>]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -37,8 +37,10 @@ module Courier
|
|
|
37
37
|
|
|
38
38
|
variant -> { Courier::ElementalQuoteNodeWithType }
|
|
39
39
|
|
|
40
|
+
variant -> { Courier::ElementalHTMLNodeWithType }
|
|
41
|
+
|
|
40
42
|
# @!method self.variants
|
|
41
|
-
# @return [Array(Courier::Models::ElementalTextNodeWithType, Courier::Models::ElementalMetaNodeWithType, Courier::Models::ElementalChannelNodeWithType, Courier::Models::ElementalImageNodeWithType, Courier::Models::ElementalActionNodeWithType, Courier::Models::ElementalDividerNodeWithType, Courier::Models::ElementalQuoteNodeWithType)]
|
|
43
|
+
# @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)]
|
|
42
44
|
end
|
|
43
45
|
end
|
|
44
46
|
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class MessageProvidersType < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute if_
|
|
7
|
+
# JS conditional with access to data/profile.
|
|
8
|
+
#
|
|
9
|
+
# @return [String, nil]
|
|
10
|
+
optional :if_, String, api_name: :if, nil?: true
|
|
11
|
+
|
|
12
|
+
# @!attribute metadata
|
|
13
|
+
#
|
|
14
|
+
# @return [Courier::Models::Metadata, nil]
|
|
15
|
+
optional :metadata, -> { Courier::Metadata }, nil?: true
|
|
16
|
+
|
|
17
|
+
# @!attribute override
|
|
18
|
+
# Provider-specific overrides.
|
|
19
|
+
#
|
|
20
|
+
# @return [Hash{Symbol=>Object}, nil]
|
|
21
|
+
optional :override, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown], nil?: true
|
|
22
|
+
|
|
23
|
+
# @!attribute timeouts
|
|
24
|
+
#
|
|
25
|
+
# @return [Integer, nil]
|
|
26
|
+
optional :timeouts, Integer, nil?: true
|
|
27
|
+
|
|
28
|
+
# @!method initialize(if_: nil, metadata: nil, override: nil, timeouts: nil)
|
|
29
|
+
# @param if_ [String, nil] JS conditional with access to data/profile.
|
|
30
|
+
#
|
|
31
|
+
# @param metadata [Courier::Models::Metadata, nil]
|
|
32
|
+
#
|
|
33
|
+
# @param override [Hash{Symbol=>Object}, nil] Provider-specific overrides.
|
|
34
|
+
#
|
|
35
|
+
# @param timeouts [Integer, nil]
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
class Metadata < Courier::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute utm
|
|
7
|
+
#
|
|
8
|
+
# @return [Courier::Models::Utm, nil]
|
|
9
|
+
optional :utm, -> { Courier::Utm }, nil?: true
|
|
10
|
+
|
|
11
|
+
# @!method initialize(utm: nil)
|
|
12
|
+
# @param utm [Courier::Models::Utm, nil]
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#archive
|
|
6
|
+
class NotificationArchiveParams < 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
|
+
# @!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
|
+
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,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Courier
|
|
4
|
+
module Models
|
|
5
|
+
# @see Courier::Resources::Notifications#create
|
|
6
|
+
class NotificationCreateParams < Courier::Models::NotificationTemplateCreateRequest
|
|
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
|