trycourier 4.17.0 → 4.18.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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/lib/courier/client.rb +3 -3
  4. data/lib/courier/models/cancel_journey_request.rb +39 -0
  5. data/lib/courier/models/cancel_journey_response.rb +55 -0
  6. data/lib/courier/models/{preference_section_list_params.rb → journey_cancel_params.rb} +2 -2
  7. data/lib/courier/models/journey_experiment.rb +49 -0
  8. data/lib/courier/models/journey_experiment_variant.rb +44 -0
  9. data/lib/courier/models/journey_node.rb +1 -1
  10. data/lib/courier/models/journey_send_node.rb +23 -10
  11. data/lib/courier/models/publish_preferences_response.rb +1 -1
  12. data/lib/courier/models/{preference_section_archive_params.rb → workspace_preference_archive_params.rb} +2 -2
  13. data/lib/courier/models/workspace_preference_create_params.rb +14 -0
  14. data/lib/courier/models/{preference_section_create_request.rb → workspace_preference_create_request.rb} +8 -8
  15. data/lib/courier/models/{preference_section_get_response.rb → workspace_preference_get_response.rb} +15 -15
  16. data/lib/courier/models/{preference_section_publish_params.rb → workspace_preference_list_params.rb} +2 -2
  17. data/lib/courier/models/workspace_preference_list_response.rb +18 -0
  18. data/lib/courier/models/{preference_section_create_params.rb → workspace_preference_publish_params.rb} +2 -2
  19. data/lib/courier/models/{preference_section_replace_params.rb → workspace_preference_replace_params.rb} +2 -2
  20. data/lib/courier/models/{preference_section_replace_request.rb → workspace_preference_replace_request.rb} +8 -8
  21. data/lib/courier/models/{preference_section_retrieve_params.rb → workspace_preference_retrieve_params.rb} +2 -2
  22. data/lib/courier/models/{preference_topic_create_request.rb → workspace_preference_topic_create_request.rb} +9 -9
  23. data/lib/courier/models/{preference_topic_get_response.rb → workspace_preference_topic_get_response.rb} +8 -8
  24. data/lib/courier/models/workspace_preference_topic_list_response.rb +17 -0
  25. data/lib/courier/models/{preference_topic_replace_request.rb → workspace_preference_topic_replace_request.rb} +8 -8
  26. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rb +2 -2
  27. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rb +3 -3
  28. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rb +2 -2
  29. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rb +3 -3
  30. data/lib/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rb +2 -2
  31. data/lib/courier/models.rb +40 -30
  32. data/lib/courier/resources/journeys.rb +30 -0
  33. data/lib/courier/resources/notifications/checks.rb +3 -3
  34. data/lib/courier/resources/{preference_sections → workspace_preferences}/topics.rb +40 -37
  35. data/lib/courier/resources/{preference_sections.rb → workspace_preferences.rb} +40 -40
  36. data/lib/courier/version.rb +1 -1
  37. data/lib/courier.rb +26 -21
  38. data/rbi/courier/client.rbi +2 -2
  39. data/rbi/courier/models/cancel_journey_request.rbi +68 -0
  40. data/rbi/courier/models/cancel_journey_response.rbi +81 -0
  41. data/rbi/courier/models/journey_cancel_params.rbi +27 -0
  42. data/rbi/courier/models/journey_experiment.rbi +74 -0
  43. data/rbi/courier/models/journey_experiment_variant.rbi +61 -0
  44. data/rbi/courier/models/journey_send_node.rbi +32 -11
  45. data/rbi/courier/models/{preference_section_retrieve_params.rbi → workspace_preference_archive_params.rbi} +2 -2
  46. data/rbi/courier/models/{preference_section_create_params.rbi → workspace_preference_create_params.rbi} +2 -2
  47. data/rbi/courier/models/{preference_section_create_request.rbi → workspace_preference_create_request.rbi} +9 -9
  48. data/rbi/courier/models/{preference_section_get_response.rbi → workspace_preference_get_response.rbi} +17 -16
  49. data/rbi/courier/models/{preference_section_list_params.rbi → workspace_preference_list_params.rbi} +2 -2
  50. data/rbi/courier/models/{preference_topic_list_response.rbi → workspace_preference_list_response.rbi} +6 -6
  51. data/rbi/courier/models/{preference_section_publish_params.rbi → workspace_preference_publish_params.rbi} +2 -2
  52. data/rbi/courier/models/{preference_section_replace_params.rbi → workspace_preference_replace_params.rbi} +2 -2
  53. data/rbi/courier/models/{preference_section_replace_request.rbi → workspace_preference_replace_request.rbi} +9 -9
  54. data/rbi/courier/models/{preference_section_archive_params.rbi → workspace_preference_retrieve_params.rbi} +2 -2
  55. data/rbi/courier/models/{preference_topic_create_request.rbi → workspace_preference_topic_create_request.rbi} +22 -17
  56. data/rbi/courier/models/{preference_topic_get_response.rbi → workspace_preference_topic_get_response.rbi} +23 -17
  57. data/rbi/courier/models/workspace_preference_topic_list_response.rbi +36 -0
  58. data/rbi/courier/models/{preference_topic_replace_request.rbi → workspace_preference_topic_replace_request.rbi} +22 -17
  59. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rbi +2 -2
  60. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rbi +3 -3
  61. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rbi +2 -2
  62. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rbi +3 -3
  63. data/rbi/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rbi +2 -2
  64. data/rbi/courier/models.rbi +53 -36
  65. data/rbi/courier/resources/journeys.rbi +25 -0
  66. data/rbi/courier/resources/notifications/checks.rbi +3 -3
  67. data/rbi/courier/resources/{preference_sections → workspace_preferences}/topics.rbi +25 -22
  68. data/rbi/courier/resources/{preference_sections.rbi → workspace_preferences.rbi} +27 -27
  69. data/sig/courier/client.rbs +1 -1
  70. data/sig/courier/models/cancel_journey_request.rbs +33 -0
  71. data/sig/courier/models/cancel_journey_response.rbs +35 -0
  72. data/sig/courier/models/{preference_section_list_params.rbs → journey_cancel_params.rbs} +2 -2
  73. data/sig/courier/models/journey_experiment.rbs +39 -0
  74. data/sig/courier/models/journey_experiment_variant.rbs +32 -0
  75. data/sig/courier/models/journey_send_node.rbs +19 -8
  76. data/sig/courier/models/{preference_section_retrieve_params.rbs → workspace_preference_archive_params.rbs} +2 -2
  77. data/sig/courier/models/workspace_preference_create_params.rbs +15 -0
  78. data/sig/courier/models/{preference_section_replace_request.rbs → workspace_preference_create_request.rbs} +2 -2
  79. data/sig/courier/models/{preference_section_get_response.rbs → workspace_preference_get_response.rbs} +6 -6
  80. data/sig/courier/models/{preference_section_publish_params.rbs → workspace_preference_list_params.rbs} +2 -2
  81. data/sig/courier/models/workspace_preference_list_response.rbs +18 -0
  82. data/sig/courier/models/{preference_section_create_params.rbs → workspace_preference_publish_params.rbs} +2 -2
  83. data/sig/courier/models/{preference_section_replace_params.rbs → workspace_preference_replace_params.rbs} +2 -2
  84. data/sig/courier/models/{preference_section_create_request.rbs → workspace_preference_replace_request.rbs} +2 -2
  85. data/sig/courier/models/{preference_section_archive_params.rbs → workspace_preference_retrieve_params.rbs} +2 -2
  86. data/sig/courier/models/{preference_topic_create_request.rbs → workspace_preference_topic_create_request.rbs} +12 -12
  87. data/sig/courier/models/{preference_topic_get_response.rbs → workspace_preference_topic_get_response.rbs} +12 -12
  88. data/sig/courier/models/workspace_preference_topic_list_response.rbs +18 -0
  89. data/sig/courier/models/{preference_topic_replace_request.rbs → workspace_preference_topic_replace_request.rbs} +12 -12
  90. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_archive_params.rbs +1 -1
  91. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_create_params.rbs +2 -2
  92. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_list_params.rbs +1 -1
  93. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_replace_params.rbs +2 -2
  94. data/sig/courier/models/{preference_sections → workspace_preferences}/topic_retrieve_params.rbs +1 -1
  95. data/sig/courier/models.rbs +40 -30
  96. data/sig/courier/resources/journeys.rbs +5 -0
  97. data/sig/courier/resources/{preference_sections → workspace_preferences}/topics.rbs +9 -9
  98. data/sig/courier/resources/{preference_sections.rbs → workspace_preferences.rbs} +6 -6
  99. metadata +80 -65
  100. data/lib/courier/models/preference_section_list_response.rb +0 -18
  101. data/lib/courier/models/preference_topic_list_response.rb +0 -17
  102. data/rbi/courier/models/preference_section_list_response.rbi +0 -35
  103. data/sig/courier/models/preference_section_list_response.rbs +0 -18
  104. data/sig/courier/models/preference_topic_list_response.rbs +0 -16
@@ -2,89 +2,89 @@
2
2
 
3
3
  module Courier
4
4
  module Resources
5
- class PreferenceSections
6
- # @return [Courier::Resources::PreferenceSections::Topics]
5
+ class WorkspacePreferences
6
+ # @return [Courier::Resources::WorkspacePreferences::Topics]
7
7
  attr_reader :topics
8
8
 
9
- # Create a preference section in your workspace. The section id is generated and
10
- # returned. Topics are created inside a section via POST
9
+ # Create a workspace preference. The workspace preference id is generated and
10
+ # returned. Topics are created inside a workspace preference via POST
11
11
  # /preferences/sections/{section_id}/topics.
12
12
  #
13
13
  # @overload create(name:, has_custom_routing: nil, routing_options: nil, request_options: {})
14
14
  #
15
- # @param name [String] Human-readable name for the section.
15
+ # @param name [String] Human-readable name for the workspace preference.
16
16
  #
17
- # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
17
+ # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
18
18
  #
19
- # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Defaults to empty if omitted.
19
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Defaults to empty if omitted.
20
20
  #
21
21
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
22
22
  #
23
- # @return [Courier::Models::PreferenceSectionGetResponse]
23
+ # @return [Courier::Models::WorkspacePreferenceGetResponse]
24
24
  #
25
- # @see Courier::Models::PreferenceSectionCreateParams
25
+ # @see Courier::Models::WorkspacePreferenceCreateParams
26
26
  def create(params)
27
- parsed, options = Courier::PreferenceSectionCreateParams.dump_request(params)
27
+ parsed, options = Courier::WorkspacePreferenceCreateParams.dump_request(params)
28
28
  @client.request(
29
29
  method: :post,
30
30
  path: "preferences/sections",
31
31
  body: parsed,
32
- model: Courier::PreferenceSectionGetResponse,
32
+ model: Courier::WorkspacePreferenceGetResponse,
33
33
  options: options
34
34
  )
35
35
  end
36
36
 
37
- # Retrieve a preference section by id, including its topics.
37
+ # Retrieve a workspace preference by id, including its topics.
38
38
  #
39
39
  # @overload retrieve(section_id, request_options: {})
40
40
  #
41
- # @param section_id [String] Id of the preference section.
41
+ # @param section_id [String] Id of the workspace preference.
42
42
  #
43
43
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
44
44
  #
45
- # @return [Courier::Models::PreferenceSectionGetResponse]
45
+ # @return [Courier::Models::WorkspacePreferenceGetResponse]
46
46
  #
47
- # @see Courier::Models::PreferenceSectionRetrieveParams
47
+ # @see Courier::Models::WorkspacePreferenceRetrieveParams
48
48
  def retrieve(section_id, params = {})
49
49
  @client.request(
50
50
  method: :get,
51
51
  path: ["preferences/sections/%1$s", section_id],
52
- model: Courier::PreferenceSectionGetResponse,
52
+ model: Courier::WorkspacePreferenceGetResponse,
53
53
  options: params[:request_options]
54
54
  )
55
55
  end
56
56
 
57
- # List the workspace's preference sections. Each section embeds its topics. Scoped
58
- # to the workspace of the API key.
57
+ # List the workspace's preferences. Each workspace preference embeds its topics.
58
+ # Scoped to the workspace of the API key.
59
59
  #
60
60
  # @overload list(request_options: {})
61
61
  #
62
62
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
63
63
  #
64
- # @return [Courier::Models::PreferenceSectionListResponse]
64
+ # @return [Courier::Models::WorkspacePreferenceListResponse]
65
65
  #
66
- # @see Courier::Models::PreferenceSectionListParams
66
+ # @see Courier::Models::WorkspacePreferenceListParams
67
67
  def list(params = {})
68
68
  @client.request(
69
69
  method: :get,
70
70
  path: "preferences/sections",
71
- model: Courier::PreferenceSectionListResponse,
71
+ model: Courier::WorkspacePreferenceListResponse,
72
72
  options: params[:request_options]
73
73
  )
74
74
  end
75
75
 
76
- # Archive a preference section. The section must be empty: delete its topics
77
- # first, otherwise the request fails with 409.
76
+ # Archive a workspace preference. The workspace preference must be empty: delete
77
+ # its topics first, otherwise the request fails with 409.
78
78
  #
79
79
  # @overload archive(section_id, request_options: {})
80
80
  #
81
- # @param section_id [String] Id of the preference section.
81
+ # @param section_id [String] Id of the workspace preference.
82
82
  #
83
83
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
84
84
  #
85
85
  # @return [nil]
86
86
  #
87
- # @see Courier::Models::PreferenceSectionArchiveParams
87
+ # @see Courier::Models::WorkspacePreferenceArchiveParams
88
88
  def archive(section_id, params = {})
89
89
  @client.request(
90
90
  method: :delete,
@@ -94,9 +94,9 @@ module Courier
94
94
  )
95
95
  end
96
96
 
97
- # Publish the workspace's preferences page. Takes a snapshot of every section with
98
- # its topics under a new published version, making the current state visible on
99
- # the hosted preferences page (non-draft).
97
+ # Publish the workspace's preferences page. Takes a snapshot of every workspace
98
+ # preference with its topics under a new published version, making the current
99
+ # state visible on the hosted preferences page (non-draft).
100
100
  #
101
101
  # @overload publish(request_options: {})
102
102
  #
@@ -104,7 +104,7 @@ module Courier
104
104
  #
105
105
  # @return [Courier::Models::PublishPreferencesResponse]
106
106
  #
107
- # @see Courier::Models::PreferenceSectionPublishParams
107
+ # @see Courier::Models::WorkspacePreferencePublishParams
108
108
  def publish(params = {})
109
109
  @client.request(
110
110
  method: :post,
@@ -114,31 +114,31 @@ module Courier
114
114
  )
115
115
  end
116
116
 
117
- # Replace a preference section. Full document replacement; missing optional fields
118
- # are cleared. Topics attached to the section are unaffected.
117
+ # Replace a workspace preference. Full document replacement; missing optional
118
+ # fields are cleared. Topics attached to the workspace preference are unaffected.
119
119
  #
120
120
  # @overload replace(section_id, name:, has_custom_routing: nil, routing_options: nil, request_options: {})
121
121
  #
122
- # @param section_id [String] Id of the preference section.
122
+ # @param section_id [String] Id of the workspace preference.
123
123
  #
124
- # @param name [String] Human-readable name for the section.
124
+ # @param name [String] Human-readable name for the workspace preference.
125
125
  #
126
- # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
126
+ # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
127
127
  #
128
- # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Omit to clear.
128
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Omit to clear.
129
129
  #
130
130
  # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
131
131
  #
132
- # @return [Courier::Models::PreferenceSectionGetResponse]
132
+ # @return [Courier::Models::WorkspacePreferenceGetResponse]
133
133
  #
134
- # @see Courier::Models::PreferenceSectionReplaceParams
134
+ # @see Courier::Models::WorkspacePreferenceReplaceParams
135
135
  def replace(section_id, params)
136
- parsed, options = Courier::PreferenceSectionReplaceParams.dump_request(params)
136
+ parsed, options = Courier::WorkspacePreferenceReplaceParams.dump_request(params)
137
137
  @client.request(
138
138
  method: :put,
139
139
  path: ["preferences/sections/%1$s", section_id],
140
140
  body: parsed,
141
- model: Courier::PreferenceSectionGetResponse,
141
+ model: Courier::WorkspacePreferenceGetResponse,
142
142
  options: options
143
143
  )
144
144
  end
@@ -148,7 +148,7 @@ module Courier
148
148
  # @param client [Courier::Client]
149
149
  def initialize(client:)
150
150
  @client = client
151
- @topics = Courier::Resources::PreferenceSections::Topics.new(client: client)
151
+ @topics = Courier::Resources::WorkspacePreferences::Topics.new(client: client)
152
152
  end
153
153
  end
154
154
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "4.17.0"
4
+ VERSION = "4.18.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -58,6 +58,7 @@ require_relative "courier/models/inbound_bulk_message_user"
58
58
  require_relative "courier/models/base_check"
59
59
  require_relative "courier/models/subscription_topic_new"
60
60
  require_relative "courier/models/elemental_channel_node"
61
+ require_relative "courier/models/cancel_journey_request"
61
62
  require_relative "courier/models/create_journey_request"
62
63
  require_relative "courier/models/journeys_invoke_request"
63
64
  require_relative "courier/models/journey_publish_request"
@@ -72,16 +73,16 @@ require_relative "courier/models/notification_template_publish_request"
72
73
  require_relative "courier/models/notification_element_put_request"
73
74
  require_relative "courier/models/notification_template_update_request"
74
75
  require_relative "courier/models/notification_template_payload"
75
- require_relative "courier/models/preference_section_create_request"
76
- require_relative "courier/models/preference_section_replace_request"
77
- require_relative "courier/models/preference_topic_create_request"
78
- require_relative "courier/models/preference_topic_replace_request"
79
76
  require_relative "courier/models/routing_strategy_create_request"
80
77
  require_relative "courier/models/routing_strategy_replace_request"
81
78
  require_relative "courier/models/base_template_tenant_association"
82
79
  require_relative "courier/models/post_tenant_template_publish_request"
83
80
  require_relative "courier/models/put_tenant_template_request"
84
81
  require_relative "courier/models/users/user_token"
82
+ require_relative "courier/models/workspace_preference_create_request"
83
+ require_relative "courier/models/workspace_preference_replace_request"
84
+ require_relative "courier/models/workspace_preference_topic_create_request"
85
+ require_relative "courier/models/workspace_preference_topic_replace_request"
85
86
  require_relative "courier/models/airship_profile"
86
87
  require_relative "courier/models/airship_profile_audience"
87
88
  require_relative "courier/models/alignment"
@@ -131,6 +132,7 @@ require_relative "courier/models/bulk_list_users_response"
131
132
  require_relative "courier/models/bulk_retrieve_job_params"
132
133
  require_relative "courier/models/bulk_retrieve_job_response"
133
134
  require_relative "courier/models/bulk_run_job_params"
135
+ require_relative "courier/models/cancel_journey_response"
134
136
  require_relative "courier/models/channel"
135
137
  require_relative "courier/models/channel_classification"
136
138
  require_relative "courier/models/channel_metadata"
@@ -171,6 +173,7 @@ require_relative "courier/models/journey"
171
173
  require_relative "courier/models/journey_ai_node"
172
174
  require_relative "courier/models/journey_api_invoke_trigger_node"
173
175
  require_relative "courier/models/journey_archive_params"
176
+ require_relative "courier/models/journey_cancel_params"
174
177
  require_relative "courier/models/journey_condition_atom"
175
178
  require_relative "courier/models/journey_condition_group"
176
179
  require_relative "courier/models/journey_condition_nested_group"
@@ -179,6 +182,8 @@ require_relative "courier/models/journey_create_params"
179
182
  require_relative "courier/models/journey_delay_duration_node"
180
183
  require_relative "courier/models/journey_delay_until_node"
181
184
  require_relative "courier/models/journey_exit_node"
185
+ require_relative "courier/models/journey_experiment"
186
+ require_relative "courier/models/journey_experiment_variant"
182
187
  require_relative "courier/models/journey_fetch_get_delete_node"
183
188
  require_relative "courier/models/journey_fetch_post_put_node"
184
189
  require_relative "courier/models/journey_invoke_params"
@@ -279,22 +284,7 @@ require_relative "courier/models/pagerduty_recipient"
279
284
  require_relative "courier/models/paging"
280
285
  require_relative "courier/models/post_tenant_template_publish_response"
281
286
  require_relative "courier/models/preference"
282
- require_relative "courier/models/preference_section_archive_params"
283
- require_relative "courier/models/preference_section_create_params"
284
- require_relative "courier/models/preference_section_get_response"
285
- require_relative "courier/models/preference_section_list_params"
286
- require_relative "courier/models/preference_section_list_response"
287
- require_relative "courier/models/preference_section_publish_params"
288
- require_relative "courier/models/preference_section_replace_params"
289
- require_relative "courier/models/preference_section_retrieve_params"
290
- require_relative "courier/models/preference_sections/topic_archive_params"
291
- require_relative "courier/models/preference_sections/topic_create_params"
292
- require_relative "courier/models/preference_sections/topic_list_params"
293
- require_relative "courier/models/preference_sections/topic_replace_params"
294
- require_relative "courier/models/preference_sections/topic_retrieve_params"
295
287
  require_relative "courier/models/preference_status"
296
- require_relative "courier/models/preference_topic_get_response"
297
- require_relative "courier/models/preference_topic_list_response"
298
288
  require_relative "courier/models/profile_create_params"
299
289
  require_relative "courier/models/profile_create_response"
300
290
  require_relative "courier/models/profile_delete_params"
@@ -410,6 +400,21 @@ require_relative "courier/models/webhook_profile"
410
400
  require_relative "courier/models/webhook_profile_type"
411
401
  require_relative "courier/models/webhook_recipient"
412
402
  require_relative "courier/models/widget_background"
403
+ require_relative "courier/models/workspace_preference_archive_params"
404
+ require_relative "courier/models/workspace_preference_create_params"
405
+ require_relative "courier/models/workspace_preference_get_response"
406
+ require_relative "courier/models/workspace_preference_list_params"
407
+ require_relative "courier/models/workspace_preference_list_response"
408
+ require_relative "courier/models/workspace_preference_publish_params"
409
+ require_relative "courier/models/workspace_preference_replace_params"
410
+ require_relative "courier/models/workspace_preference_retrieve_params"
411
+ require_relative "courier/models/workspace_preferences/topic_archive_params"
412
+ require_relative "courier/models/workspace_preferences/topic_create_params"
413
+ require_relative "courier/models/workspace_preferences/topic_list_params"
414
+ require_relative "courier/models/workspace_preferences/topic_replace_params"
415
+ require_relative "courier/models/workspace_preferences/topic_retrieve_params"
416
+ require_relative "courier/models/workspace_preference_topic_get_response"
417
+ require_relative "courier/models/workspace_preference_topic_list_response"
413
418
  require_relative "courier/models"
414
419
  require_relative "courier/resources/audiences"
415
420
  require_relative "courier/resources/audit_events"
@@ -428,8 +433,6 @@ require_relative "courier/resources/lists/subscriptions"
428
433
  require_relative "courier/resources/messages"
429
434
  require_relative "courier/resources/notifications"
430
435
  require_relative "courier/resources/notifications/checks"
431
- require_relative "courier/resources/preference_sections"
432
- require_relative "courier/resources/preference_sections/topics"
433
436
  require_relative "courier/resources/profiles"
434
437
  require_relative "courier/resources/profiles/lists"
435
438
  require_relative "courier/resources/providers"
@@ -447,3 +450,5 @@ require_relative "courier/resources/users"
447
450
  require_relative "courier/resources/users/preferences"
448
451
  require_relative "courier/resources/users/tenants"
449
452
  require_relative "courier/resources/users/tokens"
453
+ require_relative "courier/resources/workspace_preferences"
454
+ require_relative "courier/resources/workspace_preferences/topics"
@@ -61,8 +61,8 @@ module Courier
61
61
  sig { returns(Courier::Resources::RoutingStrategies) }
62
62
  attr_reader :routing_strategies
63
63
 
64
- sig { returns(Courier::Resources::PreferenceSections) }
65
- attr_reader :preference_sections
64
+ sig { returns(Courier::Resources::WorkspacePreferences) }
65
+ attr_reader :workspace_preferences
66
66
 
67
67
  sig { returns(Courier::Resources::Profiles) }
68
68
  attr_reader :profiles
@@ -0,0 +1,68 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ # Request body for `POST /journeys/cancel`. Provide EXACTLY ONE of
6
+ # `cancelation_token` (cancels every run associated with the token) or `run_id`
7
+ # (cancels a single tenant-scoped run).
8
+ module CancelJourneyRequest
9
+ extend Courier::Internal::Type::Union
10
+
11
+ Variants =
12
+ T.type_alias do
13
+ T.any(
14
+ Courier::CancelJourneyRequest::ByCancelationToken,
15
+ Courier::CancelJourneyRequest::ByRunID
16
+ )
17
+ end
18
+
19
+ class ByCancelationToken < Courier::Internal::Type::BaseModel
20
+ OrHash =
21
+ T.type_alias do
22
+ T.any(
23
+ Courier::CancelJourneyRequest::ByCancelationToken,
24
+ Courier::Internal::AnyHash
25
+ )
26
+ end
27
+
28
+ sig { returns(String) }
29
+ attr_accessor :cancelation_token
30
+
31
+ sig { params(cancelation_token: String).returns(T.attached_class) }
32
+ def self.new(cancelation_token:)
33
+ end
34
+
35
+ sig { override.returns({ cancelation_token: String }) }
36
+ def to_hash
37
+ end
38
+ end
39
+
40
+ class ByRunID < Courier::Internal::Type::BaseModel
41
+ OrHash =
42
+ T.type_alias do
43
+ T.any(
44
+ Courier::CancelJourneyRequest::ByRunID,
45
+ Courier::Internal::AnyHash
46
+ )
47
+ end
48
+
49
+ sig { returns(String) }
50
+ attr_accessor :run_id
51
+
52
+ sig { params(run_id: String).returns(T.attached_class) }
53
+ def self.new(run_id:)
54
+ end
55
+
56
+ sig { override.returns({ run_id: String }) }
57
+ def to_hash
58
+ end
59
+ end
60
+
61
+ sig do
62
+ override.returns(T::Array[Courier::CancelJourneyRequest::Variants])
63
+ end
64
+ def self.variants
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,81 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ # `202 Accepted` body for `POST /journeys/cancel`, returning the submitted
6
+ # identifier. When called with `cancelation_token`, returns
7
+ # `{ cancelation_token }`; when called with `run_id`, returns
8
+ # `{ run_id, status }`.
9
+ module CancelJourneyResponse
10
+ extend Courier::Internal::Type::Union
11
+
12
+ Variants =
13
+ T.type_alias do
14
+ T.any(
15
+ Courier::CancelJourneyResponse::TokenBranch,
16
+ Courier::CancelJourneyResponse::RunIDBranch
17
+ )
18
+ end
19
+
20
+ class TokenBranch < Courier::Internal::Type::BaseModel
21
+ OrHash =
22
+ T.type_alias do
23
+ T.any(
24
+ Courier::CancelJourneyResponse::TokenBranch,
25
+ Courier::Internal::AnyHash
26
+ )
27
+ end
28
+
29
+ sig { returns(String) }
30
+ attr_accessor :cancelation_token
31
+
32
+ sig { params(cancelation_token: String).returns(T.attached_class) }
33
+ def self.new(cancelation_token:)
34
+ end
35
+
36
+ sig { override.returns({ cancelation_token: String }) }
37
+ def to_hash
38
+ end
39
+ end
40
+
41
+ class RunIDBranch < Courier::Internal::Type::BaseModel
42
+ OrHash =
43
+ T.type_alias do
44
+ T.any(
45
+ Courier::CancelJourneyResponse::RunIDBranch,
46
+ Courier::Internal::AnyHash
47
+ )
48
+ end
49
+
50
+ sig { returns(String) }
51
+ attr_accessor :run_id
52
+
53
+ # The run's resulting status. `CANCELED` when the run was active and has been
54
+ # canceled; `PROCESSED` or `ERROR` when the run had already finished and was left
55
+ # unchanged; `CANCELED` for an already-canceled run.
56
+ sig { returns(String) }
57
+ attr_accessor :status
58
+
59
+ sig { params(run_id: String, status: String).returns(T.attached_class) }
60
+ def self.new(
61
+ run_id:,
62
+ # The run's resulting status. `CANCELED` when the run was active and has been
63
+ # canceled; `PROCESSED` or `ERROR` when the run had already finished and was left
64
+ # unchanged; `CANCELED` for an already-canceled run.
65
+ status:
66
+ )
67
+ end
68
+
69
+ sig { override.returns({ run_id: String, status: String }) }
70
+ def to_hash
71
+ end
72
+ end
73
+
74
+ sig do
75
+ override.returns(T::Array[Courier::CancelJourneyResponse::Variants])
76
+ end
77
+ def self.variants
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,27 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyCancelParams < Courier::Internal::Type::BaseModel
6
+ extend Courier::Internal::Type::RequestParameters::Converter
7
+ include Courier::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(Courier::JourneyCancelParams, Courier::Internal::AnyHash)
12
+ end
13
+
14
+ sig do
15
+ params(request_options: Courier::RequestOptions::OrHash).returns(
16
+ T.attached_class
17
+ )
18
+ end
19
+ def self.new(request_options: {})
20
+ end
21
+
22
+ sig { override.returns({ request_options: Courier::RequestOptions }) }
23
+ def to_hash
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,74 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyExperiment < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyExperiment, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # The value used to deterministically assign a recipient to a variant. Must be
12
+ # non-empty with no leading or trailing whitespace.
13
+ sig { returns(String) }
14
+ attr_accessor :bucketing_key
15
+
16
+ # Between 2 and 10 weighted template variants.
17
+ sig { returns(T::Array[Courier::JourneyExperimentVariant]) }
18
+ attr_accessor :variants
19
+
20
+ # Unique experiment id (prefixed `exp_`). Omit to have one generated
21
+ # automatically; when supplied it must be a valid `exp_` id.
22
+ sig { returns(T.nilable(String)) }
23
+ attr_reader :id
24
+
25
+ sig { params(id: String).void }
26
+ attr_writer :id
27
+
28
+ # Optional display name for the experiment.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :name
31
+
32
+ sig { params(name: String).void }
33
+ attr_writer :name
34
+
35
+ # A/B experiment config for a send node. The recipient is deterministically
36
+ # bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
37
+ # its `weight`. Present on a send node INSTEAD OF `message.template`.
38
+ sig do
39
+ params(
40
+ bucketing_key: String,
41
+ variants: T::Array[Courier::JourneyExperimentVariant::OrHash],
42
+ id: String,
43
+ name: String
44
+ ).returns(T.attached_class)
45
+ end
46
+ def self.new(
47
+ # The value used to deterministically assign a recipient to a variant. Must be
48
+ # non-empty with no leading or trailing whitespace.
49
+ bucketing_key:,
50
+ # Between 2 and 10 weighted template variants.
51
+ variants:,
52
+ # Unique experiment id (prefixed `exp_`). Omit to have one generated
53
+ # automatically; when supplied it must be a valid `exp_` id.
54
+ id: nil,
55
+ # Optional display name for the experiment.
56
+ name: nil
57
+ )
58
+ end
59
+
60
+ sig do
61
+ override.returns(
62
+ {
63
+ bucketing_key: String,
64
+ variants: T::Array[Courier::JourneyExperimentVariant],
65
+ id: String,
66
+ name: String
67
+ }
68
+ )
69
+ end
70
+ def to_hash
71
+ end
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,61 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyExperimentVariant < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::JourneyExperimentVariant, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ sig { returns(String) }
12
+ attr_accessor :id
13
+
14
+ # The notification template sent for this variant.
15
+ sig { returns(String) }
16
+ attr_accessor :template_id
17
+
18
+ # Relative routing weight. Must be non-negative.
19
+ sig { returns(Float) }
20
+ attr_accessor :weight
21
+
22
+ # Optional display name for the variant.
23
+ sig { returns(T.nilable(String)) }
24
+ attr_reader :name
25
+
26
+ sig { params(name: String).void }
27
+ attr_writer :name
28
+
29
+ # A single weighted variant of an experiment. Variant ids must be unique within
30
+ # the experiment and the sum of all variant weights must be greater than 0.
31
+ # Weights are relative (no sum-to-100 requirement) — routing normalizes them
32
+ # proportionally.
33
+ sig do
34
+ params(
35
+ id: String,
36
+ template_id: String,
37
+ weight: Float,
38
+ name: String
39
+ ).returns(T.attached_class)
40
+ end
41
+ def self.new(
42
+ id:,
43
+ # The notification template sent for this variant.
44
+ template_id:,
45
+ # Relative routing weight. Must be non-negative.
46
+ weight:,
47
+ # Optional display name for the variant.
48
+ name: nil
49
+ )
50
+ end
51
+
52
+ sig do
53
+ override.returns(
54
+ { id: String, template_id: String, weight: Float, name: String }
55
+ )
56
+ end
57
+ def to_hash
58
+ end
59
+ end
60
+ end
61
+ end