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
@@ -5,27 +5,36 @@ module Courier
5
5
  module Users
6
6
  class TopicPreference < Courier::Internal::Type::BaseModel
7
7
  # @!attribute default_status
8
+ # The topic's default status, returned on reads. It applies whenever the user has
9
+ # no override of their own (status equals this value).
8
10
  #
9
11
  # @return [Symbol, Courier::Models::PreferenceStatus]
10
12
  required :default_status, enum: -> { Courier::PreferenceStatus }
11
13
 
12
14
  # @!attribute status
15
+ # The user's subscription status for this topic. OPTED_IN or OPTED_OUT reflect the
16
+ # user's own choice; REQUIRED is a topic-level default set in the preferences
17
+ # editor, not a user choice.
13
18
  #
14
19
  # @return [Symbol, Courier::Models::PreferenceStatus]
15
20
  required :status, enum: -> { Courier::PreferenceStatus }
16
21
 
17
22
  # @!attribute topic_id
23
+ # The unique identifier of the subscription topic this preference applies to.
18
24
  #
19
25
  # @return [String]
20
26
  required :topic_id, String
21
27
 
22
28
  # @!attribute topic_name
29
+ # The display name of the subscription topic, returned on reads.
23
30
  #
24
31
  # @return [String]
25
32
  required :topic_name, String
26
33
 
27
34
  # @!attribute custom_routing
28
- # The Channels a user has chosen to receive notifications through for this topic
35
+ # The channels the user has chosen to receive this topic on, present only when
36
+ # has_custom_routing is true. One or more of: direct_message, email, push, sms,
37
+ # webhook, inbox.
29
38
  #
30
39
  # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
31
40
  optional :custom_routing,
@@ -33,22 +42,27 @@ module Courier
33
42
  nil?: true
34
43
 
35
44
  # @!attribute has_custom_routing
45
+ # Whether the user has chosen specific delivery channels for this topic (listed in
46
+ # custom_routing) rather than the topic's default routing.
36
47
  #
37
48
  # @return [Boolean, nil]
38
49
  optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
39
50
 
40
51
  # @!method initialize(default_status:, status:, topic_id:, topic_name:, custom_routing: nil, has_custom_routing: nil)
41
- # @param default_status [Symbol, Courier::Models::PreferenceStatus]
52
+ # Some parameter documentations has been truncated, see
53
+ # {Courier::Models::Users::TopicPreference} for more details.
42
54
  #
43
- # @param status [Symbol, Courier::Models::PreferenceStatus]
55
+ # @param default_status [Symbol, Courier::Models::PreferenceStatus] The topic's default status, returned on reads. It applies whenever the user has
44
56
  #
45
- # @param topic_id [String]
57
+ # @param status [Symbol, Courier::Models::PreferenceStatus] The user's subscription status for this topic. OPTED_IN or OPTED_OUT reflect the
46
58
  #
47
- # @param topic_name [String]
59
+ # @param topic_id [String] The unique identifier of the subscription topic this preference applies to.
48
60
  #
49
- # @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The Channels a user has chosen to receive notifications through for this topic
61
+ # @param topic_name [String] The display name of the subscription topic, returned on reads.
50
62
  #
51
- # @param has_custom_routing [Boolean, nil]
63
+ # @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The channels the user has chosen to receive this topic on, present only when has
64
+ #
65
+ # @param has_custom_routing [Boolean, nil] Whether the user has chosen specific delivery channels for this topic (listed in
52
66
  end
53
67
  end
54
68
  end
@@ -7,7 +7,19 @@ module Courier
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute idempotency_key
11
+ #
12
+ # @return [String, nil]
13
+ optional :idempotency_key, String
14
+
15
+ # @!attribute x_idempotency_expiration
16
+ #
17
+ # @return [String, nil]
18
+ optional :x_idempotency_expiration, String
19
+
20
+ # @!method initialize(idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
21
+ # @param idempotency_key [String]
22
+ # @param x_idempotency_expiration [String]
11
23
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
12
24
  end
13
25
  end
@@ -7,7 +7,19 @@ module Courier
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
10
- # @!method initialize(request_options: {})
10
+ # @!attribute idempotency_key
11
+ #
12
+ # @return [String, nil]
13
+ optional :idempotency_key, String
14
+
15
+ # @!attribute x_idempotency_expiration
16
+ #
17
+ # @return [String, nil]
18
+ optional :x_idempotency_expiration, String
19
+
20
+ # @!method initialize(idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
21
+ # @param idempotency_key [String]
22
+ # @param x_idempotency_expiration [String]
11
23
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
12
24
  end
13
25
  end
@@ -13,8 +13,20 @@ module Courier
13
13
  # @return [String]
14
14
  required :section_id, String
15
15
 
16
- # @!method initialize(section_id:, request_options: {})
16
+ # @!attribute idempotency_key
17
+ #
18
+ # @return [String, nil]
19
+ optional :idempotency_key, String
20
+
21
+ # @!attribute x_idempotency_expiration
22
+ #
23
+ # @return [String, nil]
24
+ optional :x_idempotency_expiration, String
25
+
26
+ # @!method initialize(section_id:, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
17
27
  # @param section_id [String]
28
+ # @param idempotency_key [String]
29
+ # @param x_idempotency_expiration [String]
18
30
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
19
31
  end
20
32
  end
@@ -113,6 +113,34 @@ module Courier
113
113
 
114
114
  BrandUpdateParams = Courier::Models::BrandUpdateParams
115
115
 
116
+ Broadcast = Courier::Models::Broadcast
117
+
118
+ BroadcastArchiveParams = Courier::Models::BroadcastArchiveParams
119
+
120
+ BroadcastCancelParams = Courier::Models::BroadcastCancelParams
121
+
122
+ BroadcastCreateParams = Courier::Models::BroadcastCreateParams
123
+
124
+ BroadcastDuplicateParams = Courier::Models::BroadcastDuplicateParams
125
+
126
+ BroadcastListParams = Courier::Models::BroadcastListParams
127
+
128
+ BroadcastListResponse = Courier::Models::BroadcastListResponse
129
+
130
+ BroadcastPutContentParams = Courier::Models::BroadcastPutContentParams
131
+
132
+ BroadcastRetrieveContentParams = Courier::Models::BroadcastRetrieveContentParams
133
+
134
+ BroadcastRetrieveParams = Courier::Models::BroadcastRetrieveParams
135
+
136
+ BroadcastSchedule = Courier::Models::BroadcastSchedule
137
+
138
+ BroadcastScheduleParams = Courier::Models::BroadcastScheduleParams
139
+
140
+ BroadcastSendParams = Courier::Models::BroadcastSendParams
141
+
142
+ BroadcastUpdateParams = Courier::Models::BroadcastUpdateParams
143
+
116
144
  CancelJourneyRequest = Courier::Models::CancelJourneyRequest
117
145
 
118
146
  CancelJourneyResponse = Courier::Models::CancelJourneyResponse
@@ -127,6 +155,8 @@ module Courier
127
155
 
128
156
  Check = Courier::Models::Check
129
157
 
158
+ CreateBroadcastRequest = Courier::Models::CreateBroadcastRequest
159
+
130
160
  CreateJourneyRequest = Courier::Models::CreateJourneyRequest
131
161
 
132
162
  DefaultPreferences = Courier::Models::DefaultPreferences
@@ -185,6 +215,8 @@ module Courier
185
215
 
186
216
  InboundTrackEventParams = Courier::Models::InboundTrackEventParams
187
217
 
218
+ Inbox = Courier::Models::Inbox
219
+
188
220
  Intercom = Courier::Models::Intercom
189
221
 
190
222
  IntercomRecipient = Courier::Models::IntercomRecipient
@@ -472,6 +504,10 @@ module Courier
472
504
 
473
505
  Rule = Courier::Models::Rule
474
506
 
507
+ ScheduleBroadcastRequest = Courier::Models::ScheduleBroadcastRequest
508
+
509
+ SendBroadcastRequest = Courier::Models::SendBroadcastRequest
510
+
475
511
  SendDirectMessage = Courier::Models::SendDirectMessage
476
512
 
477
513
  SendMessageParams = Courier::Models::SendMessageParams
@@ -534,6 +570,8 @@ module Courier
534
570
 
535
571
  TranslationUpdateParams = Courier::Models::TranslationUpdateParams
536
572
 
573
+ UpdateBroadcastRequest = Courier::Models::UpdateBroadcastRequest
574
+
537
575
  UserProfile = Courier::Models::UserProfile
538
576
 
539
577
  UserProfileFirebaseToken = Courier::Models::UserProfileFirebaseToken
@@ -2,8 +2,11 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Define filter-based groups whose membership Courier recalculates as user
6
+ # profiles change.
5
7
  class Audiences
6
- # Returns the specified audience by id.
8
+ # Returns one audience with its name, description, and the filter and AND or OR
9
+ # operator that decide which users belong to it.
7
10
  #
8
11
  # @overload retrieve(audience_id, request_options: {})
9
12
  #
@@ -26,7 +29,8 @@ module Courier
26
29
  # Some parameter documentations has been truncated, see
27
30
  # {Courier::Models::AudienceUpdateParams} for more details.
28
31
  #
29
- # Creates or updates audience.
32
+ # Creates or replaces an audience from a filter and an AND or OR operator.
33
+ # Membership recalculates automatically as profiles change.
30
34
  #
31
35
  # @overload update(audience_id, description: nil, filter: nil, name: nil, operator: nil, request_options: {})
32
36
  #
@@ -56,7 +60,8 @@ module Courier
56
60
  )
57
61
  end
58
62
 
59
- # Get the audiences associated with the authorization token.
63
+ # Returns the audiences in the workspace with paging. Audiences are filter-based
64
+ # groups that recalculate as user profiles change.
60
65
  #
61
66
  # @overload list(cursor: nil, request_options: {})
62
67
  #
@@ -79,7 +84,8 @@ module Courier
79
84
  )
80
85
  end
81
86
 
82
- # Deletes the specified audience.
87
+ # Deletes an audience permanently, so update any caller sending to it by audience
88
+ # id first. Those sends fail once the audience is gone.
83
89
  #
84
90
  # @overload delete(audience_id, request_options: {})
85
91
  #
@@ -99,7 +105,8 @@ module Courier
99
105
  )
100
106
  end
101
107
 
102
- # Get list of members of an audience.
108
+ # Returns the users currently matching an audience filter, with paging. Membership
109
+ # is recalculated, so results shift as profiles change.
103
110
  #
104
111
  # @overload list_members(audience_id, cursor: nil, request_options: {})
105
112
  #
@@ -2,8 +2,10 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Read the audit trail of configuration and access changes in your workspace.
5
6
  class AuditEvents
6
- # Fetch a specific audit event by ID.
7
+ # Returns one audit event by id, including the actor who performed it, the target
8
+ # they changed, the source, the event type, and a timestamp.
7
9
  #
8
10
  # @overload retrieve(audit_event_id, request_options: {})
9
11
  #
@@ -23,7 +25,8 @@ module Courier
23
25
  )
24
26
  end
25
27
 
26
- # Fetch the list of audit events
28
+ # Returns the workspace's audit event log with cursor paging. Each event records
29
+ # the actor, target, source, type, and timestamp of a change.
27
30
  #
28
31
  # @overload list(cursor: nil, request_options: {})
29
32
  #
@@ -2,11 +2,15 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Issue scoped, short-lived JWTs so client-side SDKs — Inbox, Preferences, and the
6
+ # embedded designer — can call Courier as a single user. Server-side requests
7
+ # authenticate with your workspace API key instead.
5
8
  class Auth
6
9
  # Some parameter documentations has been truncated, see
7
10
  # {Courier::Models::AuthIssueTokenParams} for more details.
8
11
  #
9
- # Returns a new access token.
12
+ # Returns a JWT for authenticating client-side SDKs such as the Inbox. You supply
13
+ # the scope and an expires_in duration, both required.
10
14
  #
11
15
  # @overload issue_token(expires_in:, scope:, request_options: {})
12
16
  #
@@ -3,20 +3,33 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Automations
6
+ # Invoke a stored automation template or an ad hoc automation defined in the
7
+ # request.
6
8
  class Invoke
7
- # Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a
8
- # series of automation steps. For information about what steps are available,
9
- # checkout the ad hoc automation guide
10
- # [here](https://www.courier.com/docs/automations/steps/).
11
- #
12
- # @overload invoke_ad_hoc(automation:, brand: nil, data: nil, profile: nil, recipient: nil, template: nil, request_options: {})
13
- #
14
- # @param automation [Courier::Models::Automations::InvokeInvokeAdHocParams::Automation]
15
- # @param brand [String, nil]
16
- # @param data [Hash{Symbol=>Object}, nil]
17
- # @param profile [Hash{Symbol=>Object}, nil]
18
- # @param recipient [String, nil]
19
- # @param template [String, nil]
9
+ # Some parameter documentations has been truncated, see
10
+ # {Courier::Models::Automations::InvokeInvokeAdHocParams} for more details.
11
+ #
12
+ # Runs a series of automation steps supplied inline, without a saved template, and
13
+ # returns a runId.
14
+ #
15
+ # @overload invoke_ad_hoc(automation:, brand: nil, data: nil, profile: nil, recipient: nil, template: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
16
+ #
17
+ # @param automation [Courier::Models::Automations::InvokeInvokeAdHocParams::Automation] Body param
18
+ #
19
+ # @param brand [String, nil] Body param
20
+ #
21
+ # @param data [Hash{Symbol=>Object}, nil] Body param
22
+ #
23
+ # @param profile [Hash{Symbol=>Object}, nil] Body param
24
+ #
25
+ # @param recipient [String, nil] Body param
26
+ #
27
+ # @param template [String, nil] Body param
28
+ #
29
+ # @param idempotency_key [String] Header param: A unique key that makes this request idempotent. If Courier receiv
30
+ #
31
+ # @param x_idempotency_expiration [String] Header param: How long the idempotency key remains valid, as a Unix epoch timest
32
+ #
20
33
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
21
34
  #
22
35
  # @return [Courier::Models::AutomationInvokeResponse]
@@ -24,10 +37,13 @@ module Courier
24
37
  # @see Courier::Models::Automations::InvokeInvokeAdHocParams
25
38
  def invoke_ad_hoc(params)
26
39
  parsed, options = Courier::Automations::InvokeInvokeAdHocParams.dump_request(params)
40
+ header_params =
41
+ {idempotency_key: "idempotency-key", x_idempotency_expiration: "x-idempotency-expiration"}
27
42
  @client.request(
28
43
  method: :post,
29
44
  path: "automations/invoke",
30
- body: parsed,
45
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
46
+ body: parsed.except(*header_params.keys),
31
47
  model: Courier::AutomationInvokeResponse,
32
48
  options: options
33
49
  )
@@ -36,21 +52,26 @@ module Courier
36
52
  # Some parameter documentations has been truncated, see
37
53
  # {Courier::Models::Automations::InvokeInvokeByTemplateParams} for more details.
38
54
  #
39
- # Invoke an automation run from an automation template.
55
+ # Starts an automation run from a saved template for one recipient, with optional
56
+ # data and profile, and returns a runId.
57
+ #
58
+ # @overload invoke_by_template(template_id, recipient:, brand: nil, data: nil, profile: nil, template: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
59
+ #
60
+ # @param template_id [String] Path param: A unique identifier representing the automation template to be invok
40
61
  #
41
- # @overload invoke_by_template(template_id, recipient:, brand: nil, data: nil, profile: nil, template: nil, request_options: {})
62
+ # @param recipient [String, nil] Body param
42
63
  #
43
- # @param template_id [String] A unique identifier representing the automation template to be invoked. This cou
64
+ # @param brand [String, nil] Body param
44
65
  #
45
- # @param recipient [String, nil]
66
+ # @param data [Hash{Symbol=>Object}, nil] Body param
46
67
  #
47
- # @param brand [String, nil]
68
+ # @param profile [Hash{Symbol=>Object}, nil] Body param
48
69
  #
49
- # @param data [Hash{Symbol=>Object}, nil]
70
+ # @param template [String, nil] Body param
50
71
  #
51
- # @param profile [Hash{Symbol=>Object}, nil]
72
+ # @param idempotency_key [String] Header param: A unique key that makes this request idempotent. If Courier receiv
52
73
  #
53
- # @param template [String, nil]
74
+ # @param x_idempotency_expiration [String] Header param: How long the idempotency key remains valid, as a Unix epoch timest
54
75
  #
55
76
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
56
77
  #
@@ -59,10 +80,13 @@ module Courier
59
80
  # @see Courier::Models::Automations::InvokeInvokeByTemplateParams
60
81
  def invoke_by_template(template_id, params)
61
82
  parsed, options = Courier::Automations::InvokeInvokeByTemplateParams.dump_request(params)
83
+ header_params =
84
+ {idempotency_key: "idempotency-key", x_idempotency_expiration: "x-idempotency-expiration"}
62
85
  @client.request(
63
86
  method: :post,
64
87
  path: ["automations/%1$s/invoke", template_id],
65
- body: parsed,
88
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
89
+ body: parsed.except(*header_params.keys),
66
90
  model: Courier::AutomationInvokeResponse,
67
91
  options: options
68
92
  )
@@ -2,14 +2,19 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Invoke a stored automation template or an ad hoc automation defined in the
6
+ # request.
5
7
  class Automations
8
+ # Invoke a stored automation template or an ad hoc automation defined in the
9
+ # request.
6
10
  # @return [Courier::Resources::Automations::Invoke]
7
11
  attr_reader :invoke
8
12
 
9
13
  # Some parameter documentations has been truncated, see
10
14
  # {Courier::Models::AutomationListParams} for more details.
11
15
  #
12
- # Get the list of automations.
16
+ # Lists the workspace's saved automation templates, each with its id and a cursor
17
+ # for paging to the next page of results.
13
18
  #
14
19
  # @overload list(cursor: nil, version: nil, request_options: {})
15
20
  #
@@ -2,16 +2,29 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Manage the logos, colors, and layout that give the templates you send a
6
+ # consistent look.
5
7
  class Brands
6
- # Create a new brand. Requires `name` and `settings` (with at least
7
- # `colors.primary` and `colors.secondary`).
8
+ # Some parameter documentations has been truncated, see
9
+ # {Courier::Models::BrandCreateParams} for more details.
8
10
  #
9
- # @overload create(name:, settings:, id: nil, snippets: nil, request_options: {})
11
+ # Creates a brand from a name and settings, including primary and secondary
12
+ # colors. Brands supply the logo, colors, and styling that templates render with.
13
+ #
14
+ # @overload create(name:, settings:, id: nil, snippets: nil, idempotency_key: nil, x_idempotency_expiration: nil, request_options: {})
15
+ #
16
+ # @param name [String] Body param
17
+ #
18
+ # @param settings [Courier::Models::BrandSettings] Body param
19
+ #
20
+ # @param id [String, nil] Body param
21
+ #
22
+ # @param snippets [Courier::Models::BrandSnippets, nil] Body param
23
+ #
24
+ # @param idempotency_key [String] Header param: A unique key that makes this request idempotent. If Courier receiv
25
+ #
26
+ # @param x_idempotency_expiration [String] Header param: How long the idempotency key remains valid, as a Unix epoch timest
10
27
  #
11
- # @param name [String]
12
- # @param settings [Courier::Models::BrandSettings]
13
- # @param id [String, nil]
14
- # @param snippets [Courier::Models::BrandSnippets, nil]
15
28
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
16
29
  #
17
30
  # @return [Courier::Models::Brand]
@@ -19,10 +32,20 @@ module Courier
19
32
  # @see Courier::Models::BrandCreateParams
20
33
  def create(params)
21
34
  parsed, options = Courier::BrandCreateParams.dump_request(params)
22
- @client.request(method: :post, path: "brands", body: parsed, model: Courier::Brand, options: options)
35
+ header_params =
36
+ {idempotency_key: "idempotency-key", x_idempotency_expiration: "x-idempotency-expiration"}
37
+ @client.request(
38
+ method: :post,
39
+ path: "brands",
40
+ headers: parsed.slice(*header_params.keys).transform_keys(header_params),
41
+ body: parsed.except(*header_params.keys),
42
+ model: Courier::Brand,
43
+ options: options
44
+ )
23
45
  end
24
46
 
25
- # Fetch a specific brand by brand ID.
47
+ # Returns one brand by id, including its colors, logo and styling settings,
48
+ # Handlebars snippets, and published version.
26
49
  #
27
50
  # @overload retrieve(brand_id, request_options: {})
28
51
  #
@@ -42,7 +65,8 @@ module Courier
42
65
  )
43
66
  end
44
67
 
45
- # Replace an existing brand with the supplied values.
68
+ # Replaces a brand with the values you supply, so send the complete settings and
69
+ # snippets rather than only the fields you want changed.
46
70
  #
47
71
  # @overload update(brand_id, name:, settings: nil, snippets: nil, request_options: {})
48
72
  #
@@ -70,7 +94,8 @@ module Courier
70
94
  )
71
95
  end
72
96
 
73
- # Get the list of brands.
97
+ # Lists the workspace's brands. Every entry carries its name, styling settings,
98
+ # snippets, and published version.
74
99
  #
75
100
  # @overload list(cursor: nil, request_options: {})
76
101
  #
@@ -93,7 +118,8 @@ module Courier
93
118
  )
94
119
  end
95
120
 
96
- # Delete a brand by brand ID.
121
+ # Deletes a brand by id. Reassign any template or tenant that references it before
122
+ # deleting to keep their styling intact.
97
123
  #
98
124
  # @overload delete(brand_id, request_options: {})
99
125
  #