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
@@ -42,12 +42,16 @@ module Courier
42
42
 
43
43
  class Topic < Courier::Internal::Type::BaseModel
44
44
  # @!attribute status
45
+ # The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level
46
+ # default, not a user choice; the API rejects opting a user out of a REQUIRED
47
+ # topic.
45
48
  #
46
49
  # @return [Symbol, Courier::Models::PreferenceStatus]
47
50
  required :status, enum: -> { Courier::PreferenceStatus }
48
51
 
49
52
  # @!attribute custom_routing
50
- # The Channels a user has chosen to receive notifications through for this topic
53
+ # The channels to deliver this topic on when has_custom_routing is true. One or
54
+ # more of: direct_message, email, push, sms, webhook, inbox.
51
55
  #
52
56
  # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
53
57
  optional :custom_routing,
@@ -55,16 +59,22 @@ module Courier
55
59
  nil?: true
56
60
 
57
61
  # @!attribute has_custom_routing
62
+ # Set to true to route this topic to the channels in custom_routing instead of the
63
+ # topic's default routing.
58
64
  #
59
65
  # @return [Boolean, nil]
60
66
  optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
61
67
 
62
68
  # @!method initialize(status:, custom_routing: nil, has_custom_routing: nil)
63
- # @param status [Symbol, Courier::Models::PreferenceStatus]
69
+ # Some parameter documentations has been truncated, see
70
+ # {Courier::Models::Users::PreferenceUpdateOrCreateTopicParams::Topic} for more
71
+ # details.
64
72
  #
65
- # @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The Channels a user has chosen to receive notifications through for this topic
73
+ # @param status [Symbol, Courier::Models::PreferenceStatus] The subscription status to set: OPTED_IN or OPTED_OUT. REQUIRED is a topic-level
66
74
  #
67
- # @param has_custom_routing [Boolean, nil]
75
+ # @param custom_routing [Array<Symbol, Courier::Models::ChannelClassification>, nil] The channels to deliver this topic on when has_custom_routing is true. One or mo
76
+ #
77
+ # @param has_custom_routing [Boolean, nil] Set to true to route this topic to the channels in custom_routing instead of the
68
78
  end
69
79
  end
70
80
  end
@@ -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,16 +113,6 @@ module Courier
113
113
 
114
114
  BrandUpdateParams = Courier::Models::BrandUpdateParams
115
115
 
116
- BulkAddUsersParams = Courier::Models::BulkAddUsersParams
117
-
118
- BulkCreateJobParams = Courier::Models::BulkCreateJobParams
119
-
120
- BulkListUsersParams = Courier::Models::BulkListUsersParams
121
-
122
- BulkRetrieveJobParams = Courier::Models::BulkRetrieveJobParams
123
-
124
- BulkRunJobParams = Courier::Models::BulkRunJobParams
125
-
126
116
  CancelJourneyRequest = Courier::Models::CancelJourneyRequest
127
117
 
128
118
  CancelJourneyResponse = Courier::Models::CancelJourneyResponse
@@ -193,12 +183,10 @@ module Courier
193
183
 
194
184
  Icons = Courier::Models::Icons
195
185
 
196
- InboundBulkMessage = Courier::Models::InboundBulkMessage
197
-
198
- InboundBulkMessageUser = Courier::Models::InboundBulkMessageUser
199
-
200
186
  InboundTrackEventParams = Courier::Models::InboundTrackEventParams
201
187
 
188
+ Inbox = Courier::Models::Inbox
189
+
202
190
  Intercom = Courier::Models::Intercom
203
191
 
204
192
  IntercomRecipient = Courier::Models::IntercomRecipient
@@ -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
  #
@@ -3,13 +3,14 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Digests
6
+ # Inspect what has accumulated in a digest schedule and release a digest ahead of
7
+ # its next scheduled delivery.
6
8
  class Schedules
7
9
  # Some parameter documentations has been truncated, see
8
10
  # {Courier::Models::Digests::ScheduleListInstancesParams} for more details.
9
11
  #
10
- # List the digest instances for a schedule. Each instance represents the events
11
- # accumulated for a single user against the schedule, and can be used to monitor
12
- # digest accumulation before the digest is released.
12
+ # Returns the digest instances for a schedule, one per user, with cursor paging.
13
+ # Use it to see what has accumulated before a digest releases.
13
14
  #
14
15
  # @overload list_instances(schedule_id, cursor: nil, limit: nil, request_options: {})
15
16
  #
@@ -3,6 +3,8 @@
3
3
  module Courier
4
4
  module Resources
5
5
  class Digests
6
+ # Inspect what has accumulated in a digest schedule and release a digest ahead of
7
+ # its next scheduled delivery.
6
8
  # @return [Courier::Resources::Digests::Schedules]
7
9
  attr_reader :schedules
8
10
 
@@ -2,11 +2,13 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
+ # Record an inbound event that triggers the journeys and automations mapped to it.
5
6
  class Inbound
6
7
  # Some parameter documentations has been truncated, see
7
8
  # {Courier::Models::InboundTrackEventParams} for more details.
8
9
  #
9
- # Courier Track Event
10
+ # Records an inbound event that can trigger a journey. Requires an event name, a
11
+ # messageId you generate, a type, and a properties object.
10
12
  #
11
13
  # @overload track_event(event:, message_id:, properties:, type:, user_id: nil, request_options: {})
12
14
  #
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Resources
5
+ class Inbox
6
+ # Manage the messages in a user's in-app inbox.
7
+ class Messages
8
+ # Delete a user's inbox message. The message is removed from every inbox read (it
9
+ # stops appearing in the recipient's Inbox); it can be restored.
10
+ #
11
+ # @overload delete(message_id, request_options: {})
12
+ #
13
+ # @param message_id [String] The message ID of the inbox message to delete.
14
+ #
15
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
16
+ #
17
+ # @return [nil]
18
+ #
19
+ # @see Courier::Models::Inbox::MessageDeleteParams
20
+ def delete(message_id, params = {})
21
+ @client.request(
22
+ method: :delete,
23
+ path: ["inbox/messages/%1$s", message_id],
24
+ model: NilClass,
25
+ options: params[:request_options]
26
+ )
27
+ end
28
+
29
+ # Restore a previously deleted inbox message.
30
+ #
31
+ # @overload restore(message_id, request_options: {})
32
+ #
33
+ # @param message_id [String] The message ID of the inbox message to restore.
34
+ #
35
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
36
+ #
37
+ # @return [nil]
38
+ #
39
+ # @see Courier::Models::Inbox::MessageRestoreParams
40
+ def restore(message_id, params = {})
41
+ @client.request(
42
+ method: :put,
43
+ path: ["inbox/messages/%1$s/restore", message_id],
44
+ model: NilClass,
45
+ options: params[:request_options]
46
+ )
47
+ end
48
+
49
+ # @api private
50
+ #
51
+ # @param client [Courier::Client]
52
+ def initialize(client:)
53
+ @client = client
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Resources
5
+ class Inbox
6
+ # Manage the messages in a user's in-app inbox.
7
+ # @return [Courier::Resources::Inbox::Messages]
8
+ attr_reader :messages
9
+
10
+ # @api private
11
+ #
12
+ # @param client [Courier::Client]
13
+ def initialize(client:)
14
+ @client = client
15
+ @messages = Courier::Resources::Inbox::Messages.new(client: client)
16
+ end
17
+ end
18
+ end
19
+ end