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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ebaf44c61a0ef71f4361dcc7d1c86fd966ef63dad937597e9aa3305eac0eb0c
4
- data.tar.gz: 77043c6e894d91ae5bfcab16c10deebe37297817112069e094a88f0927452aa8
3
+ metadata.gz: f8dd821714bcedfb9a48185d8a9c04f669568f2fdd560bcbd58a7c21acf43be3
4
+ data.tar.gz: c8730971ee6d6fbb0e38a4f3a6a213c0a9fed7aca628d5ebc3e490c8c585d362
5
5
  SHA512:
6
- metadata.gz: eada95e02ef63ffe5351c64ccbafa522e8a36d02b0ad84c15a250c493684b9676538c2c72d72ee6c613096bfb2de1e40b00cef51134af44de63229937ad22036
7
- data.tar.gz: 1579153d043a077c6d4561276bfbbabbd986ddb115bea3552b5301717bb9e5c80855176573fc50789dc9293fd20970db74f5d003f1e3fe7e890128d236b4b65c
6
+ metadata.gz: 1c3bdee713e6ac20200c2c35ac993a34a07b52b3e4c1bc9422e0074aeffe344b39962d7703463de38d80f00ba1ecc56e5ea839654ac0a45c6c51400fc996849b
7
+ data.tar.gz: 07535c3b636a1462811bd7f00685dbc3738c3ce589cc0f963baf898a2895f543c48a8e12e39135c6bebccdbabc3fb85388dea03af2aff3d0bcf6758c4ef2309e
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.18.0 (2026-07-06)
4
+
5
+ Full Changelog: [v4.17.1...v4.18.0](https://github.com/trycourier/courier-ruby/compare/v4.17.1...v4.18.0)
6
+
7
+ ### Features
8
+
9
+ * **openapi:** Journeys cancel-by-token endpoint + send-node experiments (C-18986) ([12613c6](https://github.com/trycourier/courier-ruby/commit/12613c65e9b4facc19f7fa23cc92fac0b2ea8684))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **internal:** bound formatter parallelism to CPU count ([192d613](https://github.com/trycourier/courier-ruby/commit/192d6133c29e2ae7bfcd7c54bd1c244894f01b94))
15
+
16
+
17
+ ### Documentation
18
+
19
+ * **openapi:** reword Cancel journey runs 400 description (re-trigger deploy) ([89ceaab](https://github.com/trycourier/courier-ruby/commit/89ceaab2e20d45c3dd807427f5e4d248ba94cc8a))
20
+ * **openapi:** reword Cancel journey runs description (re-trigger deploy) ([ccce802](https://github.com/trycourier/courier-ruby/commit/ccce8027d4279de031ff2f7e95a250e512dbfbed))
21
+ * **openapi:** tighten Journeys cancel/experiment copy (C-19177) ([10c4f1d](https://github.com/trycourier/courier-ruby/commit/10c4f1d3ca27c525ec5d75d49f4bb30cc0d6180d))
22
+
23
+ ## 4.17.1 (2026-06-25)
24
+
25
+ Full Changelog: [v4.17.0...v4.17.1](https://github.com/trycourier/courier-ruby/compare/v4.17.0...v4.17.1)
26
+
27
+ ### Documentation
28
+
29
+ * **openapi:** add full response examples to every endpoint ([be9724a](https://github.com/trycourier/courier-ruby/commit/be9724a3a5d7317bd31d99160414959b58d1e5bb))
30
+ * **openapi:** reword Cancel Submission description ([68565aa](https://github.com/trycourier/courier-ruby/commit/68565aa1f8de141d9780a390da4b48aeb178624e))
31
+ * **openapi:** reword Get Submission Checks description ([94541e4](https://github.com/trycourier/courier-ruby/commit/94541e4aaebbf1ac567e1047d2ce84e5ad97741b))
32
+ * **openapi:** reword Replace Submission Checks description ([7aa63c1](https://github.com/trycourier/courier-ruby/commit/7aa63c14c83b9585ec963d426f47b2720b5b04cc))
33
+
3
34
  ## 4.17.0 (2026-06-24)
4
35
 
5
36
  Full Changelog: [v4.16.0...v4.17.0](https://github.com/trycourier/courier-ruby/compare/v4.16.0...v4.17.0)
@@ -66,8 +66,8 @@ module Courier
66
66
  # @return [Courier::Resources::RoutingStrategies]
67
67
  attr_reader :routing_strategies
68
68
 
69
- # @return [Courier::Resources::PreferenceSections]
70
- attr_reader :preference_sections
69
+ # @return [Courier::Resources::WorkspacePreferences]
70
+ attr_reader :workspace_preferences
71
71
 
72
72
  # @return [Courier::Resources::Profiles]
73
73
  attr_reader :profiles
@@ -158,7 +158,7 @@ module Courier
158
158
  @requests = Courier::Resources::Requests.new(client: self)
159
159
  @notifications = Courier::Resources::Notifications.new(client: self)
160
160
  @routing_strategies = Courier::Resources::RoutingStrategies.new(client: self)
161
- @preference_sections = Courier::Resources::PreferenceSections.new(client: self)
161
+ @workspace_preferences = Courier::Resources::WorkspacePreferences.new(client: self)
162
162
  @profiles = Courier::Resources::Profiles.new(client: self)
163
163
  @tenants = Courier::Resources::Tenants.new(client: self)
164
164
  @translations = Courier::Resources::Translations.new(client: self)
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
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
+ variant -> { Courier::CancelJourneyRequest::ByCancelationToken }
12
+
13
+ variant -> { Courier::CancelJourneyRequest::ByRunID }
14
+
15
+ class ByCancelationToken < Courier::Internal::Type::BaseModel
16
+ # @!attribute cancelation_token
17
+ #
18
+ # @return [String]
19
+ required :cancelation_token, String
20
+
21
+ # @!method initialize(cancelation_token:)
22
+ # @param cancelation_token [String]
23
+ end
24
+
25
+ class ByRunID < Courier::Internal::Type::BaseModel
26
+ # @!attribute run_id
27
+ #
28
+ # @return [String]
29
+ required :run_id, String
30
+
31
+ # @!method initialize(run_id:)
32
+ # @param run_id [String]
33
+ end
34
+
35
+ # @!method self.variants
36
+ # @return [Array(Courier::Models::CancelJourneyRequest::ByCancelationToken, Courier::Models::CancelJourneyRequest::ByRunID)]
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
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
+ #
10
+ # @see Courier::Resources::Journeys#cancel
11
+ module CancelJourneyResponse
12
+ extend Courier::Internal::Type::Union
13
+
14
+ variant -> { Courier::CancelJourneyResponse::TokenBranch }
15
+
16
+ variant -> { Courier::CancelJourneyResponse::RunIDBranch }
17
+
18
+ class TokenBranch < Courier::Internal::Type::BaseModel
19
+ # @!attribute cancelation_token
20
+ #
21
+ # @return [String]
22
+ required :cancelation_token, String
23
+
24
+ # @!method initialize(cancelation_token:)
25
+ # @param cancelation_token [String]
26
+ end
27
+
28
+ class RunIDBranch < Courier::Internal::Type::BaseModel
29
+ # @!attribute run_id
30
+ #
31
+ # @return [String]
32
+ required :run_id, String
33
+
34
+ # @!attribute status
35
+ # The run's resulting status. `CANCELED` when the run was active and has been
36
+ # canceled; `PROCESSED` or `ERROR` when the run had already finished and was left
37
+ # unchanged; `CANCELED` for an already-canceled run.
38
+ #
39
+ # @return [String]
40
+ required :status, String
41
+
42
+ # @!method initialize(run_id:, status:)
43
+ # Some parameter documentations has been truncated, see
44
+ # {Courier::Models::CancelJourneyResponse::RunIDBranch} for more details.
45
+ #
46
+ # @param run_id [String]
47
+ #
48
+ # @param status [String] The run's resulting status. `CANCELED` when the run was active and has been canc
49
+ end
50
+
51
+ # @!method self.variants
52
+ # @return [Array(Courier::Models::CancelJourneyResponse::TokenBranch, Courier::Models::CancelJourneyResponse::RunIDBranch)]
53
+ end
54
+ end
55
+ end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#list
6
- class PreferenceSectionListParams < Courier::Internal::Type::BaseModel
5
+ # @see Courier::Resources::Journeys#cancel
6
+ class JourneyCancelParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyExperiment < Courier::Internal::Type::BaseModel
6
+ # @!attribute bucketing_key
7
+ # The value used to deterministically assign a recipient to a variant. Must be
8
+ # non-empty with no leading or trailing whitespace.
9
+ #
10
+ # @return [String]
11
+ required :bucketing_key, String, api_name: :bucketingKey
12
+
13
+ # @!attribute variants
14
+ # Between 2 and 10 weighted template variants.
15
+ #
16
+ # @return [Array<Courier::Models::JourneyExperimentVariant>]
17
+ required :variants, -> { Courier::Internal::Type::ArrayOf[Courier::JourneyExperimentVariant] }
18
+
19
+ # @!attribute id
20
+ # Unique experiment id (prefixed `exp_`). Omit to have one generated
21
+ # automatically; when supplied it must be a valid `exp_` id.
22
+ #
23
+ # @return [String, nil]
24
+ optional :id, String
25
+
26
+ # @!attribute name
27
+ # Optional display name for the experiment.
28
+ #
29
+ # @return [String, nil]
30
+ optional :name, String
31
+
32
+ # @!method initialize(bucketing_key:, variants:, id: nil, name: nil)
33
+ # Some parameter documentations has been truncated, see
34
+ # {Courier::Models::JourneyExperiment} for more details.
35
+ #
36
+ # A/B experiment config for a send node. The recipient is deterministically
37
+ # bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
38
+ # its `weight`. Present on a send node INSTEAD OF `message.template`.
39
+ #
40
+ # @param bucketing_key [String] The value used to deterministically assign a recipient to a variant. Must be non
41
+ #
42
+ # @param variants [Array<Courier::Models::JourneyExperimentVariant>] Between 2 and 10 weighted template variants.
43
+ #
44
+ # @param id [String] Unique experiment id (prefixed `exp_`). Omit to have one generated automatically
45
+ #
46
+ # @param name [String] Optional display name for the experiment.
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class JourneyExperimentVariant < Courier::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ #
8
+ # @return [String]
9
+ required :id, String
10
+
11
+ # @!attribute template_id
12
+ # The notification template sent for this variant.
13
+ #
14
+ # @return [String]
15
+ required :template_id, String, api_name: :templateId
16
+
17
+ # @!attribute weight
18
+ # Relative routing weight. Must be non-negative.
19
+ #
20
+ # @return [Float]
21
+ required :weight, Float
22
+
23
+ # @!attribute name
24
+ # Optional display name for the variant.
25
+ #
26
+ # @return [String, nil]
27
+ optional :name, String
28
+
29
+ # @!method initialize(id:, template_id:, weight:, name: nil)
30
+ # A single weighted variant of an experiment. Variant ids must be unique within
31
+ # the experiment and the sum of all variant weights must be greater than 0.
32
+ # Weights are relative (no sum-to-100 requirement) — routing normalizes them
33
+ # proportionally.
34
+ #
35
+ # @param id [String]
36
+ #
37
+ # @param template_id [String] The notification template sent for this variant.
38
+ #
39
+ # @param weight [Float] Relative routing weight. Must be non-negative.
40
+ #
41
+ # @param name [String] Optional display name for the variant.
42
+ end
43
+ end
44
+ end
@@ -14,7 +14,7 @@ module Courier
14
14
  # Trigger fired by a segment event (`identify`, `group`, or `track`).
15
15
  variant -> { Courier::JourneySegmentTriggerNode }
16
16
 
17
- # Send a notification template to the recipient. Optionally override the recipient address, delay the send, or attach `data`.
17
+ # Send to the recipient. A send node sources its content from EXACTLY ONE of `message.template` (a single notification template) or `experiment` (an A/B split across weighted template variants) — supplying both, or neither, is rejected. Optionally override the recipient address, delay the send, or attach `data`.
18
18
  variant -> { Courier::JourneySendNode }
19
19
 
20
20
  # Pause the journey run for a fixed `duration`.
@@ -26,12 +26,23 @@ module Courier
26
26
  # @return [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup, nil]
27
27
  optional :conditions, union: -> { Courier::JourneyConditionsField }
28
28
 
29
- # @!method initialize(message:, type:, id: nil, conditions: nil)
29
+ # @!attribute experiment
30
+ # A/B experiment config for a send node. The recipient is deterministically
31
+ # bucketed by `bucketingKey` and routed to one of the `variants` in proportion to
32
+ # its `weight`. Present on a send node INSTEAD OF `message.template`.
33
+ #
34
+ # @return [Courier::Models::JourneyExperiment, nil]
35
+ optional :experiment, -> { Courier::JourneyExperiment }
36
+
37
+ # @!method initialize(message:, type:, id: nil, conditions: nil, experiment: nil)
30
38
  # Some parameter documentations has been truncated, see
31
39
  # {Courier::Models::JourneySendNode} for more details.
32
40
  #
33
- # Send a notification template to the recipient. Optionally override the recipient
34
- # address, delay the send, or attach `data`.
41
+ # Send to the recipient. A send node sources its content from EXACTLY ONE of
42
+ # `message.template` (a single notification template) or `experiment` (an A/B
43
+ # split across weighted template variants) — supplying both, or neither, is
44
+ # rejected. Optionally override the recipient address, delay the send, or attach
45
+ # `data`.
35
46
  #
36
47
  # @param message [Courier::Models::JourneySendNode::Message]
37
48
  #
@@ -40,14 +51,11 @@ module Courier
40
51
  # @param id [String]
41
52
  #
42
53
  # @param conditions [Array<String>, Courier::Models::JourneyConditionGroup, Courier::Models::JourneyConditionNestedGroup] Condition spec for a journey node. Accepts a single condition atom, an AND/OR gr
54
+ #
55
+ # @param experiment [Courier::Models::JourneyExperiment] A/B experiment config for a send node. The recipient is deterministically bucket
43
56
 
44
57
  # @see Courier::Models::JourneySendNode#message
45
58
  class Message < Courier::Internal::Type::BaseModel
46
- # @!attribute template
47
- #
48
- # @return [String]
49
- required :template, String
50
-
51
59
  # @!attribute data
52
60
  #
53
61
  # @return [Hash{Symbol=>Object}, nil]
@@ -58,15 +66,20 @@ module Courier
58
66
  # @return [Courier::Models::JourneySendNode::Message::Delay, nil]
59
67
  optional :delay, -> { Courier::JourneySendNode::Message::Delay }
60
68
 
69
+ # @!attribute template
70
+ #
71
+ # @return [String, nil]
72
+ optional :template, String
73
+
61
74
  # @!attribute to
62
75
  #
63
76
  # @return [Courier::Models::JourneySendNode::Message::To, nil]
64
77
  optional :to, -> { Courier::JourneySendNode::Message::To }
65
78
 
66
- # @!method initialize(template:, data: nil, delay: nil, to: nil)
67
- # @param template [String]
79
+ # @!method initialize(data: nil, delay: nil, template: nil, to: nil)
68
80
  # @param data [Hash{Symbol=>Object}]
69
81
  # @param delay [Courier::Models::JourneySendNode::Message::Delay]
82
+ # @param template [String]
70
83
  # @param to [Courier::Models::JourneySendNode::Message::To]
71
84
 
72
85
  # @see Courier::Models::JourneySendNode::Message#delay
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#publish
5
+ # @see Courier::Resources::WorkspacePreferences#publish
6
6
  class PublishPreferencesResponse < Courier::Internal::Type::BaseModel
7
7
  # @!attribute page_id
8
8
  # Id of the published page snapshot.
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#archive
6
- class PreferenceSectionArchiveParams < Courier::Internal::Type::BaseModel
5
+ # @see Courier::Resources::WorkspacePreferences#archive
6
+ class WorkspacePreferenceArchiveParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::WorkspacePreferences#create
6
+ class WorkspacePreferenceCreateParams < Courier::Models::WorkspacePreferenceCreateRequest
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!method initialize(request_options: {})
11
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
12
+ end
13
+ end
14
+ end
@@ -2,21 +2,21 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- class PreferenceSectionCreateRequest < Courier::Internal::Type::BaseModel
5
+ class WorkspacePreferenceCreateRequest < Courier::Internal::Type::BaseModel
6
6
  # @!attribute name
7
- # Human-readable name for the section.
7
+ # Human-readable name for the workspace preference.
8
8
  #
9
9
  # @return [String]
10
10
  required :name, String
11
11
 
12
12
  # @!attribute has_custom_routing
13
- # Whether the section defines custom routing for its topics.
13
+ # Whether the workspace preference defines custom routing for its topics.
14
14
  #
15
15
  # @return [Boolean, nil]
16
16
  optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
17
17
 
18
18
  # @!attribute routing_options
19
- # Default channels for the section. Defaults to empty if omitted.
19
+ # Default channels for the workspace preference. Defaults to empty if omitted.
20
20
  #
21
21
  # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
22
22
  optional :routing_options,
@@ -24,13 +24,13 @@ module Courier
24
24
  nil?: true
25
25
 
26
26
  # @!method initialize(name:, has_custom_routing: nil, routing_options: nil)
27
- # Request body for creating a preference section.
27
+ # Request body for creating a workspace preference.
28
28
  #
29
- # @param name [String] Human-readable name for the section.
29
+ # @param name [String] Human-readable name for the workspace preference.
30
30
  #
31
- # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
31
+ # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
32
32
  #
33
- # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Defaults to empty if omitted.
33
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Defaults to empty if omitted.
34
34
  end
35
35
  end
36
36
  end
@@ -2,22 +2,22 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#create
6
- class PreferenceSectionGetResponse < Courier::Internal::Type::BaseModel
5
+ # @see Courier::Resources::WorkspacePreferences#create
6
+ class WorkspacePreferenceGetResponse < Courier::Internal::Type::BaseModel
7
7
  # @!attribute id
8
- # The preference section id.
8
+ # The workspace preference id.
9
9
  #
10
10
  # @return [String]
11
11
  required :id, String
12
12
 
13
13
  # @!attribute created
14
- # ISO-8601 timestamp of when the section was created.
14
+ # ISO-8601 timestamp of when the workspace preference was created.
15
15
  #
16
16
  # @return [String]
17
17
  required :created, String
18
18
 
19
19
  # @!attribute has_custom_routing
20
- # Whether the section defines custom routing for its topics.
20
+ # Whether the workspace preference defines custom routing for its topics.
21
21
  #
22
22
  # @return [Boolean]
23
23
  required :has_custom_routing, Courier::Internal::Type::Boolean
@@ -29,16 +29,16 @@ module Courier
29
29
  required :name, String
30
30
 
31
31
  # @!attribute routing_options
32
- # Default channels for the section. May be empty.
32
+ # Default channels for the workspace preference. May be empty.
33
33
  #
34
34
  # @return [Array<Symbol, Courier::Models::ChannelClassification>]
35
35
  required :routing_options, -> { Courier::Internal::Type::ArrayOf[enum: Courier::ChannelClassification] }
36
36
 
37
37
  # @!attribute topics
38
- # The topics contained in this section.
38
+ # The topics contained in this workspace preference.
39
39
  #
40
- # @return [Array<Courier::Models::PreferenceTopicGetResponse>]
41
- required :topics, -> { Courier::Internal::Type::ArrayOf[Courier::PreferenceTopicGetResponse] }
40
+ # @return [Array<Courier::Models::WorkspacePreferenceTopicGetResponse>]
41
+ required :topics, -> { Courier::Internal::Type::ArrayOf[Courier::WorkspacePreferenceTopicGetResponse] }
42
42
 
43
43
  # @!attribute creator
44
44
  # Id of the creator.
@@ -59,19 +59,19 @@ module Courier
59
59
  optional :updater, String, nil?: true
60
60
 
61
61
  # @!method initialize(id:, created:, has_custom_routing:, name:, routing_options:, topics:, creator: nil, updated: nil, updater: nil)
62
- # A preference section in your workspace, including its topics.
62
+ # A workspace preference in your workspace, including its topics.
63
63
  #
64
- # @param id [String] The preference section id.
64
+ # @param id [String] The workspace preference id.
65
65
  #
66
- # @param created [String] ISO-8601 timestamp of when the section was created.
66
+ # @param created [String] ISO-8601 timestamp of when the workspace preference was created.
67
67
  #
68
- # @param has_custom_routing [Boolean] Whether the section defines custom routing for its topics.
68
+ # @param has_custom_routing [Boolean] Whether the workspace preference defines custom routing for its topics.
69
69
  #
70
70
  # @param name [String] Human-readable name.
71
71
  #
72
- # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>] Default channels for the section. May be empty.
72
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>] Default channels for the workspace preference. May be empty.
73
73
  #
74
- # @param topics [Array<Courier::Models::PreferenceTopicGetResponse>] The topics contained in this section.
74
+ # @param topics [Array<Courier::Models::WorkspacePreferenceTopicGetResponse>] The topics contained in this workspace preference.
75
75
  #
76
76
  # @param creator [String, nil] Id of the creator.
77
77
  #
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#publish
6
- class PreferenceSectionPublishParams < Courier::Internal::Type::BaseModel
5
+ # @see Courier::Resources::WorkspacePreferences#list
6
+ class WorkspacePreferenceListParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::WorkspacePreferences#list
6
+ class WorkspacePreferenceListResponse < Courier::Internal::Type::BaseModel
7
+ # @!attribute results
8
+ #
9
+ # @return [Array<Courier::Models::WorkspacePreferenceGetResponse>]
10
+ required :results, -> { Courier::Internal::Type::ArrayOf[Courier::WorkspacePreferenceGetResponse] }
11
+
12
+ # @!method initialize(results:)
13
+ # The workspace's preferences, each with its topics.
14
+ #
15
+ # @param results [Array<Courier::Models::WorkspacePreferenceGetResponse>]
16
+ end
17
+ end
18
+ end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#create
6
- class PreferenceSectionCreateParams < Courier::Models::PreferenceSectionCreateRequest
5
+ # @see Courier::Resources::WorkspacePreferences#publish
6
+ class WorkspacePreferencePublishParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#replace
6
- class PreferenceSectionReplaceParams < Courier::Models::PreferenceSectionReplaceRequest
5
+ # @see Courier::Resources::WorkspacePreferences#replace
6
+ class WorkspacePreferenceReplaceParams < Courier::Models::WorkspacePreferenceReplaceRequest
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9
 
@@ -2,21 +2,21 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- class PreferenceSectionReplaceRequest < Courier::Internal::Type::BaseModel
5
+ class WorkspacePreferenceReplaceRequest < Courier::Internal::Type::BaseModel
6
6
  # @!attribute name
7
- # Human-readable name for the section.
7
+ # Human-readable name for the workspace preference.
8
8
  #
9
9
  # @return [String]
10
10
  required :name, String
11
11
 
12
12
  # @!attribute has_custom_routing
13
- # Whether the section defines custom routing for its topics.
13
+ # Whether the workspace preference defines custom routing for its topics.
14
14
  #
15
15
  # @return [Boolean, nil]
16
16
  optional :has_custom_routing, Courier::Internal::Type::Boolean, nil?: true
17
17
 
18
18
  # @!attribute routing_options
19
- # Default channels for the section. Omit to clear.
19
+ # Default channels for the workspace preference. Omit to clear.
20
20
  #
21
21
  # @return [Array<Symbol, Courier::Models::ChannelClassification>, nil]
22
22
  optional :routing_options,
@@ -24,14 +24,14 @@ module Courier
24
24
  nil?: true
25
25
 
26
26
  # @!method initialize(name:, has_custom_routing: nil, routing_options: nil)
27
- # Request body for replacing a preference section. Full document replacement;
27
+ # Request body for replacing a workspace preference. Full document replacement;
28
28
  # missing optional fields are cleared.
29
29
  #
30
- # @param name [String] Human-readable name for the section.
30
+ # @param name [String] Human-readable name for the workspace preference.
31
31
  #
32
- # @param has_custom_routing [Boolean, nil] Whether the section defines custom routing for its topics.
32
+ # @param has_custom_routing [Boolean, nil] Whether the workspace preference defines custom routing for its topics.
33
33
  #
34
- # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the section. Omit to clear.
34
+ # @param routing_options [Array<Symbol, Courier::Models::ChannelClassification>, nil] Default channels for the workspace preference. Omit to clear.
35
35
  end
36
36
  end
37
37
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Courier
4
4
  module Models
5
- # @see Courier::Resources::PreferenceSections#retrieve
6
- class PreferenceSectionRetrieveParams < Courier::Internal::Type::BaseModel
5
+ # @see Courier::Resources::WorkspacePreferences#retrieve
6
+ class WorkspacePreferenceRetrieveParams < Courier::Internal::Type::BaseModel
7
7
  extend Courier::Internal::Type::RequestParameters::Converter
8
8
  include Courier::Internal::Type::RequestParameters
9
9