trycourier 4.20.0 → 4.22.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 (207) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +24 -0
  3. data/lib/courier/client.rb +39 -4
  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/inbox/message_delete_params.rb +22 -0
  8. data/lib/courier/models/inbox/message_restore_params.rb +22 -0
  9. data/lib/courier/models/journey_cancel_params.rb +13 -1
  10. data/lib/courier/models/journey_create_params.rb +13 -1
  11. data/lib/courier/models/journey_invoke_params.rb +13 -1
  12. data/lib/courier/models/journey_publish_params.rb +13 -1
  13. data/lib/courier/models/journeys/template_create_params.rb +13 -1
  14. data/lib/courier/models/journeys/template_publish_params.rb +13 -1
  15. data/lib/courier/models/lists/subscription_add_params.rb +13 -1
  16. data/lib/courier/models/notification_create_params.rb +13 -1
  17. data/lib/courier/models/notification_publish_params.rb +13 -1
  18. data/lib/courier/models/profile_create_params.rb +13 -1
  19. data/lib/courier/models/profiles/list_subscribe_params.rb +13 -1
  20. data/lib/courier/models/provider_create_params.rb +15 -1
  21. data/lib/courier/models/routing_strategy_create_params.rb +13 -1
  22. data/lib/courier/models/send_message_params.rb +15 -1
  23. data/lib/courier/models/users/preference_bulk_update_params.rb +15 -1
  24. data/lib/courier/models/users/preference_update_or_create_topic_params.rb +14 -4
  25. data/lib/courier/models/users/topic_preference.rb +21 -7
  26. data/lib/courier/models/workspace_preference_create_params.rb +13 -1
  27. data/lib/courier/models/workspace_preference_publish_params.rb +13 -1
  28. data/lib/courier/models/workspace_preferences/topic_create_params.rb +13 -1
  29. data/lib/courier/models.rb +2 -14
  30. data/lib/courier/resources/audiences.rb +12 -5
  31. data/lib/courier/resources/audit_events.rb +5 -2
  32. data/lib/courier/resources/auth.rb +5 -1
  33. data/lib/courier/resources/automations/invoke.rb +47 -23
  34. data/lib/courier/resources/automations.rb +6 -1
  35. data/lib/courier/resources/brands.rb +38 -12
  36. data/lib/courier/resources/digests/schedules.rb +4 -3
  37. data/lib/courier/resources/digests.rb +2 -0
  38. data/lib/courier/resources/inbound.rb +3 -1
  39. data/lib/courier/resources/inbox/messages.rb +58 -0
  40. data/lib/courier/resources/inbox.rb +19 -0
  41. data/lib/courier/resources/journeys/templates.rb +43 -25
  42. data/lib/courier/resources/journeys.rb +73 -44
  43. data/lib/courier/resources/lists/subscriptions.rb +22 -8
  44. data/lib/courier/resources/lists.rb +14 -5
  45. data/lib/courier/resources/messages.rb +14 -14
  46. data/lib/courier/resources/notifications/checks.rb +8 -3
  47. data/lib/courier/resources/notifications.rb +48 -30
  48. data/lib/courier/resources/profiles/lists.rb +19 -8
  49. data/lib/courier/resources/profiles.rb +25 -14
  50. data/lib/courier/resources/providers/catalog.rb +4 -4
  51. data/lib/courier/resources/providers.rb +27 -18
  52. data/lib/courier/resources/requests.rb +4 -1
  53. data/lib/courier/resources/routing_strategies.rb +24 -12
  54. data/lib/courier/resources/send.rb +14 -4
  55. data/lib/courier/resources/tenants/preferences/items.rb +6 -2
  56. data/lib/courier/resources/tenants/preferences.rb +2 -0
  57. data/lib/courier/resources/tenants/templates/versions.rb +4 -7
  58. data/lib/courier/resources/tenants/templates.rb +14 -19
  59. data/lib/courier/resources/tenants.rb +14 -5
  60. data/lib/courier/resources/translations.rb +6 -2
  61. data/lib/courier/resources/users/preferences.rb +23 -42
  62. data/lib/courier/resources/users/tenants.rb +12 -10
  63. data/lib/courier/resources/users/tokens.rb +14 -6
  64. data/lib/courier/resources/users.rb +6 -0
  65. data/lib/courier/resources/workspace_preferences/topics.rb +27 -19
  66. data/lib/courier/resources/workspace_preferences.rb +40 -20
  67. data/lib/courier/version.rb +1 -1
  68. data/lib/courier.rb +4 -11
  69. data/rbi/courier/client.rbi +38 -3
  70. data/rbi/courier/models/automations/invoke_invoke_ad_hoc_params.rbi +18 -0
  71. data/rbi/courier/models/automations/invoke_invoke_by_template_params.rbi +18 -0
  72. data/rbi/courier/models/brand_create_params.rbi +18 -0
  73. data/rbi/courier/models/inbox/message_delete_params.rbi +40 -0
  74. data/rbi/courier/models/inbox/message_restore_params.rbi +40 -0
  75. data/rbi/courier/models/journey_cancel_params.rbi +31 -5
  76. data/rbi/courier/models/journey_create_params.rbi +31 -5
  77. data/rbi/courier/models/journey_invoke_params.rbi +26 -2
  78. data/rbi/courier/models/journey_publish_params.rbi +26 -2
  79. data/rbi/courier/models/journeys/template_create_params.rbi +26 -2
  80. data/rbi/courier/models/journeys/template_publish_params.rbi +23 -1
  81. data/rbi/courier/models/lists/subscription_add_params.rbi +23 -1
  82. data/rbi/courier/models/notification_create_params.rbi +31 -5
  83. data/rbi/courier/models/notification_publish_params.rbi +26 -2
  84. data/rbi/courier/models/profile_create_params.rbi +23 -1
  85. data/rbi/courier/models/profiles/list_subscribe_params.rbi +23 -1
  86. data/rbi/courier/models/provider_create_params.rbi +18 -0
  87. data/rbi/courier/models/routing_strategy_create_params.rbi +31 -5
  88. data/rbi/courier/models/send_message_params.rbi +18 -0
  89. data/rbi/courier/models/users/preference_bulk_update_params.rbi +18 -0
  90. data/rbi/courier/models/users/preference_update_or_create_topic_params.rbi +14 -2
  91. data/rbi/courier/models/users/topic_preference.rbi +24 -2
  92. data/rbi/courier/models/workspace_preference_create_params.rbi +31 -5
  93. data/rbi/courier/models/workspace_preference_publish_params.rbi +31 -5
  94. data/rbi/courier/models/workspace_preferences/topic_create_params.rbi +26 -2
  95. data/rbi/courier/models.rbi +2 -14
  96. data/rbi/courier/resources/audiences.rbi +12 -5
  97. data/rbi/courier/resources/audit_events.rbi +5 -2
  98. data/rbi/courier/resources/auth.rbi +5 -1
  99. data/rbi/courier/resources/automations/invoke.rbi +48 -7
  100. data/rbi/courier/resources/automations.rbi +6 -1
  101. data/rbi/courier/resources/brands.rbi +37 -7
  102. data/rbi/courier/resources/digests/schedules.rbi +4 -3
  103. data/rbi/courier/resources/digests.rbi +2 -0
  104. data/rbi/courier/resources/inbound.rbi +3 -1
  105. data/rbi/courier/resources/inbox/messages.rbi +44 -0
  106. data/rbi/courier/resources/inbox.rbi +16 -0
  107. data/rbi/courier/resources/journeys/templates.rbi +47 -17
  108. data/rbi/courier/resources/journeys.rbi +93 -39
  109. data/rbi/courier/resources/lists/subscriptions.rbi +24 -5
  110. data/rbi/courier/resources/lists.rbi +14 -5
  111. data/rbi/courier/resources/messages.rbi +14 -14
  112. data/rbi/courier/resources/notifications/checks.rbi +8 -3
  113. data/rbi/courier/resources/notifications.rbi +58 -28
  114. data/rbi/courier/resources/profiles/lists.rbi +25 -6
  115. data/rbi/courier/resources/profiles.rbi +31 -11
  116. data/rbi/courier/resources/providers/catalog.rbi +4 -4
  117. data/rbi/courier/resources/providers.rbi +35 -19
  118. data/rbi/courier/resources/requests.rbi +4 -1
  119. data/rbi/courier/resources/routing_strategies.rbi +26 -10
  120. data/rbi/courier/resources/send.rbi +20 -3
  121. data/rbi/courier/resources/tenants/preferences/items.rbi +6 -2
  122. data/rbi/courier/resources/tenants/preferences.rbi +2 -0
  123. data/rbi/courier/resources/tenants/templates/versions.rbi +4 -7
  124. data/rbi/courier/resources/tenants/templates.rbi +14 -19
  125. data/rbi/courier/resources/tenants.rbi +14 -5
  126. data/rbi/courier/resources/translations.rbi +6 -2
  127. data/rbi/courier/resources/users/preferences.rbi +28 -40
  128. data/rbi/courier/resources/users/tenants.rbi +12 -10
  129. data/rbi/courier/resources/users/tokens.rbi +14 -6
  130. data/rbi/courier/resources/users.rbi +6 -0
  131. data/rbi/courier/resources/workspace_preferences/topics.rbi +37 -18
  132. data/rbi/courier/resources/workspace_preferences.rbi +51 -17
  133. data/sig/courier/client.rbs +2 -2
  134. data/sig/courier/models/automations/invoke_invoke_ad_hoc_params.rbs +15 -1
  135. data/sig/courier/models/automations/invoke_invoke_by_template_params.rbs +15 -1
  136. data/sig/courier/models/brand_create_params.rbs +15 -1
  137. data/sig/courier/models/inbox/message_delete_params.rbs +25 -0
  138. data/sig/courier/models/inbox/message_restore_params.rbs +25 -0
  139. data/sig/courier/models/journey_cancel_params.rbs +20 -3
  140. data/sig/courier/models/journey_create_params.rbs +20 -3
  141. data/sig/courier/models/journey_invoke_params.rbs +18 -1
  142. data/sig/courier/models/journey_publish_params.rbs +18 -1
  143. data/sig/courier/models/journeys/template_create_params.rbs +18 -1
  144. data/sig/courier/models/journeys/template_publish_params.rbs +18 -1
  145. data/sig/courier/models/lists/subscription_add_params.rbs +15 -1
  146. data/sig/courier/models/notification_create_params.rbs +20 -3
  147. data/sig/courier/models/notification_publish_params.rbs +18 -2
  148. data/sig/courier/models/profile_create_params.rbs +18 -1
  149. data/sig/courier/models/profiles/list_subscribe_params.rbs +15 -1
  150. data/sig/courier/models/provider_create_params.rbs +15 -1
  151. data/sig/courier/models/routing_strategy_create_params.rbs +20 -3
  152. data/sig/courier/models/send_message_params.rbs +17 -1
  153. data/sig/courier/models/users/preference_bulk_update_params.rbs +15 -1
  154. data/sig/courier/models/workspace_preference_create_params.rbs +20 -3
  155. data/sig/courier/models/workspace_preference_publish_params.rbs +20 -3
  156. data/sig/courier/models/workspace_preferences/topic_create_params.rbs +18 -1
  157. data/sig/courier/models.rbs +2 -14
  158. data/sig/courier/resources/automations/invoke.rbs +4 -0
  159. data/sig/courier/resources/brands.rbs +2 -0
  160. data/sig/courier/resources/inbox/messages.rbs +19 -0
  161. data/sig/courier/resources/inbox.rbs +9 -0
  162. data/sig/courier/resources/journeys/templates.rbs +4 -0
  163. data/sig/courier/resources/journeys.rbs +8 -0
  164. data/sig/courier/resources/lists/subscriptions.rbs +2 -0
  165. data/sig/courier/resources/notifications.rbs +4 -0
  166. data/sig/courier/resources/profiles/lists.rbs +2 -0
  167. data/sig/courier/resources/profiles.rbs +2 -0
  168. data/sig/courier/resources/providers.rbs +2 -0
  169. data/sig/courier/resources/routing_strategies.rbs +2 -0
  170. data/sig/courier/resources/send.rbs +2 -0
  171. data/sig/courier/resources/users/preferences.rbs +2 -0
  172. data/sig/courier/resources/workspace_preferences/topics.rbs +2 -0
  173. data/sig/courier/resources/workspace_preferences.rbs +4 -0
  174. metadata +14 -35
  175. data/lib/courier/models/bulk_add_users_params.rb +0 -26
  176. data/lib/courier/models/bulk_create_job_params.rb +0 -29
  177. data/lib/courier/models/bulk_create_job_response.rb +0 -16
  178. data/lib/courier/models/bulk_list_users_params.rb +0 -33
  179. data/lib/courier/models/bulk_list_users_response.rb +0 -49
  180. data/lib/courier/models/bulk_retrieve_job_params.rb +0 -20
  181. data/lib/courier/models/bulk_retrieve_job_response.rb +0 -76
  182. data/lib/courier/models/bulk_run_job_params.rb +0 -20
  183. data/lib/courier/models/inbound_bulk_message.rb +0 -91
  184. data/lib/courier/models/inbound_bulk_message_user.rb +0 -54
  185. data/lib/courier/resources/bulk.rb +0 -141
  186. data/rbi/courier/models/bulk_add_users_params.rbi +0 -43
  187. data/rbi/courier/models/bulk_create_job_params.rbi +0 -54
  188. data/rbi/courier/models/bulk_create_job_response.rbi +0 -26
  189. data/rbi/courier/models/bulk_list_users_params.rbi +0 -51
  190. data/rbi/courier/models/bulk_list_users_response.rbi +0 -125
  191. data/rbi/courier/models/bulk_retrieve_job_params.rbi +0 -35
  192. data/rbi/courier/models/bulk_retrieve_job_response.rbi +0 -157
  193. data/rbi/courier/models/bulk_run_job_params.rbi +0 -35
  194. data/rbi/courier/models/inbound_bulk_message.rbi +0 -124
  195. data/rbi/courier/models/inbound_bulk_message_user.rbi +0 -88
  196. data/rbi/courier/resources/bulk.rbi +0 -102
  197. data/sig/courier/models/bulk_add_users_params.rbs +0 -28
  198. data/sig/courier/models/bulk_create_job_params.rbs +0 -24
  199. data/sig/courier/models/bulk_create_job_response.rbs +0 -13
  200. data/sig/courier/models/bulk_list_users_params.rbs +0 -28
  201. data/sig/courier/models/bulk_list_users_response.rbs +0 -65
  202. data/sig/courier/models/bulk_retrieve_job_params.rbs +0 -23
  203. data/sig/courier/models/bulk_retrieve_job_response.rbs +0 -66
  204. data/sig/courier/models/bulk_run_job_params.rbs +0 -23
  205. data/sig/courier/models/inbound_bulk_message.rbs +0 -58
  206. data/sig/courier/models/inbound_bulk_message_user.rbs +0 -42
  207. data/sig/courier/resources/bulk.rbs +0 -34
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.20.0"
4
+ VERSION = "4.22.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -54,7 +54,6 @@ require_relative "courier/internal/transport/pooled_net_requester"
54
54
  require_relative "courier/client"
55
55
  require_relative "courier/models/elemental_base_node"
56
56
  require_relative "courier/models/brand_template"
57
- require_relative "courier/models/inbound_bulk_message_user"
58
57
  require_relative "courier/models/base_check"
59
58
  require_relative "courier/models/subscription_topic_new"
60
59
  require_relative "courier/models/elemental_channel_node"
@@ -125,14 +124,6 @@ require_relative "courier/models/brand_settings_in_app"
125
124
  require_relative "courier/models/brand_snippet"
126
125
  require_relative "courier/models/brand_snippets"
127
126
  require_relative "courier/models/brand_update_params"
128
- require_relative "courier/models/bulk_add_users_params"
129
- require_relative "courier/models/bulk_create_job_params"
130
- require_relative "courier/models/bulk_create_job_response"
131
- require_relative "courier/models/bulk_list_users_params"
132
- require_relative "courier/models/bulk_list_users_response"
133
- require_relative "courier/models/bulk_retrieve_job_params"
134
- require_relative "courier/models/bulk_retrieve_job_response"
135
- require_relative "courier/models/bulk_run_job_params"
136
127
  require_relative "courier/models/cancel_journey_response"
137
128
  require_relative "courier/models/channel"
138
129
  require_relative "courier/models/channel_classification"
@@ -165,9 +156,10 @@ require_relative "courier/models/email_header"
165
156
  require_relative "courier/models/expo"
166
157
  require_relative "courier/models/filter_config"
167
158
  require_relative "courier/models/icons"
168
- require_relative "courier/models/inbound_bulk_message"
169
159
  require_relative "courier/models/inbound_track_event_params"
170
160
  require_relative "courier/models/inbound_track_event_response"
161
+ require_relative "courier/models/inbox/message_delete_params"
162
+ require_relative "courier/models/inbox/message_restore_params"
171
163
  require_relative "courier/models/intercom"
172
164
  require_relative "courier/models/intercom_recipient"
173
165
  require_relative "courier/models/journey"
@@ -431,10 +423,11 @@ require_relative "courier/resources/auth"
431
423
  require_relative "courier/resources/automations"
432
424
  require_relative "courier/resources/automations/invoke"
433
425
  require_relative "courier/resources/brands"
434
- require_relative "courier/resources/bulk"
435
426
  require_relative "courier/resources/digests"
436
427
  require_relative "courier/resources/digests/schedules"
437
428
  require_relative "courier/resources/inbound"
429
+ require_relative "courier/resources/inbox"
430
+ require_relative "courier/resources/inbox/messages"
438
431
  require_relative "courier/resources/journeys"
439
432
  require_relative "courier/resources/journeys/templates"
440
433
  require_relative "courier/resources/lists"
@@ -13,63 +13,98 @@ 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
+ # Manage the logos, colors, and layout that give the templates you send a
52
+ # consistent look.
37
53
  sig { returns(Courier::Resources::Brands) }
38
54
  attr_reader :brands
39
55
 
40
- sig { returns(Courier::Resources::Bulk) }
41
- attr_reader :bulk
42
-
43
56
  sig { returns(Courier::Resources::Digests) }
44
57
  attr_reader :digests
45
58
 
59
+ # Record an inbound event that triggers the journeys and automations mapped to it.
46
60
  sig { returns(Courier::Resources::Inbound) }
47
61
  attr_reader :inbound
48
62
 
63
+ # Manage static groups of users that you subscribe explicitly, and send to them by
64
+ # list id or list pattern.
49
65
  sig { returns(Courier::Resources::Lists) }
50
66
  attr_reader :lists
51
67
 
68
+ sig { returns(Courier::Resources::Inbox) }
69
+ attr_reader :inbox
70
+
71
+ # Look up the messages Courier has accepted, inspect their delivery history and
72
+ # rendered output, and cancel, resend, or archive them.
52
73
  sig { returns(Courier::Resources::Messages) }
53
74
  attr_reader :messages
54
75
 
76
+ # Look up the messages Courier has accepted, inspect their delivery history and
77
+ # rendered output, and cancel, resend, or archive them.
55
78
  sig { returns(Courier::Resources::Requests) }
56
79
  attr_reader :requests
57
80
 
81
+ # Create, update, version, publish, and localize notification templates and their
82
+ # content.
58
83
  sig { returns(Courier::Resources::Notifications) }
59
84
  attr_reader :notifications
60
85
 
86
+ # Define reusable channel routing and failover strategies, and see which templates
87
+ # use them.
61
88
  sig { returns(Courier::Resources::RoutingStrategies) }
62
89
  attr_reader :routing_strategies
63
90
 
91
+ # Manage the workspace catalog of subscription topics, the sections that group
92
+ # them, and publishing the preference page.
64
93
  sig { returns(Courier::Resources::WorkspacePreferences) }
65
94
  attr_reader :workspace_preferences
66
95
 
96
+ # Store the contact information Courier delivers to for each user — email, phone
97
+ # number, push tokens, and any custom data you send to.
67
98
  sig { returns(Courier::Resources::Profiles) }
68
99
  attr_reader :profiles
69
100
 
101
+ # Manage tenants — the organizations, teams, or accounts your users belong to —
102
+ # along with their users and default preferences.
70
103
  sig { returns(Courier::Resources::Tenants) }
71
104
  attr_reader :tenants
72
105
 
106
+ # Store and retrieve the translation strings Courier uses to render localized
107
+ # template content.
73
108
  sig { returns(Courier::Resources::Translations) }
74
109
  attr_reader :translations
75
110
 
@@ -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,40 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Inbox
6
+ class MessageDeleteParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Inbox::MessageDeleteParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :message_id
20
+
21
+ sig do
22
+ params(
23
+ message_id: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(message_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { message_id: String, request_options: Courier::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ module Inbox
6
+ class MessageRestoreParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ OrHash =
11
+ T.type_alias do
12
+ T.any(
13
+ Courier::Inbox::MessageRestoreParams,
14
+ Courier::Internal::AnyHash
15
+ )
16
+ end
17
+
18
+ sig { returns(String) }
19
+ attr_accessor :message_id
20
+
21
+ sig do
22
+ params(
23
+ message_id: String,
24
+ request_options: Courier::RequestOptions::OrHash
25
+ ).returns(T.attached_class)
26
+ end
27
+ def self.new(message_id:, request_options: {})
28
+ end
29
+
30
+ sig do
31
+ override.returns(
32
+ { message_id: String, request_options: Courier::RequestOptions }
33
+ )
34
+ end
35
+ def to_hash
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -11,15 +11,41 @@ module Courier
11
11
  T.any(Courier::JourneyCancelParams, Courier::Internal::AnyHash)
12
12
  end
13
13
 
14
+ sig { returns(T.nilable(String)) }
15
+ attr_reader :idempotency_key
16
+
17
+ sig { params(idempotency_key: String).void }
18
+ attr_writer :idempotency_key
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :x_idempotency_expiration
22
+
23
+ sig { params(x_idempotency_expiration: String).void }
24
+ attr_writer :x_idempotency_expiration
25
+
14
26
  sig do
15
- params(request_options: Courier::RequestOptions::OrHash).returns(
16
- T.attached_class
17
- )
27
+ params(
28
+ idempotency_key: String,
29
+ x_idempotency_expiration: String,
30
+ request_options: Courier::RequestOptions::OrHash
31
+ ).returns(T.attached_class)
18
32
  end
19
- def self.new(request_options: {})
33
+ def self.new(
34
+ idempotency_key: nil,
35
+ x_idempotency_expiration: nil,
36
+ request_options: {}
37
+ )
20
38
  end
21
39
 
22
- sig { override.returns({ request_options: Courier::RequestOptions }) }
40
+ sig do
41
+ override.returns(
42
+ {
43
+ idempotency_key: String,
44
+ x_idempotency_expiration: String,
45
+ request_options: Courier::RequestOptions
46
+ }
47
+ )
48
+ end
23
49
  def to_hash
24
50
  end
25
51
  end
@@ -11,15 +11,41 @@ module Courier
11
11
  T.any(Courier::JourneyCreateParams, Courier::Internal::AnyHash)
12
12
  end
13
13
 
14
+ sig { returns(T.nilable(String)) }
15
+ attr_reader :idempotency_key
16
+
17
+ sig { params(idempotency_key: String).void }
18
+ attr_writer :idempotency_key
19
+
20
+ sig { returns(T.nilable(String)) }
21
+ attr_reader :x_idempotency_expiration
22
+
23
+ sig { params(x_idempotency_expiration: String).void }
24
+ attr_writer :x_idempotency_expiration
25
+
14
26
  sig do
15
- params(request_options: Courier::RequestOptions::OrHash).returns(
16
- T.attached_class
17
- )
27
+ params(
28
+ idempotency_key: String,
29
+ x_idempotency_expiration: String,
30
+ request_options: Courier::RequestOptions::OrHash
31
+ ).returns(T.attached_class)
18
32
  end
19
- def self.new(request_options: {})
33
+ def self.new(
34
+ idempotency_key: nil,
35
+ x_idempotency_expiration: nil,
36
+ request_options: {}
37
+ )
20
38
  end
21
39
 
22
- sig { override.returns({ request_options: Courier::RequestOptions }) }
40
+ sig do
41
+ override.returns(
42
+ {
43
+ idempotency_key: String,
44
+ x_idempotency_expiration: String,
45
+ request_options: Courier::RequestOptions
46
+ }
47
+ )
48
+ end
23
49
  def to_hash
24
50
  end
25
51
  end
@@ -14,18 +14,42 @@ module Courier
14
14
  sig { returns(String) }
15
15
  attr_accessor :template_id
16
16
 
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :idempotency_key
19
+
20
+ sig { params(idempotency_key: String).void }
21
+ attr_writer :idempotency_key
22
+
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :x_idempotency_expiration
25
+
26
+ sig { params(x_idempotency_expiration: String).void }
27
+ attr_writer :x_idempotency_expiration
28
+
17
29
  sig do
18
30
  params(
19
31
  template_id: String,
32
+ idempotency_key: String,
33
+ x_idempotency_expiration: String,
20
34
  request_options: Courier::RequestOptions::OrHash
21
35
  ).returns(T.attached_class)
22
36
  end
23
- def self.new(template_id:, request_options: {})
37
+ def self.new(
38
+ template_id:,
39
+ idempotency_key: nil,
40
+ x_idempotency_expiration: nil,
41
+ request_options: {}
42
+ )
24
43
  end
25
44
 
26
45
  sig do
27
46
  override.returns(
28
- { template_id: String, request_options: Courier::RequestOptions }
47
+ {
48
+ template_id: String,
49
+ idempotency_key: String,
50
+ x_idempotency_expiration: String,
51
+ request_options: Courier::RequestOptions
52
+ }
29
53
  )
30
54
  end
31
55
  def to_hash
@@ -14,18 +14,42 @@ module Courier
14
14
  sig { returns(String) }
15
15
  attr_accessor :template_id
16
16
 
17
+ sig { returns(T.nilable(String)) }
18
+ attr_reader :idempotency_key
19
+
20
+ sig { params(idempotency_key: String).void }
21
+ attr_writer :idempotency_key
22
+
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :x_idempotency_expiration
25
+
26
+ sig { params(x_idempotency_expiration: String).void }
27
+ attr_writer :x_idempotency_expiration
28
+
17
29
  sig do
18
30
  params(
19
31
  template_id: String,
32
+ idempotency_key: String,
33
+ x_idempotency_expiration: String,
20
34
  request_options: Courier::RequestOptions::OrHash
21
35
  ).returns(T.attached_class)
22
36
  end
23
- def self.new(template_id:, request_options: {})
37
+ def self.new(
38
+ template_id:,
39
+ idempotency_key: nil,
40
+ x_idempotency_expiration: nil,
41
+ request_options: {}
42
+ )
24
43
  end
25
44
 
26
45
  sig do
27
46
  override.returns(
28
- { template_id: String, request_options: Courier::RequestOptions }
47
+ {
48
+ template_id: String,
49
+ idempotency_key: String,
50
+ x_idempotency_expiration: String,
51
+ request_options: Courier::RequestOptions
52
+ }
29
53
  )
30
54
  end
31
55
  def to_hash
@@ -18,18 +18,42 @@ module Courier
18
18
  sig { returns(String) }
19
19
  attr_accessor :template_id
20
20
 
21
+ sig { returns(T.nilable(String)) }
22
+ attr_reader :idempotency_key
23
+
24
+ sig { params(idempotency_key: String).void }
25
+ attr_writer :idempotency_key
26
+
27
+ sig { returns(T.nilable(String)) }
28
+ attr_reader :x_idempotency_expiration
29
+
30
+ sig { params(x_idempotency_expiration: String).void }
31
+ attr_writer :x_idempotency_expiration
32
+
21
33
  sig do
22
34
  params(
23
35
  template_id: String,
36
+ idempotency_key: String,
37
+ x_idempotency_expiration: String,
24
38
  request_options: Courier::RequestOptions::OrHash
25
39
  ).returns(T.attached_class)
26
40
  end
27
- def self.new(template_id:, request_options: {})
41
+ def self.new(
42
+ template_id:,
43
+ idempotency_key: nil,
44
+ x_idempotency_expiration: nil,
45
+ request_options: {}
46
+ )
28
47
  end
29
48
 
30
49
  sig do
31
50
  override.returns(
32
- { template_id: String, request_options: Courier::RequestOptions }
51
+ {
52
+ template_id: String,
53
+ idempotency_key: String,
54
+ x_idempotency_expiration: String,
55
+ request_options: Courier::RequestOptions
56
+ }
33
57
  )
34
58
  end
35
59
  def to_hash
@@ -21,14 +21,34 @@ module Courier
21
21
  sig { returns(String) }
22
22
  attr_accessor :notification_id
23
23
 
24
+ sig { returns(T.nilable(String)) }
25
+ attr_reader :idempotency_key
26
+
27
+ sig { params(idempotency_key: String).void }
28
+ attr_writer :idempotency_key
29
+
30
+ sig { returns(T.nilable(String)) }
31
+ attr_reader :x_idempotency_expiration
32
+
33
+ sig { params(x_idempotency_expiration: String).void }
34
+ attr_writer :x_idempotency_expiration
35
+
24
36
  sig do
25
37
  params(
26
38
  template_id: String,
27
39
  notification_id: String,
40
+ idempotency_key: String,
41
+ x_idempotency_expiration: String,
28
42
  request_options: Courier::RequestOptions::OrHash
29
43
  ).returns(T.attached_class)
30
44
  end
31
- def self.new(template_id:, notification_id:, request_options: {})
45
+ def self.new(
46
+ template_id:,
47
+ notification_id:,
48
+ idempotency_key: nil,
49
+ x_idempotency_expiration: nil,
50
+ request_options: {}
51
+ )
32
52
  end
33
53
 
34
54
  sig do
@@ -36,6 +56,8 @@ module Courier
36
56
  {
37
57
  template_id: String,
38
58
  notification_id: String,
59
+ idempotency_key: String,
60
+ x_idempotency_expiration: String,
39
61
  request_options: Courier::RequestOptions
40
62
  }
41
63
  )