trycourier 4.8.0 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/README.md +1 -1
  4. data/lib/courier/client.rb +8 -0
  5. data/lib/courier/internal/util.rb +19 -6
  6. data/lib/courier/models/channel.rb +75 -0
  7. data/lib/courier/models/channel_metadata.rb +15 -0
  8. data/lib/courier/models/elemental_content.rb +2 -2
  9. data/lib/courier/models/elemental_html_node_with_type.rb +24 -0
  10. data/lib/courier/models/elemental_node.rb +3 -1
  11. data/lib/courier/models/message_channels.rb +8 -0
  12. data/lib/courier/models/message_providers.rb +8 -0
  13. data/lib/courier/models/message_providers_type.rb +38 -0
  14. data/lib/courier/models/metadata.rb +15 -0
  15. data/lib/courier/models/notification_archive_params.rb +20 -0
  16. data/lib/courier/models/notification_create_params.rb +14 -0
  17. data/lib/courier/models/notification_list_params.rb +13 -4
  18. data/lib/courier/models/notification_list_response.rb +108 -93
  19. data/lib/courier/models/notification_list_versions_params.rb +37 -0
  20. data/lib/courier/models/notification_publish_params.rb +20 -0
  21. data/lib/courier/models/notification_replace_params.rb +20 -0
  22. data/lib/courier/models/notification_retrieve_params.rb +33 -0
  23. data/lib/courier/models/notification_template_create_request.rb +45 -0
  24. data/lib/courier/models/notification_template_get_response.rb +92 -0
  25. data/lib/courier/models/notification_template_mutation_response.rb +51 -0
  26. data/lib/courier/models/notification_template_payload.rb +98 -0
  27. data/lib/courier/models/notification_template_publish_request.rb +19 -0
  28. data/lib/courier/models/notification_template_summary.rb +81 -0
  29. data/lib/courier/models/notification_template_update_request.rb +46 -0
  30. data/lib/courier/models/notification_template_version_list_response.rb +22 -0
  31. data/lib/courier/models/provider.rb +67 -0
  32. data/lib/courier/models/provider_create_params.rb +52 -0
  33. data/lib/courier/models/provider_delete_params.rb +20 -0
  34. data/lib/courier/models/provider_list_params.rb +22 -0
  35. data/lib/courier/models/provider_list_response.rb +24 -0
  36. data/lib/courier/models/provider_retrieve_params.rb +20 -0
  37. data/lib/courier/models/provider_update_params.rb +58 -0
  38. data/lib/courier/models/providers/catalog_list_params.rb +44 -0
  39. data/lib/courier/models/providers/catalog_list_response.rb +26 -0
  40. data/lib/courier/models/providers_catalog_entry.rb +86 -0
  41. data/lib/courier/models/routing_strategy_archive_params.rb +20 -0
  42. data/lib/courier/models/routing_strategy_create_params.rb +14 -0
  43. data/lib/courier/models/routing_strategy_create_request.rb +58 -0
  44. data/lib/courier/models/routing_strategy_get_response.rb +99 -0
  45. data/lib/courier/models/routing_strategy_list_params.rb +30 -0
  46. data/lib/courier/models/routing_strategy_list_response.rb +24 -0
  47. data/lib/courier/models/routing_strategy_mutation_response.rb +19 -0
  48. data/lib/courier/models/routing_strategy_replace_params.rb +20 -0
  49. data/lib/courier/models/routing_strategy_replace_request.rb +59 -0
  50. data/lib/courier/models/routing_strategy_retrieve_params.rb +20 -0
  51. data/lib/courier/models/routing_strategy_summary.rb +75 -0
  52. data/lib/courier/models/send_message_params.rb +6 -154
  53. data/lib/courier/models/tenant_template_input.rb +6 -152
  54. data/lib/courier/models/timeouts.rb +21 -0
  55. data/lib/courier/models/version_node.rb +46 -0
  56. data/lib/courier/models.rb +86 -0
  57. data/lib/courier/resources/notifications.rb +165 -3
  58. data/lib/courier/resources/providers/catalog.rb +49 -0
  59. data/lib/courier/resources/providers.rb +150 -0
  60. data/lib/courier/resources/routing_strategies.rb +151 -0
  61. data/lib/courier/version.rb +1 -1
  62. data/lib/courier.rb +47 -0
  63. data/rbi/courier/client.rbi +6 -0
  64. data/rbi/courier/internal/util.rbi +8 -0
  65. data/rbi/courier/models/channel.rbi +106 -0
  66. data/rbi/courier/models/channel_metadata.rbi +28 -0
  67. data/rbi/courier/models/elemental_content.rbi +6 -3
  68. data/rbi/courier/models/elemental_html_node_with_type.rbi +59 -0
  69. data/rbi/courier/models/elemental_node.rbi +2 -1
  70. data/rbi/courier/models/message_channels.rbi +11 -0
  71. data/rbi/courier/models/message_providers.rbi +11 -0
  72. data/rbi/courier/models/message_providers_type.rbi +60 -0
  73. data/rbi/courier/models/metadata.rbi +26 -0
  74. data/rbi/courier/models/notification_archive_params.rbi +35 -0
  75. data/rbi/courier/models/notification_create_params.rbi +27 -0
  76. data/rbi/courier/models/notification_list_params.rbi +15 -2
  77. data/rbi/courier/models/notification_list_response.rbi +159 -119
  78. data/rbi/courier/models/notification_list_versions_params.rbi +66 -0
  79. data/rbi/courier/models/notification_publish_params.rbi +35 -0
  80. data/rbi/courier/models/notification_replace_params.rbi +35 -0
  81. data/rbi/courier/models/notification_retrieve_params.rbi +54 -0
  82. data/rbi/courier/models/notification_template_create_request.rbi +102 -0
  83. data/rbi/courier/models/notification_template_get_response.rbi +162 -0
  84. data/rbi/courier/models/notification_template_mutation_response.rbi +121 -0
  85. data/rbi/courier/models/notification_template_payload.rbi +183 -0
  86. data/rbi/courier/models/notification_template_publish_request.rbi +35 -0
  87. data/rbi/courier/models/notification_template_summary.rbi +124 -0
  88. data/rbi/courier/models/notification_template_update_request.rbi +103 -0
  89. data/rbi/courier/models/notification_template_version_list_response.rbi +41 -0
  90. data/rbi/courier/models/provider.rbi +87 -0
  91. data/rbi/courier/models/provider_create_params.rbi +82 -0
  92. data/rbi/courier/models/provider_delete_params.rbi +35 -0
  93. data/rbi/courier/models/provider_list_params.rbi +43 -0
  94. data/rbi/courier/models/provider_list_response.rbi +42 -0
  95. data/rbi/courier/models/provider_retrieve_params.rbi +35 -0
  96. data/rbi/courier/models/provider_update_params.rbi +86 -0
  97. data/rbi/courier/models/providers/catalog_list_params.rbi +75 -0
  98. data/rbi/courier/models/providers/catalog_list_response.rbi +47 -0
  99. data/rbi/courier/models/providers_catalog_entry.rbi +129 -0
  100. data/rbi/courier/models/routing_strategy_archive_params.rbi +38 -0
  101. data/rbi/courier/models/routing_strategy_create_params.rbi +30 -0
  102. data/rbi/courier/models/routing_strategy_create_request.rbi +86 -0
  103. data/rbi/courier/models/routing_strategy_get_response.rbi +121 -0
  104. data/rbi/courier/models/routing_strategy_list_params.rbi +54 -0
  105. data/rbi/courier/models/routing_strategy_list_response.rbi +45 -0
  106. data/rbi/courier/models/routing_strategy_mutation_response.rbi +31 -0
  107. data/rbi/courier/models/routing_strategy_replace_params.rbi +38 -0
  108. data/rbi/courier/models/routing_strategy_replace_request.rbi +87 -0
  109. data/rbi/courier/models/routing_strategy_retrieve_params.rbi +38 -0
  110. data/rbi/courier/models/routing_strategy_summary.rbi +95 -0
  111. data/rbi/courier/models/send_message_params.rbi +6 -362
  112. data/rbi/courier/models/tenant_template_input.rbi +8 -336
  113. data/rbi/courier/models/timeouts.rbi +33 -0
  114. data/rbi/courier/models/version_node.rbi +65 -0
  115. data/rbi/courier/models.rbi +94 -0
  116. data/rbi/courier/resources/notifications.rbi +119 -1
  117. data/rbi/courier/resources/providers/catalog.rbi +38 -0
  118. data/rbi/courier/resources/providers.rbi +116 -0
  119. data/rbi/courier/resources/routing_strategies.rbi +126 -0
  120. data/sig/courier/client.rbs +4 -0
  121. data/sig/courier/internal/util.rbs +4 -0
  122. data/sig/courier/models/channel.rbs +61 -0
  123. data/sig/courier/models/channel_metadata.rbs +13 -0
  124. data/sig/courier/models/elemental_html_node_with_type.rbs +32 -0
  125. data/sig/courier/models/elemental_node.rbs +1 -0
  126. data/sig/courier/models/message_channels.rbs +7 -0
  127. data/sig/courier/models/message_providers.rbs +7 -0
  128. data/sig/courier/models/message_providers_type.rbs +35 -0
  129. data/sig/courier/models/metadata.rbs +13 -0
  130. data/sig/courier/models/notification_archive_params.rbs +20 -0
  131. data/sig/courier/models/notification_create_params.rbs +15 -0
  132. data/sig/courier/models/notification_list_params.rbs +7 -1
  133. data/sig/courier/models/notification_list_response.rbs +81 -71
  134. data/sig/courier/models/notification_list_versions_params.rbs +36 -0
  135. data/sig/courier/models/notification_publish_params.rbs +22 -0
  136. data/sig/courier/models/notification_replace_params.rbs +22 -0
  137. data/sig/courier/models/notification_retrieve_params.rbs +30 -0
  138. data/sig/courier/models/notification_template_create_request.rbs +40 -0
  139. data/sig/courier/models/notification_template_get_response.rbs +72 -0
  140. data/sig/courier/models/notification_template_mutation_response.rbs +46 -0
  141. data/sig/courier/models/notification_template_payload.rbs +75 -0
  142. data/sig/courier/models/notification_template_publish_request.rbs +15 -0
  143. data/sig/courier/models/notification_template_summary.rbs +70 -0
  144. data/sig/courier/models/notification_template_update_request.rbs +40 -0
  145. data/sig/courier/models/notification_template_version_list_response.rbs +22 -0
  146. data/sig/courier/models/provider.rbs +52 -0
  147. data/sig/courier/models/provider_create_params.rbs +47 -0
  148. data/sig/courier/models/provider_delete_params.rbs +20 -0
  149. data/sig/courier/models/provider_list_params.rbs +25 -0
  150. data/sig/courier/models/provider_list_response.rbs +22 -0
  151. data/sig/courier/models/provider_retrieve_params.rbs +20 -0
  152. data/sig/courier/models/provider_update_params.rbs +52 -0
  153. data/sig/courier/models/providers/catalog_list_params.rbs +40 -0
  154. data/sig/courier/models/providers/catalog_list_response.rbs +27 -0
  155. data/sig/courier/models/providers_catalog_entry.rbs +64 -0
  156. data/sig/courier/models/routing_strategy_archive_params.rbs +20 -0
  157. data/sig/courier/models/routing_strategy_create_params.rbs +15 -0
  158. data/sig/courier/models/routing_strategy_create_request.rbs +45 -0
  159. data/sig/courier/models/routing_strategy_get_response.rbs +70 -0
  160. data/sig/courier/models/routing_strategy_list_params.rbs +30 -0
  161. data/sig/courier/models/routing_strategy_list_response.rbs +25 -0
  162. data/sig/courier/models/routing_strategy_mutation_response.rbs +13 -0
  163. data/sig/courier/models/routing_strategy_replace_params.rbs +22 -0
  164. data/sig/courier/models/routing_strategy_replace_request.rbs +45 -0
  165. data/sig/courier/models/routing_strategy_retrieve_params.rbs +20 -0
  166. data/sig/courier/models/routing_strategy_summary.rbs +55 -0
  167. data/sig/courier/models/send_message_params.rbs +8 -130
  168. data/sig/courier/models/tenant_template_input.rbs +12 -134
  169. data/sig/courier/models/timeouts.rbs +15 -0
  170. data/sig/courier/models/version_node.rbs +32 -0
  171. data/sig/courier/models.rbs +84 -0
  172. data/sig/courier/resources/notifications.rbs +35 -0
  173. data/sig/courier/resources/providers/catalog.rbs +16 -0
  174. data/sig/courier/resources/providers.rbs +38 -0
  175. data/sig/courier/resources/routing_strategies.rbs +41 -0
  176. metadata +143 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 453a5c5183a4ecfeebab4f86e963ac204c115741c2fedb0f32156b1a6aff23f0
4
- data.tar.gz: 4db69717cb3bdcd63d2eae022325c4ae14fe8a1203cec1a7212628c3804242ce
3
+ metadata.gz: 3402c91918996a99ee5f6847167c87f49ca1d0a711da6de88c1ab620ea1ca58c
4
+ data.tar.gz: cc72a6efa7d4c23d88069a482f153da899680bcebc0a418e85361e759441fe52
5
5
  SHA512:
6
- metadata.gz: 7931be3dcf151f5e26313fcfd94b25995f416bd17147e40d99dec981991ebaa2b9a2d0ac3534f2d3888c60d969ec32cea8b8e07a2e6656fbf2e33526a3a041e4
7
- data.tar.gz: 4d57d68375783ca713d41844d364c04e5f234834509fbd465822ca89aa9f0044e558055d730cbacaf50ed5d96d4839aa7087a4436c497c401d985658e08a3bd1
6
+ metadata.gz: bea7a9fa2457eca3c876aa38a6bbb492fec8f965b06e4b2e1a8ae3df10454cfe08aa04536546e392a36c03341a54bf7103a8444c6de9dd97c1cdc35abba942f6
7
+ data.tar.gz: 10913c571258c67c3ce10362794e30d2a742b117cde9f4ddbe02a8eabf7c568be4bb64871169ece92b2fe443a3480471adab6c506ac41b7a172579740827b3a0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.9.0 (2026-04-01)
4
+
5
+ Full Changelog: [v4.8.0...v4.9.0](https://github.com/trycourier/courier-ruby/compare/v4.8.0...v4.9.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** add html variant to elemental_node union ([a5a5a5d](https://github.com/trycourier/courier-ruby/commit/a5a5a5d025d5ddb27a79872b15efaaa08785b032))
10
+ * **api:** add notification template CRUD methods, update list params/types ([4861f87](https://github.com/trycourier/courier-ruby/commit/4861f87ead15aba7b148dc8d2790fe2d018157c9))
11
+ * **api:** add providers resource with create/retrieve/update/list/delete and catalog ([5191261](https://github.com/trycourier/courier-ruby/commit/519126120e84dea8276094325e49d350eff3f7bc))
12
+ * **api:** add routing_strategies resource with create/retrieve/list/replace/archive ([6c64599](https://github.com/trycourier/courier-ruby/commit/6c645999dd54ac75bdb777745363d662f7d9da64))
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * align path encoding with RFC 3986 section 3.3 ([916afaa](https://github.com/trycourier/courier-ruby/commit/916afaafd525d4d77a42a0739e892c4d4cf5d933))
18
+ * **internal:** correct multipart form field name encoding ([7925b72](https://github.com/trycourier/courier-ruby/commit/7925b72544622783dd17527da1729f6f48ddb744))
19
+ * variable name typo ([1f59fd2](https://github.com/trycourier/courier-ruby/commit/1f59fd2c73459908b337b98135efbd79bf0bfb9a))
20
+
21
+
22
+ ### Chores
23
+
24
+ * **ci:** skip lint on metadata-only changes ([22a3e8d](https://github.com/trycourier/courier-ruby/commit/22a3e8d5bbfe6953bca20ba54b7bb2007f4f37c0))
25
+ * **ci:** support opting out of skipping builds on metadata-only commits ([a6c047e](https://github.com/trycourier/courier-ruby/commit/a6c047eaa9730f8c398082cd422bf0bc1087e882))
26
+ * **internal:** tweak CI branches ([08eccfe](https://github.com/trycourier/courier-ruby/commit/08eccfe4c37358304a97686df7248dc02f6ea0f4))
27
+ * **internal:** update gitignore ([95860ac](https://github.com/trycourier/courier-ruby/commit/95860acf54c665132e957913d0fc6187cadaf64c))
28
+
29
+
30
+ ### Documentation
31
+
32
+ * 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))
33
+ * 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))
34
+
3
35
  ## 4.8.0 (2026-03-12)
4
36
 
5
37
  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
@@ -8,7 +8,7 @@ The Courier Ruby SDK provides typed access to the Courier REST API from any Ruby
8
8
  Add to your `Gemfile`:
9
9
 
10
10
  ```ruby
11
- gem "trycourier", "~> 4.7"
11
+ gem "trycourier"
12
12
  ```
13
13
 
14
14
  Then run `bundle install`.
@@ -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 #{data.inspect}"
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 { ERB::Util.url_encode(_1) }
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
- name = ERB::Util.url_encode(key.to_s)
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 = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
581
594
  y << "; filename=\"#{filename}\""
582
595
  in Pathname | IO
583
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
584
597
  y << "; filename=\"#{filename}\""
585
598
  else
586
599
  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
@@ -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,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @type [Courier::Internal::Type::Converter]
6
+ MessageChannels = Courier::Internal::Type::HashOf[-> { Courier::Channel }]
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @type [Courier::Internal::Type::Converter]
6
+ MessageProviders = Courier::Internal::Type::HashOf[-> { Courier::MessageProvidersType }]
7
+ end
8
+ 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,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
@@ -8,20 +8,29 @@ module Courier
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
10
10
  # @!attribute cursor
11
+ # Opaque pagination cursor from a previous response. Omit for the first page.
11
12
  #
12
13
  # @return [String, nil]
13
14
  optional :cursor, String, nil?: true
14
15
 
16
+ # @!attribute event_id
17
+ # Filter to templates linked to this event map ID.
18
+ #
19
+ # @return [String, nil]
20
+ optional :event_id, String
21
+
15
22
  # @!attribute notes
16
- # Retrieve the notes from the Notification template settings.
23
+ # Include template notes in the response. Only applies to legacy templates.
17
24
  #
18
25
  # @return [Boolean, nil]
19
26
  optional :notes, Courier::Internal::Type::Boolean, nil?: true
20
27
 
21
- # @!method initialize(cursor: nil, notes: nil, request_options: {})
22
- # @param cursor [String, nil]
28
+ # @!method initialize(cursor: nil, event_id: nil, notes: nil, request_options: {})
29
+ # @param cursor [String, nil] Opaque pagination cursor from a previous response. Omit for the first page.
30
+ #
31
+ # @param event_id [String] Filter to templates linked to this event map ID.
23
32
  #
24
- # @param notes [Boolean, nil] Retrieve the notes from the Notification template settings.
33
+ # @param notes [Boolean, nil] Include template notes in the response. Only applies to legacy templates.
25
34
  #
26
35
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
27
36
  end
@@ -10,108 +10,123 @@ module Courier
10
10
  required :paging, -> { Courier::Paging }
11
11
 
12
12
  # @!attribute results
13
+ # Notification templates in this workspace.
13
14
  #
14
- # @return [Array<Courier::Models::NotificationListResponse::Result>]
15
+ # @return [Array<Courier::Models::NotificationListResponse::Result::Notification, Courier::Models::NotificationTemplateSummary>]
15
16
  required :results,
16
- -> { Courier::Internal::Type::ArrayOf[Courier::Models::NotificationListResponse::Result] }
17
+ -> { Courier::Internal::Type::ArrayOf[union: Courier::Models::NotificationListResponse::Result] }
17
18
 
18
19
  # @!method initialize(paging:, results:)
19
20
  # @param paging [Courier::Models::Paging]
20
- # @param results [Array<Courier::Models::NotificationListResponse::Result>]
21
-
22
- class Result < Courier::Internal::Type::BaseModel
23
- # @!attribute id
24
- #
25
- # @return [String]
26
- required :id, String
27
-
28
- # @!attribute created_at
29
- #
30
- # @return [Integer]
31
- required :created_at, Integer
32
-
33
- # @!attribute event_ids
34
- # Array of event IDs associated with this notification
35
- #
36
- # @return [Array<String>]
37
- required :event_ids, Courier::Internal::Type::ArrayOf[String]
38
-
39
- # @!attribute note
40
- #
41
- # @return [String]
42
- required :note, String
43
-
44
- # @!attribute routing
45
- #
46
- # @return [Courier::Models::MessageRouting]
47
- required :routing, -> { Courier::MessageRouting }
48
-
49
- # @!attribute topic_id
50
- #
51
- # @return [String]
52
- required :topic_id, String
53
-
54
- # @!attribute updated_at
55
- #
56
- # @return [Integer]
57
- required :updated_at, Integer
58
-
59
- # @!attribute tags
60
- #
61
- # @return [Courier::Models::NotificationListResponse::Result::Tags, nil]
62
- optional :tags, -> { Courier::Models::NotificationListResponse::Result::Tags }, nil?: true
63
-
64
- # @!attribute title
65
- #
66
- # @return [String, nil]
67
- optional :title, String, nil?: true
68
-
69
- # @!method initialize(id:, created_at:, event_ids:, note:, routing:, topic_id:, updated_at:, tags: nil, title: nil)
70
- # @param id [String]
71
- #
72
- # @param created_at [Integer]
73
- #
74
- # @param event_ids [Array<String>] Array of event IDs associated with this notification
75
- #
76
- # @param note [String]
77
- #
78
- # @param routing [Courier::Models::MessageRouting]
79
- #
80
- # @param topic_id [String]
81
- #
82
- # @param updated_at [Integer]
83
- #
84
- # @param tags [Courier::Models::NotificationListResponse::Result::Tags, nil]
85
- #
86
- # @param title [String, nil]
87
-
88
- # @see Courier::Models::NotificationListResponse::Result#tags
89
- class Tags < Courier::Internal::Type::BaseModel
90
- # @!attribute data
91
- #
92
- # @return [Array<Courier::Models::NotificationListResponse::Result::Tags::Data>]
93
- required :data,
94
- -> { Courier::Internal::Type::ArrayOf[Courier::Models::NotificationListResponse::Result::Tags::Data] }
95
-
96
- # @!method initialize(data:)
97
- # @param data [Array<Courier::Models::NotificationListResponse::Result::Tags::Data>]
98
-
99
- class Data < Courier::Internal::Type::BaseModel
100
- # @!attribute id
101
- #
102
- # @return [String]
103
- required :id, String
21
+ #
22
+ # @param results [Array<Courier::Models::NotificationListResponse::Result::Notification, Courier::Models::NotificationTemplateSummary>] Notification templates in this workspace.
104
23
 
105
- # @!attribute name
106
- #
107
- # @return [String]
108
- required :name, String
24
+ # V2 (CDS) template summary returned in list responses.
25
+ module Result
26
+ extend Courier::Internal::Type::Union
27
+
28
+ variant -> { Courier::Models::NotificationListResponse::Result::Notification }
29
+
30
+ # V2 (CDS) template summary returned in list responses.
31
+ variant -> { Courier::NotificationTemplateSummary }
32
+
33
+ class Notification < Courier::Internal::Type::BaseModel
34
+ # @!attribute id
35
+ #
36
+ # @return [String]
37
+ required :id, String
38
+
39
+ # @!attribute created_at
40
+ #
41
+ # @return [Integer]
42
+ required :created_at, Integer
43
+
44
+ # @!attribute event_ids
45
+ # Array of event IDs associated with this notification
46
+ #
47
+ # @return [Array<String>]
48
+ required :event_ids, Courier::Internal::Type::ArrayOf[String]
49
+
50
+ # @!attribute note
51
+ #
52
+ # @return [String]
53
+ required :note, String
54
+
55
+ # @!attribute routing
56
+ #
57
+ # @return [Courier::Models::MessageRouting]
58
+ required :routing, -> { Courier::MessageRouting }
59
+
60
+ # @!attribute topic_id
61
+ #
62
+ # @return [String]
63
+ required :topic_id, String
109
64
 
110
- # @!method initialize(id:, name:)
111
- # @param id [String]
112
- # @param name [String]
65
+ # @!attribute updated_at
66
+ #
67
+ # @return [Integer]
68
+ required :updated_at, Integer
69
+
70
+ # @!attribute tags
71
+ #
72
+ # @return [Courier::Models::NotificationListResponse::Result::Notification::Tags, nil]
73
+ optional :tags, -> { Courier::Models::NotificationListResponse::Result::Notification::Tags }, nil?: true
74
+
75
+ # @!attribute title
76
+ #
77
+ # @return [String, nil]
78
+ optional :title, String, nil?: true
79
+
80
+ # @!method initialize(id:, created_at:, event_ids:, note:, routing:, topic_id:, updated_at:, tags: nil, title: nil)
81
+ # @param id [String]
82
+ #
83
+ # @param created_at [Integer]
84
+ #
85
+ # @param event_ids [Array<String>] Array of event IDs associated with this notification
86
+ #
87
+ # @param note [String]
88
+ #
89
+ # @param routing [Courier::Models::MessageRouting]
90
+ #
91
+ # @param topic_id [String]
92
+ #
93
+ # @param updated_at [Integer]
94
+ #
95
+ # @param tags [Courier::Models::NotificationListResponse::Result::Notification::Tags, nil]
96
+ #
97
+ # @param title [String, nil]
98
+
99
+ # @see Courier::Models::NotificationListResponse::Result::Notification#tags
100
+ class Tags < Courier::Internal::Type::BaseModel
101
+ # @!attribute data
102
+ #
103
+ # @return [Array<Courier::Models::NotificationListResponse::Result::Notification::Tags::Data>]
104
+ required :data,
105
+ -> { Courier::Internal::Type::ArrayOf[Courier::Models::NotificationListResponse::Result::Notification::Tags::Data] }
106
+
107
+ # @!method initialize(data:)
108
+ # @param data [Array<Courier::Models::NotificationListResponse::Result::Notification::Tags::Data>]
109
+
110
+ class Data < Courier::Internal::Type::BaseModel
111
+ # @!attribute id
112
+ #
113
+ # @return [String]
114
+ required :id, String
115
+
116
+ # @!attribute name
117
+ #
118
+ # @return [String]
119
+ required :name, String
120
+
121
+ # @!method initialize(id:, name:)
122
+ # @param id [String]
123
+ # @param name [String]
124
+ end
113
125
  end
114
126
  end
127
+
128
+ # @!method self.variants
129
+ # @return [Array(Courier::Models::NotificationListResponse::Result::Notification, Courier::Models::NotificationTemplateSummary)]
115
130
  end
116
131
  end
117
132
  end