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.
Files changed (225) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +41 -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/associated_notification_list_response.rb +24 -0
  7. data/lib/courier/models/channel.rb +75 -0
  8. data/lib/courier/models/channel_metadata.rb +15 -0
  9. data/lib/courier/models/element_with_checksums.rb +60 -0
  10. data/lib/courier/models/elemental_content.rb +2 -2
  11. data/lib/courier/models/elemental_html_node_with_type.rb +24 -0
  12. data/lib/courier/models/elemental_node.rb +3 -1
  13. data/lib/courier/models/message_channels.rb +8 -0
  14. data/lib/courier/models/message_providers.rb +8 -0
  15. data/lib/courier/models/message_providers_type.rb +38 -0
  16. data/lib/courier/models/metadata.rb +15 -0
  17. data/lib/courier/models/notification_archive_params.rb +20 -0
  18. data/lib/courier/models/notification_content_get_response.rb +26 -0
  19. data/lib/courier/models/notification_content_mutation_response.rb +61 -0
  20. data/lib/courier/models/notification_content_put_request.rb +51 -0
  21. data/lib/courier/models/notification_create_params.rb +14 -0
  22. data/lib/courier/models/notification_element_put_request.rb +62 -0
  23. data/lib/courier/models/notification_get_content.rb +0 -1
  24. data/lib/courier/models/notification_list_params.rb +13 -4
  25. data/lib/courier/models/notification_list_response.rb +108 -93
  26. data/lib/courier/models/notification_list_versions_params.rb +37 -0
  27. data/lib/courier/models/notification_locale_put_request.rb +39 -0
  28. data/lib/courier/models/notification_publish_params.rb +20 -0
  29. data/lib/courier/models/notification_put_content_params.rb +20 -0
  30. data/lib/courier/models/notification_put_element_params.rb +26 -0
  31. data/lib/courier/models/notification_put_locale_params.rb +26 -0
  32. data/lib/courier/models/notification_replace_params.rb +20 -0
  33. data/lib/courier/models/notification_retrieve_content_params.rb +14 -1
  34. data/lib/courier/models/notification_retrieve_content_response.rb +21 -0
  35. data/lib/courier/models/notification_retrieve_params.rb +33 -0
  36. data/lib/courier/models/notification_template_create_request.rb +45 -0
  37. data/lib/courier/models/notification_template_get_response.rb +92 -0
  38. data/lib/courier/models/notification_template_mutation_response.rb +51 -0
  39. data/lib/courier/models/notification_template_payload.rb +98 -0
  40. data/lib/courier/models/notification_template_publish_request.rb +19 -0
  41. data/lib/courier/models/notification_template_state.rb +16 -0
  42. data/lib/courier/models/notification_template_summary.rb +81 -0
  43. data/lib/courier/models/notification_template_update_request.rb +46 -0
  44. data/lib/courier/models/notification_template_version_list_response.rb +22 -0
  45. data/lib/courier/models/provider.rb +67 -0
  46. data/lib/courier/models/provider_create_params.rb +52 -0
  47. data/lib/courier/models/provider_delete_params.rb +20 -0
  48. data/lib/courier/models/provider_list_params.rb +22 -0
  49. data/lib/courier/models/provider_list_response.rb +24 -0
  50. data/lib/courier/models/provider_retrieve_params.rb +20 -0
  51. data/lib/courier/models/provider_update_params.rb +58 -0
  52. data/lib/courier/models/providers/catalog_list_params.rb +44 -0
  53. data/lib/courier/models/providers/catalog_list_response.rb +26 -0
  54. data/lib/courier/models/providers_catalog_entry.rb +86 -0
  55. data/lib/courier/models/routing_strategy_archive_params.rb +20 -0
  56. data/lib/courier/models/routing_strategy_create_params.rb +14 -0
  57. data/lib/courier/models/routing_strategy_create_request.rb +58 -0
  58. data/lib/courier/models/routing_strategy_get_response.rb +99 -0
  59. data/lib/courier/models/routing_strategy_list_notifications_params.rb +37 -0
  60. data/lib/courier/models/routing_strategy_list_params.rb +30 -0
  61. data/lib/courier/models/routing_strategy_list_response.rb +24 -0
  62. data/lib/courier/models/routing_strategy_mutation_response.rb +19 -0
  63. data/lib/courier/models/routing_strategy_replace_params.rb +20 -0
  64. data/lib/courier/models/routing_strategy_replace_request.rb +59 -0
  65. data/lib/courier/models/routing_strategy_retrieve_params.rb +20 -0
  66. data/lib/courier/models/routing_strategy_summary.rb +75 -0
  67. data/lib/courier/models/send_message_params.rb +6 -154
  68. data/lib/courier/models/tenant_template_input.rb +6 -152
  69. data/lib/courier/models/timeouts.rb +21 -0
  70. data/lib/courier/models/version_node.rb +46 -0
  71. data/lib/courier/models.rb +110 -0
  72. data/lib/courier/resources/notifications.rb +289 -12
  73. data/lib/courier/resources/providers/catalog.rb +49 -0
  74. data/lib/courier/resources/providers.rb +150 -0
  75. data/lib/courier/resources/routing_strategies.rb +179 -0
  76. data/lib/courier/version.rb +1 -1
  77. data/lib/courier.rb +60 -2
  78. data/rbi/courier/client.rbi +6 -0
  79. data/rbi/courier/internal/util.rbi +8 -0
  80. data/rbi/courier/models/associated_notification_list_response.rbi +45 -0
  81. data/rbi/courier/models/channel.rbi +106 -0
  82. data/rbi/courier/models/channel_metadata.rbi +28 -0
  83. data/rbi/courier/models/element_with_checksums.rbi +109 -0
  84. data/rbi/courier/models/elemental_content.rbi +6 -3
  85. data/rbi/courier/models/elemental_html_node_with_type.rbi +59 -0
  86. data/rbi/courier/models/elemental_node.rbi +2 -1
  87. data/rbi/courier/models/message_channels.rbi +11 -0
  88. data/rbi/courier/models/message_providers.rbi +11 -0
  89. data/rbi/courier/models/message_providers_type.rbi +60 -0
  90. data/rbi/courier/models/metadata.rbi +26 -0
  91. data/rbi/courier/models/notification_archive_params.rbi +35 -0
  92. data/rbi/courier/models/notification_content_get_response.rbi +45 -0
  93. data/rbi/courier/models/notification_content_mutation_response.rbi +95 -0
  94. data/rbi/courier/models/notification_content_put_request.rbi +145 -0
  95. data/rbi/courier/models/notification_create_params.rbi +27 -0
  96. data/rbi/courier/models/notification_element_put_request.rbi +98 -0
  97. data/rbi/courier/models/notification_list_params.rbi +15 -2
  98. data/rbi/courier/models/notification_list_response.rbi +159 -119
  99. data/rbi/courier/models/notification_list_versions_params.rbi +66 -0
  100. data/rbi/courier/models/notification_locale_put_request.rbi +79 -0
  101. data/rbi/courier/models/notification_publish_params.rbi +35 -0
  102. data/rbi/courier/models/notification_put_content_params.rbi +38 -0
  103. data/rbi/courier/models/notification_put_element_params.rbi +46 -0
  104. data/rbi/courier/models/notification_put_locale_params.rbi +46 -0
  105. data/rbi/courier/models/notification_replace_params.rbi +35 -0
  106. data/rbi/courier/models/notification_retrieve_content_params.rbi +21 -2
  107. data/rbi/courier/models/notification_retrieve_content_response.rbi +29 -0
  108. data/rbi/courier/models/notification_retrieve_params.rbi +54 -0
  109. data/rbi/courier/models/notification_template_create_request.rbi +102 -0
  110. data/rbi/courier/models/notification_template_get_response.rbi +162 -0
  111. data/rbi/courier/models/notification_template_mutation_response.rbi +121 -0
  112. data/rbi/courier/models/notification_template_payload.rbi +183 -0
  113. data/rbi/courier/models/notification_template_publish_request.rbi +35 -0
  114. data/rbi/courier/models/notification_template_state.rbi +26 -0
  115. data/rbi/courier/models/notification_template_summary.rbi +124 -0
  116. data/rbi/courier/models/notification_template_update_request.rbi +103 -0
  117. data/rbi/courier/models/notification_template_version_list_response.rbi +41 -0
  118. data/rbi/courier/models/provider.rbi +87 -0
  119. data/rbi/courier/models/provider_create_params.rbi +82 -0
  120. data/rbi/courier/models/provider_delete_params.rbi +35 -0
  121. data/rbi/courier/models/provider_list_params.rbi +43 -0
  122. data/rbi/courier/models/provider_list_response.rbi +42 -0
  123. data/rbi/courier/models/provider_retrieve_params.rbi +35 -0
  124. data/rbi/courier/models/provider_update_params.rbi +86 -0
  125. data/rbi/courier/models/providers/catalog_list_params.rbi +75 -0
  126. data/rbi/courier/models/providers/catalog_list_response.rbi +47 -0
  127. data/rbi/courier/models/providers_catalog_entry.rbi +129 -0
  128. data/rbi/courier/models/routing_strategy_archive_params.rbi +38 -0
  129. data/rbi/courier/models/routing_strategy_create_params.rbi +30 -0
  130. data/rbi/courier/models/routing_strategy_create_request.rbi +86 -0
  131. data/rbi/courier/models/routing_strategy_get_response.rbi +121 -0
  132. data/rbi/courier/models/routing_strategy_list_notifications_params.rbi +63 -0
  133. data/rbi/courier/models/routing_strategy_list_params.rbi +54 -0
  134. data/rbi/courier/models/routing_strategy_list_response.rbi +45 -0
  135. data/rbi/courier/models/routing_strategy_mutation_response.rbi +31 -0
  136. data/rbi/courier/models/routing_strategy_replace_params.rbi +38 -0
  137. data/rbi/courier/models/routing_strategy_replace_request.rbi +87 -0
  138. data/rbi/courier/models/routing_strategy_retrieve_params.rbi +38 -0
  139. data/rbi/courier/models/routing_strategy_summary.rbi +95 -0
  140. data/rbi/courier/models/send_message_params.rbi +6 -362
  141. data/rbi/courier/models/tenant_template_input.rbi +8 -336
  142. data/rbi/courier/models/timeouts.rbi +33 -0
  143. data/rbi/courier/models/version_node.rbi +65 -0
  144. data/rbi/courier/models.rbi +122 -0
  145. data/rbi/courier/resources/notifications.rbi +222 -6
  146. data/rbi/courier/resources/providers/catalog.rbi +38 -0
  147. data/rbi/courier/resources/providers.rbi +116 -0
  148. data/rbi/courier/resources/routing_strategies.rbi +147 -0
  149. data/sig/courier/client.rbs +4 -0
  150. data/sig/courier/internal/util.rbs +4 -0
  151. data/sig/courier/models/associated_notification_list_response.rbs +25 -0
  152. data/sig/courier/models/channel.rbs +61 -0
  153. data/sig/courier/models/channel_metadata.rbs +13 -0
  154. data/sig/courier/models/element_with_checksums.rbs +60 -0
  155. data/sig/courier/models/elemental_html_node_with_type.rbs +32 -0
  156. data/sig/courier/models/elemental_node.rbs +1 -0
  157. data/sig/courier/models/message_channels.rbs +7 -0
  158. data/sig/courier/models/message_providers.rbs +7 -0
  159. data/sig/courier/models/message_providers_type.rbs +35 -0
  160. data/sig/courier/models/metadata.rbs +13 -0
  161. data/sig/courier/models/notification_archive_params.rbs +20 -0
  162. data/sig/courier/models/notification_content_get_response.rbs +22 -0
  163. data/sig/courier/models/notification_content_mutation_response.rbs +47 -0
  164. data/sig/courier/models/notification_content_put_request.rbs +50 -0
  165. data/sig/courier/models/notification_create_params.rbs +15 -0
  166. data/sig/courier/models/notification_element_put_request.rbs +64 -0
  167. data/sig/courier/models/notification_list_params.rbs +7 -1
  168. data/sig/courier/models/notification_list_response.rbs +81 -71
  169. data/sig/courier/models/notification_list_versions_params.rbs +36 -0
  170. data/sig/courier/models/notification_locale_put_request.rbs +39 -0
  171. data/sig/courier/models/notification_publish_params.rbs +22 -0
  172. data/sig/courier/models/notification_put_content_params.rbs +22 -0
  173. data/sig/courier/models/notification_put_element_params.rbs +32 -0
  174. data/sig/courier/models/notification_put_locale_params.rbs +32 -0
  175. data/sig/courier/models/notification_replace_params.rbs +22 -0
  176. data/sig/courier/models/notification_retrieve_content_params.rbs +12 -2
  177. data/sig/courier/models/notification_retrieve_content_response.rbs +12 -0
  178. data/sig/courier/models/notification_retrieve_params.rbs +30 -0
  179. data/sig/courier/models/notification_template_create_request.rbs +40 -0
  180. data/sig/courier/models/notification_template_get_response.rbs +72 -0
  181. data/sig/courier/models/notification_template_mutation_response.rbs +46 -0
  182. data/sig/courier/models/notification_template_payload.rbs +75 -0
  183. data/sig/courier/models/notification_template_publish_request.rbs +15 -0
  184. data/sig/courier/models/notification_template_state.rbs +14 -0
  185. data/sig/courier/models/notification_template_summary.rbs +70 -0
  186. data/sig/courier/models/notification_template_update_request.rbs +40 -0
  187. data/sig/courier/models/notification_template_version_list_response.rbs +22 -0
  188. data/sig/courier/models/provider.rbs +52 -0
  189. data/sig/courier/models/provider_create_params.rbs +47 -0
  190. data/sig/courier/models/provider_delete_params.rbs +20 -0
  191. data/sig/courier/models/provider_list_params.rbs +25 -0
  192. data/sig/courier/models/provider_list_response.rbs +22 -0
  193. data/sig/courier/models/provider_retrieve_params.rbs +20 -0
  194. data/sig/courier/models/provider_update_params.rbs +52 -0
  195. data/sig/courier/models/providers/catalog_list_params.rbs +40 -0
  196. data/sig/courier/models/providers/catalog_list_response.rbs +27 -0
  197. data/sig/courier/models/providers_catalog_entry.rbs +64 -0
  198. data/sig/courier/models/routing_strategy_archive_params.rbs +20 -0
  199. data/sig/courier/models/routing_strategy_create_params.rbs +15 -0
  200. data/sig/courier/models/routing_strategy_create_request.rbs +45 -0
  201. data/sig/courier/models/routing_strategy_get_response.rbs +70 -0
  202. data/sig/courier/models/routing_strategy_list_notifications_params.rbs +34 -0
  203. data/sig/courier/models/routing_strategy_list_params.rbs +30 -0
  204. data/sig/courier/models/routing_strategy_list_response.rbs +25 -0
  205. data/sig/courier/models/routing_strategy_mutation_response.rbs +13 -0
  206. data/sig/courier/models/routing_strategy_replace_params.rbs +22 -0
  207. data/sig/courier/models/routing_strategy_replace_request.rbs +45 -0
  208. data/sig/courier/models/routing_strategy_retrieve_params.rbs +20 -0
  209. data/sig/courier/models/routing_strategy_summary.rbs +55 -0
  210. data/sig/courier/models/send_message_params.rbs +8 -130
  211. data/sig/courier/models/tenant_template_input.rbs +12 -134
  212. data/sig/courier/models/timeouts.rbs +15 -0
  213. data/sig/courier/models/version_node.rbs +32 -0
  214. data/sig/courier/models.rbs +108 -0
  215. data/sig/courier/resources/notifications.rbs +65 -3
  216. data/sig/courier/resources/providers/catalog.rbs +16 -0
  217. data/sig/courier/resources/providers.rbs +38 -0
  218. data/sig/courier/resources/routing_strategies.rbs +48 -0
  219. metadata +182 -8
  220. data/lib/courier/models/notifications/draft_retrieve_content_params.rb +0 -22
  221. data/lib/courier/resources/notifications/draft.rb +0 -33
  222. data/rbi/courier/models/notifications/draft_retrieve_content_params.rbi +0 -40
  223. data/rbi/courier/resources/notifications/draft.rbi +0 -23
  224. data/sig/courier/models/notifications/draft_retrieve_content_params.rbs +0 -22
  225. data/sig/courier/resources/notifications/draft.rbs +0 -14
@@ -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
@@ -2,7 +2,6 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::Notifications#retrieve_content
6
5
  class NotificationGetContent < Courier::Internal::Type::BaseModel
7
6
  # @!attribute blocks
8
7
  #
@@ -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
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Notifications#list_versions
6
+ class NotificationListVersionsParams < 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
20
+
21
+ # @!attribute limit
22
+ # Maximum number of versions to return per page. Default 10, max 10.
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] Opaque pagination cursor from a previous response. Omit for the first page.
31
+ #
32
+ # @param limit [Integer] Maximum number of versions to return per page. Default 10, max 10.
33
+ #
34
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
35
+ end
36
+ end
37
+ 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#publish
6
+ class NotificationPublishParams < Courier::Models::NotificationTemplatePublishRequest
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,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
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Notifications#replace
6
+ class NotificationReplaceParams < Courier::Models::NotificationTemplateUpdateRequest
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
@@ -12,8 +12,21 @@ module Courier
12
12
  # @return [String]
13
13
  required :id, String
14
14
 
15
- # @!method initialize(id:, request_options: {})
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
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Notifications#retrieve
6
+ class NotificationRetrieveParams < 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 version
16
+ # Version to retrieve. One of "draft", "published", or a version string like
17
+ # "v001". Defaults to "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::NotificationRetrieveParams} for more details.
25
+ #
26
+ # @param id [String]
27
+ #
28
+ # @param version [String] Version to retrieve. One of "draft", "published", or a version string like "v001
29
+ #
30
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateCreateRequest < Courier::Internal::Type::BaseModel
6
+ # @!attribute notification
7
+ # Full document shape used in POST and PUT request bodies, and returned inside the
8
+ # GET response envelope.
9
+ #
10
+ # @return [Courier::Models::NotificationTemplatePayload]
11
+ required :notification, -> { Courier::NotificationTemplatePayload }
12
+
13
+ # @!attribute state
14
+ # Template state after creation. Case-insensitive input, normalized to uppercase
15
+ # in the response. Defaults to "DRAFT".
16
+ #
17
+ # @return [Symbol, Courier::Models::NotificationTemplateCreateRequest::State, nil]
18
+ optional :state, enum: -> { Courier::NotificationTemplateCreateRequest::State }
19
+
20
+ # @!method initialize(notification:, state: nil)
21
+ # Some parameter documentations has been truncated, see
22
+ # {Courier::Models::NotificationTemplateCreateRequest} for more details.
23
+ #
24
+ # Request body for creating a notification template.
25
+ #
26
+ # @param notification [Courier::Models::NotificationTemplatePayload] Full document shape used in POST and PUT request bodies, and returned inside the
27
+ #
28
+ # @param state [Symbol, Courier::Models::NotificationTemplateCreateRequest::State] Template state after creation. Case-insensitive input, normalized to uppercase i
29
+
30
+ # Template state after creation. Case-insensitive input, normalized to uppercase
31
+ # in the response. Defaults to "DRAFT".
32
+ #
33
+ # @see Courier::Models::NotificationTemplateCreateRequest#state
34
+ module State
35
+ extend Courier::Internal::Type::Enum
36
+
37
+ DRAFT = :DRAFT
38
+ PUBLISHED = :PUBLISHED
39
+
40
+ # @!method self.values
41
+ # @return [Array<Symbol>]
42
+ end
43
+ end
44
+ end
45
+ end