trycourier 4.21.0 → 4.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/lib/courier/client.rb +43 -0
  4. data/lib/courier/models/automations/invoke_invoke_ad_hoc_params.rb +13 -1
  5. data/lib/courier/models/automations/invoke_invoke_by_template_params.rb +13 -1
  6. data/lib/courier/models/brand_create_params.rb +13 -1
  7. data/lib/courier/models/broadcast.rb +132 -0
  8. data/lib/courier/models/broadcast_archive_params.rb +20 -0
  9. data/lib/courier/models/broadcast_cancel_params.rb +20 -0
  10. data/lib/courier/models/broadcast_create_params.rb +14 -0
  11. data/lib/courier/models/broadcast_duplicate_params.rb +20 -0
  12. data/lib/courier/models/broadcast_list_params.rb +30 -0
  13. data/lib/courier/models/broadcast_list_response.rb +24 -0
  14. data/lib/courier/models/broadcast_put_content_params.rb +20 -0
  15. data/lib/courier/models/broadcast_retrieve_content_params.rb +33 -0
  16. data/lib/courier/models/broadcast_retrieve_params.rb +20 -0
  17. data/lib/courier/models/broadcast_schedule.rb +59 -0
  18. data/lib/courier/models/broadcast_schedule_params.rb +20 -0
  19. data/lib/courier/models/broadcast_send_params.rb +20 -0
  20. data/lib/courier/models/broadcast_update_params.rb +20 -0
  21. data/lib/courier/models/create_broadcast_request.rb +43 -0
  22. data/lib/courier/models/inbox/message_delete_params.rb +22 -0
  23. data/lib/courier/models/inbox/message_restore_params.rb +22 -0
  24. data/lib/courier/models/journey_cancel_params.rb +13 -1
  25. data/lib/courier/models/journey_create_params.rb +13 -1
  26. data/lib/courier/models/journey_invoke_params.rb +13 -1
  27. data/lib/courier/models/journey_publish_params.rb +13 -1
  28. data/lib/courier/models/journeys/template_create_params.rb +13 -1
  29. data/lib/courier/models/journeys/template_publish_params.rb +13 -1
  30. data/lib/courier/models/lists/subscription_add_params.rb +13 -1
  31. data/lib/courier/models/notification_create_params.rb +13 -1
  32. data/lib/courier/models/notification_publish_params.rb +13 -1
  33. data/lib/courier/models/profile_create_params.rb +13 -1
  34. data/lib/courier/models/profiles/list_subscribe_params.rb +13 -1
  35. data/lib/courier/models/provider_create_params.rb +15 -1
  36. data/lib/courier/models/routing_strategy_create_params.rb +13 -1
  37. data/lib/courier/models/schedule_broadcast_request.rb +59 -0
  38. data/lib/courier/models/send_broadcast_request.rb +39 -0
  39. data/lib/courier/models/send_message_params.rb +15 -1
  40. data/lib/courier/models/update_broadcast_request.rb +18 -0
  41. data/lib/courier/models/users/preference_bulk_update_params.rb +15 -1
  42. data/lib/courier/models/users/preference_update_or_create_topic_params.rb +14 -4
  43. data/lib/courier/models/users/topic_preference.rb +21 -7
  44. data/lib/courier/models/workspace_preference_create_params.rb +13 -1
  45. data/lib/courier/models/workspace_preference_publish_params.rb +13 -1
  46. data/lib/courier/models/workspace_preferences/topic_create_params.rb +13 -1
  47. data/lib/courier/models.rb +38 -0
  48. data/lib/courier/resources/audiences.rb +12 -5
  49. data/lib/courier/resources/audit_events.rb +5 -2
  50. data/lib/courier/resources/auth.rb +5 -1
  51. data/lib/courier/resources/automations/invoke.rb +47 -23
  52. data/lib/courier/resources/automations.rb +6 -1
  53. data/lib/courier/resources/brands.rb +38 -12
  54. data/lib/courier/resources/broadcasts.rb +290 -0
  55. data/lib/courier/resources/digests/schedules.rb +4 -3
  56. data/lib/courier/resources/digests.rb +2 -0
  57. data/lib/courier/resources/inbound.rb +3 -1
  58. data/lib/courier/resources/inbox/messages.rb +58 -0
  59. data/lib/courier/resources/inbox.rb +19 -0
  60. data/lib/courier/resources/journeys/templates.rb +43 -25
  61. data/lib/courier/resources/journeys.rb +73 -44
  62. data/lib/courier/resources/lists/subscriptions.rb +22 -8
  63. data/lib/courier/resources/lists.rb +14 -5
  64. data/lib/courier/resources/messages.rb +14 -14
  65. data/lib/courier/resources/notifications/checks.rb +8 -3
  66. data/lib/courier/resources/notifications.rb +48 -30
  67. data/lib/courier/resources/profiles/lists.rb +19 -8
  68. data/lib/courier/resources/profiles.rb +25 -14
  69. data/lib/courier/resources/providers/catalog.rb +4 -4
  70. data/lib/courier/resources/providers.rb +27 -18
  71. data/lib/courier/resources/requests.rb +4 -1
  72. data/lib/courier/resources/routing_strategies.rb +24 -12
  73. data/lib/courier/resources/send.rb +14 -4
  74. data/lib/courier/resources/tenants/preferences/items.rb +6 -2
  75. data/lib/courier/resources/tenants/preferences.rb +2 -0
  76. data/lib/courier/resources/tenants/templates/versions.rb +4 -7
  77. data/lib/courier/resources/tenants/templates.rb +14 -19
  78. data/lib/courier/resources/tenants.rb +14 -5
  79. data/lib/courier/resources/translations.rb +6 -2
  80. data/lib/courier/resources/users/preferences.rb +23 -42
  81. data/lib/courier/resources/users/tenants.rb +12 -10
  82. data/lib/courier/resources/users/tokens.rb +14 -6
  83. data/lib/courier/resources/users.rb +6 -0
  84. data/lib/courier/resources/workspace_preferences/topics.rb +27 -19
  85. data/lib/courier/resources/workspace_preferences.rb +40 -20
  86. data/lib/courier/version.rb +1 -1
  87. data/lib/courier.rb +24 -1
  88. data/rbi/courier/client.rbi +41 -0
  89. data/rbi/courier/models/automations/invoke_invoke_ad_hoc_params.rbi +18 -0
  90. data/rbi/courier/models/automations/invoke_invoke_by_template_params.rbi +18 -0
  91. data/rbi/courier/models/brand_create_params.rbi +18 -0
  92. data/rbi/courier/models/broadcast.rbi +164 -0
  93. data/rbi/courier/models/broadcast_archive_params.rbi +35 -0
  94. data/rbi/courier/models/broadcast_cancel_params.rbi +35 -0
  95. data/rbi/courier/models/broadcast_create_params.rbi +27 -0
  96. data/rbi/courier/models/broadcast_duplicate_params.rbi +35 -0
  97. data/rbi/courier/models/broadcast_list_params.rbi +54 -0
  98. data/rbi/courier/models/broadcast_list_response.rbi +39 -0
  99. data/rbi/courier/models/broadcast_put_content_params.rbi +35 -0
  100. data/rbi/courier/models/broadcast_retrieve_content_params.rbi +57 -0
  101. data/rbi/courier/models/broadcast_retrieve_params.rbi +35 -0
  102. data/rbi/courier/models/broadcast_schedule.rbi +92 -0
  103. data/rbi/courier/models/broadcast_schedule_params.rbi +35 -0
  104. data/rbi/courier/models/broadcast_send_params.rbi +35 -0
  105. data/rbi/courier/models/broadcast_update_params.rbi +35 -0
  106. data/rbi/courier/models/create_broadcast_request.rbi +81 -0
  107. data/rbi/courier/models/inbox/message_delete_params.rbi +40 -0
  108. data/rbi/courier/models/inbox/message_restore_params.rbi +40 -0
  109. data/rbi/courier/models/journey_cancel_params.rbi +31 -5
  110. data/rbi/courier/models/journey_create_params.rbi +31 -5
  111. data/rbi/courier/models/journey_invoke_params.rbi +26 -2
  112. data/rbi/courier/models/journey_publish_params.rbi +26 -2
  113. data/rbi/courier/models/journeys/template_create_params.rbi +26 -2
  114. data/rbi/courier/models/journeys/template_publish_params.rbi +23 -1
  115. data/rbi/courier/models/lists/subscription_add_params.rbi +23 -1
  116. data/rbi/courier/models/notification_create_params.rbi +31 -5
  117. data/rbi/courier/models/notification_publish_params.rbi +26 -2
  118. data/rbi/courier/models/profile_create_params.rbi +23 -1
  119. data/rbi/courier/models/profiles/list_subscribe_params.rbi +23 -1
  120. data/rbi/courier/models/provider_create_params.rbi +18 -0
  121. data/rbi/courier/models/routing_strategy_create_params.rbi +31 -5
  122. data/rbi/courier/models/schedule_broadcast_request.rbi +103 -0
  123. data/rbi/courier/models/send_broadcast_request.rbi +77 -0
  124. data/rbi/courier/models/send_message_params.rbi +18 -0
  125. data/rbi/courier/models/update_broadcast_request.rbi +28 -0
  126. data/rbi/courier/models/users/preference_bulk_update_params.rbi +18 -0
  127. data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +14 -2
  128. data/rbi/courier/models/users/topic_preference.rbi +24 -2
  129. data/rbi/courier/models/workspace_preference_create_params.rbi +31 -5
  130. data/rbi/courier/models/workspace_preference_publish_params.rbi +31 -5
  131. data/rbi/courier/models/workspace_preferences/topic_create_params.rbi +26 -2
  132. data/rbi/courier/models.rbi +39 -0
  133. data/rbi/courier/resources/audiences.rbi +12 -5
  134. data/rbi/courier/resources/audit_events.rbi +5 -2
  135. data/rbi/courier/resources/auth.rbi +5 -1
  136. data/rbi/courier/resources/automations/invoke.rbi +48 -7
  137. data/rbi/courier/resources/automations.rbi +6 -1
  138. data/rbi/courier/resources/brands.rbi +37 -7
  139. data/rbi/courier/resources/broadcasts.rbi +199 -0
  140. data/rbi/courier/resources/digests/schedules.rbi +4 -3
  141. data/rbi/courier/resources/digests.rbi +2 -0
  142. data/rbi/courier/resources/inbound.rbi +3 -1
  143. data/rbi/courier/resources/inbox/messages.rbi +44 -0
  144. data/rbi/courier/resources/inbox.rbi +16 -0
  145. data/rbi/courier/resources/journeys/templates.rbi +47 -17
  146. data/rbi/courier/resources/journeys.rbi +93 -39
  147. data/rbi/courier/resources/lists/subscriptions.rbi +24 -5
  148. data/rbi/courier/resources/lists.rbi +14 -5
  149. data/rbi/courier/resources/messages.rbi +14 -14
  150. data/rbi/courier/resources/notifications/checks.rbi +8 -3
  151. data/rbi/courier/resources/notifications.rbi +58 -28
  152. data/rbi/courier/resources/profiles/lists.rbi +25 -6
  153. data/rbi/courier/resources/profiles.rbi +31 -11
  154. data/rbi/courier/resources/providers/catalog.rbi +4 -4
  155. data/rbi/courier/resources/providers.rbi +35 -19
  156. data/rbi/courier/resources/requests.rbi +4 -1
  157. data/rbi/courier/resources/routing_strategies.rbi +26 -10
  158. data/rbi/courier/resources/send.rbi +20 -3
  159. data/rbi/courier/resources/tenants/preferences/items.rbi +6 -2
  160. data/rbi/courier/resources/tenants/preferences.rbi +2 -0
  161. data/rbi/courier/resources/tenants/templates/versions.rbi +4 -7
  162. data/rbi/courier/resources/tenants/templates.rbi +14 -19
  163. data/rbi/courier/resources/tenants.rbi +14 -5
  164. data/rbi/courier/resources/translations.rbi +6 -2
  165. data/rbi/courier/resources/users/preferences.rbi +28 -40
  166. data/rbi/courier/resources/users/tenants.rbi +12 -10
  167. data/rbi/courier/resources/users/tokens.rbi +14 -6
  168. data/rbi/courier/resources/users.rbi +6 -0
  169. data/rbi/courier/resources/workspace_preferences/topics.rbi +37 -18
  170. data/rbi/courier/resources/workspace_preferences.rbi +51 -17
  171. data/sig/courier/client.rbs +4 -0
  172. data/sig/courier/models/automations/invoke_invoke_ad_hoc_params.rbs +15 -1
  173. data/sig/courier/models/automations/invoke_invoke_by_template_params.rbs +15 -1
  174. data/sig/courier/models/brand_create_params.rbs +15 -1
  175. data/sig/courier/models/broadcast.rbs +98 -0
  176. data/sig/courier/models/broadcast_archive_params.rbs +23 -0
  177. data/sig/courier/models/broadcast_cancel_params.rbs +23 -0
  178. data/sig/courier/models/broadcast_create_params.rbs +15 -0
  179. data/sig/courier/models/broadcast_duplicate_params.rbs +23 -0
  180. data/sig/courier/models/broadcast_list_params.rbs +30 -0
  181. data/sig/courier/models/broadcast_list_response.rbs +22 -0
  182. data/sig/courier/models/broadcast_put_content_params.rbs +25 -0
  183. data/sig/courier/models/broadcast_retrieve_content_params.rbs +30 -0
  184. data/sig/courier/models/broadcast_retrieve_params.rbs +23 -0
  185. data/sig/courier/models/broadcast_schedule.rbs +46 -0
  186. data/sig/courier/models/broadcast_schedule_params.rbs +25 -0
  187. data/sig/courier/models/broadcast_send_params.rbs +25 -0
  188. data/sig/courier/models/broadcast_update_params.rbs +25 -0
  189. data/sig/courier/models/create_broadcast_request.rbs +40 -0
  190. data/sig/courier/models/inbox/message_delete_params.rbs +25 -0
  191. data/sig/courier/models/inbox/message_restore_params.rbs +25 -0
  192. data/sig/courier/models/journey_cancel_params.rbs +20 -3
  193. data/sig/courier/models/journey_create_params.rbs +20 -3
  194. data/sig/courier/models/journey_invoke_params.rbs +18 -1
  195. data/sig/courier/models/journey_publish_params.rbs +18 -1
  196. data/sig/courier/models/journeys/template_create_params.rbs +18 -1
  197. data/sig/courier/models/journeys/template_publish_params.rbs +18 -1
  198. data/sig/courier/models/lists/subscription_add_params.rbs +15 -1
  199. data/sig/courier/models/notification_create_params.rbs +20 -3
  200. data/sig/courier/models/notification_publish_params.rbs +18 -2
  201. data/sig/courier/models/profile_create_params.rbs +18 -1
  202. data/sig/courier/models/profiles/list_subscribe_params.rbs +15 -1
  203. data/sig/courier/models/provider_create_params.rbs +15 -1
  204. data/sig/courier/models/routing_strategy_create_params.rbs +20 -3
  205. data/sig/courier/models/schedule_broadcast_request.rbs +48 -0
  206. data/sig/courier/models/send_broadcast_request.rbs +36 -0
  207. data/sig/courier/models/send_message_params.rbs +17 -1
  208. data/sig/courier/models/update_broadcast_request.rbs +13 -0
  209. data/sig/courier/models/users/preference_bulk_update_params.rbs +15 -1
  210. data/sig/courier/models/workspace_preference_create_params.rbs +20 -3
  211. data/sig/courier/models/workspace_preference_publish_params.rbs +20 -3
  212. data/sig/courier/models/workspace_preferences/topic_create_params.rbs +18 -1
  213. data/sig/courier/models.rbs +38 -0
  214. data/sig/courier/resources/automations/invoke.rbs +4 -0
  215. data/sig/courier/resources/brands.rbs +2 -0
  216. data/sig/courier/resources/broadcasts.rbs +74 -0
  217. data/sig/courier/resources/inbox/messages.rbs +19 -0
  218. data/sig/courier/resources/inbox.rbs +9 -0
  219. data/sig/courier/resources/journeys/templates.rbs +4 -0
  220. data/sig/courier/resources/journeys.rbs +8 -0
  221. data/sig/courier/resources/lists/subscriptions.rbs +2 -0
  222. data/sig/courier/resources/notifications.rbs +4 -0
  223. data/sig/courier/resources/profiles/lists.rbs +2 -0
  224. data/sig/courier/resources/profiles.rbs +2 -0
  225. data/sig/courier/resources/providers.rbs +2 -0
  226. data/sig/courier/resources/routing_strategies.rbs +2 -0
  227. data/sig/courier/resources/send.rbs +2 -0
  228. data/sig/courier/resources/users/preferences.rbs +2 -0
  229. data/sig/courier/resources/workspace_preferences/topics.rbs +2 -0
  230. data/sig/courier/resources/workspace_preferences.rbs +4 -0
  231. metadata +71 -2
@@ -13,60 +13,101 @@ module Courier
13
13
  sig { returns(String) }
14
14
  attr_reader :api_key
15
15
 
16
+ # Send a message to one or more recipients — users, lists, audiences, or tenants —
17
+ # across every channel you have configured.
16
18
  sig { returns(Courier::Resources::Send) }
17
19
  attr_reader :send_
18
20
 
21
+ # Define filter-based groups whose membership Courier recalculates as user
22
+ # profiles change.
19
23
  sig { returns(Courier::Resources::Audiences) }
20
24
  attr_reader :audiences
21
25
 
26
+ # Configure the channel providers Courier delivers through, and browse the
27
+ # provider types it supports.
22
28
  sig { returns(Courier::Resources::Providers) }
23
29
  attr_reader :providers
24
30
 
31
+ # Read the audit trail of configuration and access changes in your workspace.
25
32
  sig { returns(Courier::Resources::AuditEvents) }
26
33
  attr_reader :audit_events
27
34
 
35
+ # Issue scoped, short-lived JWTs so client-side SDKs — Inbox, Preferences, and the
36
+ # embedded designer — can call Courier as a single user. Server-side requests
37
+ # authenticate with your workspace API key instead.
28
38
  sig { returns(Courier::Resources::Auth) }
29
39
  attr_reader :auth
30
40
 
41
+ # Invoke a stored automation template or an ad hoc automation defined in the
42
+ # request.
31
43
  sig { returns(Courier::Resources::Automations) }
32
44
  attr_reader :automations
33
45
 
46
+ # Build, version, publish, invoke, and cancel multi-step notification workflows,
47
+ # along with the templates scoped to them.
34
48
  sig { returns(Courier::Resources::Journeys) }
35
49
  attr_reader :journeys
36
50
 
51
+ sig { returns(Courier::Resources::Broadcasts) }
52
+ attr_reader :broadcasts
53
+
54
+ # Manage the logos, colors, and layout that give the templates you send a
55
+ # consistent look.
37
56
  sig { returns(Courier::Resources::Brands) }
38
57
  attr_reader :brands
39
58
 
40
59
  sig { returns(Courier::Resources::Digests) }
41
60
  attr_reader :digests
42
61
 
62
+ # Record an inbound event that triggers the journeys and automations mapped to it.
43
63
  sig { returns(Courier::Resources::Inbound) }
44
64
  attr_reader :inbound
45
65
 
66
+ # Manage static groups of users that you subscribe explicitly, and send to them by
67
+ # list id or list pattern.
46
68
  sig { returns(Courier::Resources::Lists) }
47
69
  attr_reader :lists
48
70
 
71
+ sig { returns(Courier::Resources::Inbox) }
72
+ attr_reader :inbox
73
+
74
+ # Look up the messages Courier has accepted, inspect their delivery history and
75
+ # rendered output, and cancel, resend, or archive them.
49
76
  sig { returns(Courier::Resources::Messages) }
50
77
  attr_reader :messages
51
78
 
79
+ # Look up the messages Courier has accepted, inspect their delivery history and
80
+ # rendered output, and cancel, resend, or archive them.
52
81
  sig { returns(Courier::Resources::Requests) }
53
82
  attr_reader :requests
54
83
 
84
+ # Create, update, version, publish, and localize notification templates and their
85
+ # content.
55
86
  sig { returns(Courier::Resources::Notifications) }
56
87
  attr_reader :notifications
57
88
 
89
+ # Define reusable channel routing and failover strategies, and see which templates
90
+ # use them.
58
91
  sig { returns(Courier::Resources::RoutingStrategies) }
59
92
  attr_reader :routing_strategies
60
93
 
94
+ # Manage the workspace catalog of subscription topics, the sections that group
95
+ # them, and publishing the preference page.
61
96
  sig { returns(Courier::Resources::WorkspacePreferences) }
62
97
  attr_reader :workspace_preferences
63
98
 
99
+ # Store the contact information Courier delivers to for each user — email, phone
100
+ # number, push tokens, and any custom data you send to.
64
101
  sig { returns(Courier::Resources::Profiles) }
65
102
  attr_reader :profiles
66
103
 
104
+ # Manage tenants — the organizations, teams, or accounts your users belong to —
105
+ # along with their users and default preferences.
67
106
  sig { returns(Courier::Resources::Tenants) }
68
107
  attr_reader :tenants
69
108
 
109
+ # Store and retrieve the translation strings Courier uses to render localized
110
+ # template content.
70
111
  sig { returns(Courier::Resources::Translations) }
71
112
  attr_reader :translations
72
113
 
@@ -43,6 +43,18 @@ module Courier
43
43
  sig { returns(T.nilable(String)) }
44
44
  attr_accessor :template
45
45
 
46
+ sig { returns(T.nilable(String)) }
47
+ attr_reader :idempotency_key
48
+
49
+ sig { params(idempotency_key: String).void }
50
+ attr_writer :idempotency_key
51
+
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :x_idempotency_expiration
54
+
55
+ sig { params(x_idempotency_expiration: String).void }
56
+ attr_writer :x_idempotency_expiration
57
+
46
58
  sig do
47
59
  params(
48
60
  automation:
@@ -52,6 +64,8 @@ module Courier
52
64
  profile: T.nilable(T::Hash[Symbol, T.anything]),
53
65
  recipient: T.nilable(String),
54
66
  template: T.nilable(String),
67
+ idempotency_key: String,
68
+ x_idempotency_expiration: String,
55
69
  request_options: Courier::RequestOptions::OrHash
56
70
  ).returns(T.attached_class)
57
71
  end
@@ -62,6 +76,8 @@ module Courier
62
76
  profile: nil,
63
77
  recipient: nil,
64
78
  template: nil,
79
+ idempotency_key: nil,
80
+ x_idempotency_expiration: nil,
65
81
  request_options: {}
66
82
  )
67
83
  end
@@ -76,6 +92,8 @@ module Courier
76
92
  profile: T.nilable(T::Hash[Symbol, T.anything]),
77
93
  recipient: T.nilable(String),
78
94
  template: T.nilable(String),
95
+ idempotency_key: String,
96
+ x_idempotency_expiration: String,
79
97
  request_options: Courier::RequestOptions
80
98
  }
81
99
  )
@@ -33,6 +33,18 @@ module Courier
33
33
  sig { returns(T.nilable(String)) }
34
34
  attr_accessor :template
35
35
 
36
+ sig { returns(T.nilable(String)) }
37
+ attr_reader :idempotency_key
38
+
39
+ sig { params(idempotency_key: String).void }
40
+ attr_writer :idempotency_key
41
+
42
+ sig { returns(T.nilable(String)) }
43
+ attr_reader :x_idempotency_expiration
44
+
45
+ sig { params(x_idempotency_expiration: String).void }
46
+ attr_writer :x_idempotency_expiration
47
+
36
48
  sig do
37
49
  params(
38
50
  template_id: String,
@@ -41,6 +53,8 @@ module Courier
41
53
  data: T.nilable(T::Hash[Symbol, T.anything]),
42
54
  profile: T.nilable(T::Hash[Symbol, T.anything]),
43
55
  template: T.nilable(String),
56
+ idempotency_key: String,
57
+ x_idempotency_expiration: String,
44
58
  request_options: Courier::RequestOptions::OrHash
45
59
  ).returns(T.attached_class)
46
60
  end
@@ -51,6 +65,8 @@ module Courier
51
65
  data: nil,
52
66
  profile: nil,
53
67
  template: nil,
68
+ idempotency_key: nil,
69
+ x_idempotency_expiration: nil,
54
70
  request_options: {}
55
71
  )
56
72
  end
@@ -64,6 +80,8 @@ module Courier
64
80
  data: T.nilable(T::Hash[Symbol, T.anything]),
65
81
  profile: T.nilable(T::Hash[Symbol, T.anything]),
66
82
  template: T.nilable(String),
83
+ idempotency_key: String,
84
+ x_idempotency_expiration: String,
67
85
  request_options: Courier::RequestOptions
68
86
  }
69
87
  )
@@ -29,12 +29,26 @@ module Courier
29
29
  sig { params(snippets: T.nilable(Courier::BrandSnippets::OrHash)).void }
30
30
  attr_writer :snippets
31
31
 
32
+ sig { returns(T.nilable(String)) }
33
+ attr_reader :idempotency_key
34
+
35
+ sig { params(idempotency_key: String).void }
36
+ attr_writer :idempotency_key
37
+
38
+ sig { returns(T.nilable(String)) }
39
+ attr_reader :x_idempotency_expiration
40
+
41
+ sig { params(x_idempotency_expiration: String).void }
42
+ attr_writer :x_idempotency_expiration
43
+
32
44
  sig do
33
45
  params(
34
46
  name: String,
35
47
  settings: Courier::BrandSettings::OrHash,
36
48
  id: T.nilable(String),
37
49
  snippets: T.nilable(Courier::BrandSnippets::OrHash),
50
+ idempotency_key: String,
51
+ x_idempotency_expiration: String,
38
52
  request_options: Courier::RequestOptions::OrHash
39
53
  ).returns(T.attached_class)
40
54
  end
@@ -43,6 +57,8 @@ module Courier
43
57
  settings:,
44
58
  id: nil,
45
59
  snippets: nil,
60
+ idempotency_key: nil,
61
+ x_idempotency_expiration: nil,
46
62
  request_options: {}
47
63
  )
48
64
  end
@@ -54,6 +70,8 @@ module Courier
54
70
  settings: Courier::BrandSettings,
55
71
  id: T.nilable(String),
56
72
  snippets: T.nilable(Courier::BrandSnippets),
73
+ idempotency_key: String,
74
+ x_idempotency_expiration: String,
57
75
  request_options: Courier::RequestOptions
58
76
  }
59
77
  )
@@ -0,0 +1,164 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class Broadcast < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias { T.any(Courier::Broadcast, Courier::Internal::AnyHash) }
8
+
9
+ # The broadcast ID (bst\_ prefix).
10
+ sig { returns(String) }
11
+ attr_accessor :id
12
+
13
+ # The broadcast's delivery channel.
14
+ sig { returns(Courier::Broadcast::Channel::TaggedSymbol) }
15
+ attr_accessor :channel
16
+
17
+ # ISO 8601 timestamp when the broadcast was created.
18
+ sig { returns(String) }
19
+ attr_accessor :created_at
20
+
21
+ # Actor that created the broadcast.
22
+ sig { returns(String) }
23
+ attr_accessor :created_by
24
+
25
+ # Human-readable name.
26
+ sig { returns(String) }
27
+ attr_accessor :name
28
+
29
+ # Lifecycle status of the broadcast.
30
+ sig { returns(Courier::Broadcast::Status::TaggedSymbol) }
31
+ attr_accessor :status
32
+
33
+ # ISO 8601 timestamp of the last update.
34
+ sig { returns(String) }
35
+ attr_accessor :updated_at
36
+
37
+ # Actor that last updated the broadcast.
38
+ sig { returns(String) }
39
+ attr_accessor :updated_by
40
+
41
+ # ISO 8601 timestamp when the broadcast was archived, if archived.
42
+ sig { returns(T.nilable(String)) }
43
+ attr_accessor :archived_at
44
+
45
+ # Actor that archived the broadcast, if archived.
46
+ sig { returns(T.nilable(String)) }
47
+ attr_accessor :archived_by
48
+
49
+ # The delivery schedule and recipient targeting for a broadcast.
50
+ sig { returns(T.nilable(Courier::BroadcastSchedule)) }
51
+ attr_reader :schedule
52
+
53
+ sig do
54
+ params(schedule: T.nilable(Courier::BroadcastSchedule::OrHash)).void
55
+ end
56
+ attr_writer :schedule
57
+
58
+ # A broadcast — a single-channel message delivered to a known set of recipients (a
59
+ # list or audience).
60
+ sig do
61
+ params(
62
+ id: String,
63
+ channel: Courier::Broadcast::Channel::OrSymbol,
64
+ created_at: String,
65
+ created_by: String,
66
+ name: String,
67
+ status: Courier::Broadcast::Status::OrSymbol,
68
+ updated_at: String,
69
+ updated_by: String,
70
+ archived_at: T.nilable(String),
71
+ archived_by: T.nilable(String),
72
+ schedule: T.nilable(Courier::BroadcastSchedule::OrHash)
73
+ ).returns(T.attached_class)
74
+ end
75
+ def self.new(
76
+ # The broadcast ID (bst\_ prefix).
77
+ id:,
78
+ # The broadcast's delivery channel.
79
+ channel:,
80
+ # ISO 8601 timestamp when the broadcast was created.
81
+ created_at:,
82
+ # Actor that created the broadcast.
83
+ created_by:,
84
+ # Human-readable name.
85
+ name:,
86
+ # Lifecycle status of the broadcast.
87
+ status:,
88
+ # ISO 8601 timestamp of the last update.
89
+ updated_at:,
90
+ # Actor that last updated the broadcast.
91
+ updated_by:,
92
+ # ISO 8601 timestamp when the broadcast was archived, if archived.
93
+ archived_at: nil,
94
+ # Actor that archived the broadcast, if archived.
95
+ archived_by: nil,
96
+ # The delivery schedule and recipient targeting for a broadcast.
97
+ schedule: nil
98
+ )
99
+ end
100
+
101
+ sig do
102
+ override.returns(
103
+ {
104
+ id: String,
105
+ channel: Courier::Broadcast::Channel::TaggedSymbol,
106
+ created_at: String,
107
+ created_by: String,
108
+ name: String,
109
+ status: Courier::Broadcast::Status::TaggedSymbol,
110
+ updated_at: String,
111
+ updated_by: String,
112
+ archived_at: T.nilable(String),
113
+ archived_by: T.nilable(String),
114
+ schedule: T.nilable(Courier::BroadcastSchedule)
115
+ }
116
+ )
117
+ end
118
+ def to_hash
119
+ end
120
+
121
+ # The broadcast's delivery channel.
122
+ module Channel
123
+ extend Courier::Internal::Type::Enum
124
+
125
+ TaggedSymbol =
126
+ T.type_alias { T.all(Symbol, Courier::Broadcast::Channel) }
127
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
128
+
129
+ EMAIL = T.let(:email, Courier::Broadcast::Channel::TaggedSymbol)
130
+ SMS = T.let(:sms, Courier::Broadcast::Channel::TaggedSymbol)
131
+ PUSH = T.let(:push, Courier::Broadcast::Channel::TaggedSymbol)
132
+ INBOX = T.let(:inbox, Courier::Broadcast::Channel::TaggedSymbol)
133
+ SLACK = T.let(:slack, Courier::Broadcast::Channel::TaggedSymbol)
134
+ MSTEAMS = T.let(:msteams, Courier::Broadcast::Channel::TaggedSymbol)
135
+
136
+ sig do
137
+ override.returns(T::Array[Courier::Broadcast::Channel::TaggedSymbol])
138
+ end
139
+ def self.values
140
+ end
141
+ end
142
+
143
+ # Lifecycle status of the broadcast.
144
+ module Status
145
+ extend Courier::Internal::Type::Enum
146
+
147
+ TaggedSymbol =
148
+ T.type_alias { T.all(Symbol, Courier::Broadcast::Status) }
149
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
150
+
151
+ DRAFT = T.let(:draft, Courier::Broadcast::Status::TaggedSymbol)
152
+ SCHEDULED = T.let(:scheduled, Courier::Broadcast::Status::TaggedSymbol)
153
+ SENDING = T.let(:sending, Courier::Broadcast::Status::TaggedSymbol)
154
+ SENT = T.let(:sent, Courier::Broadcast::Status::TaggedSymbol)
155
+
156
+ sig do
157
+ override.returns(T::Array[Courier::Broadcast::Status::TaggedSymbol])
158
+ end
159
+ def self.values
160
+ end
161
+ end
162
+ end
163
+ end
164
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BroadcastArchiveParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::BroadcastArchiveParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :broadcast_id
16
+
17
+ sig do
18
+ params(
19
+ broadcast_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(broadcast_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { broadcast_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BroadcastCancelParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::BroadcastCancelParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :broadcast_id
16
+
17
+ sig do
18
+ params(
19
+ broadcast_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(broadcast_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { broadcast_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BroadcastCreateParams < Courier::Models::CreateBroadcastRequest
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::BroadcastCreateParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: Courier::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: Courier::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BroadcastDuplicateParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::BroadcastDuplicateParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :broadcast_id
16
+
17
+ sig do
18
+ params(
19
+ broadcast_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(broadcast_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { broadcast_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,54 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BroadcastListParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::BroadcastListParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ # Opaque pagination cursor from a previous response. Omit for the first page.
15
+ sig { returns(T.nilable(String)) }
16
+ attr_accessor :cursor
17
+
18
+ # Maximum number of results per page.
19
+ sig { returns(T.nilable(Integer)) }
20
+ attr_reader :limit
21
+
22
+ sig { params(limit: Integer).void }
23
+ attr_writer :limit
24
+
25
+ sig do
26
+ params(
27
+ cursor: T.nilable(String),
28
+ limit: Integer,
29
+ request_options: Courier::RequestOptions::OrHash
30
+ ).returns(T.attached_class)
31
+ end
32
+ def self.new(
33
+ # Opaque pagination cursor from a previous response. Omit for the first page.
34
+ cursor: nil,
35
+ # Maximum number of results per page.
36
+ limit: nil,
37
+ request_options: {}
38
+ )
39
+ end
40
+
41
+ sig do
42
+ override.returns(
43
+ {
44
+ cursor: T.nilable(String),
45
+ limit: Integer,
46
+ request_options: Courier::RequestOptions
47
+ }
48
+ )
49
+ end
50
+ def to_hash
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,39 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BroadcastListResponse < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::BroadcastListResponse, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(Courier::Paging) }
12
+ attr_reader :paging
13
+
14
+ sig { params(paging: Courier::Paging::OrHash).void }
15
+ attr_writer :paging
16
+
17
+ sig { returns(T::Array[Courier::Broadcast]) }
18
+ attr_accessor :results
19
+
20
+ # Paginated list of broadcasts.
21
+ sig do
22
+ params(
23
+ paging: Courier::Paging::OrHash,
24
+ results: T::Array[Courier::Broadcast::OrHash]
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(paging:, results:)
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { paging: Courier::Paging, results: T::Array[Courier::Broadcast] }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class BroadcastPutContentParams < Courier::Models::NotificationContentPutRequest
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::BroadcastPutContentParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :broadcast_id
16
+
17
+ sig do
18
+ params(
19
+ broadcast_id: String,
20
+ request_options: Courier::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(broadcast_id:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { broadcast_id: String, request_options: Courier::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end