trycourier 6.11.3 → 6.13.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/README.md +1 -1
  4. data/lib/courier/models/journey_ai_node.rb +6 -1
  5. data/lib/courier/models/journey_conditions_field.rb +3 -3
  6. data/lib/courier/models/journey_run_step.rb +36 -1
  7. data/lib/courier/models/notification_template_email.rb +50 -0
  8. data/lib/courier/models/notification_template_payload.rb +20 -1
  9. data/lib/courier/models/provider.rb +8 -2
  10. data/lib/courier/models/provider_create_params.rb +11 -1
  11. data/lib/courier/models/provider_patch_params.rb +61 -0
  12. data/lib/courier/models/provider_update_params.rb +10 -1
  13. data/lib/courier/models.rb +4 -0
  14. data/lib/courier/resources/providers.rb +35 -0
  15. data/lib/courier/version.rb +1 -1
  16. data/lib/courier.rb +2 -0
  17. data/rbi/courier/models/journey_ai_node.rbi +10 -0
  18. data/rbi/courier/models/journey_run_step.rbi +48 -0
  19. data/rbi/courier/models/notification_template_email.rbi +82 -0
  20. data/rbi/courier/models/notification_template_payload.rbi +34 -3
  21. data/rbi/courier/models/provider.rbi +8 -2
  22. data/rbi/courier/models/provider_create_params.rbi +22 -2
  23. data/rbi/courier/models/provider_patch_params.rbi +92 -0
  24. data/rbi/courier/models/provider_update_params.rbi +20 -2
  25. data/rbi/courier/models.rbi +4 -0
  26. data/rbi/courier/resources/providers.rbi +54 -2
  27. data/sig/courier/models/journey_run_step.rbs +20 -0
  28. data/sig/courier/models/notification_template_email.rbs +43 -0
  29. data/sig/courier/models/notification_template_payload.rbs +8 -3
  30. data/sig/courier/models/provider_patch_params.rbs +52 -0
  31. data/sig/courier/models.rbs +4 -0
  32. data/sig/courier/resources/providers.rbs +9 -0
  33. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc663969984ae8b94e9f2f522dc24ea9e1cbf1eed91ba357b565038bedb939ab
4
- data.tar.gz: 5cfd3e3767063edef226cf90ec1e6833e6122660be98b0d499b3e8007cea090f
3
+ metadata.gz: adeed3b02658fe1c360d234bbd24ce3c2c3dcd34637b766514178b3ea473cbb5
4
+ data.tar.gz: dfc4345ec2d9db5bbd66bca95fae14eb11fb5a8a19d8afa7b7493a0325786583
5
5
  SHA512:
6
- metadata.gz: 3482fdf2ca8fa7c825ff9259dabd2daa76c085cd65c79ee6f5bba64c19308aabfa933f9601f871b9167fa41017c76a2687c34710589544d34f1403d5469e2a74
7
- data.tar.gz: e9a750836a3948eb31382b228503d9ad8360cf6309f8943efd550baab5c6607bb9ebce02a0dcb60b9a3d61e1481d024050e5158ac1c799ea555513b96c3815e0
6
+ metadata.gz: 0e7711edd3bc7c6b0602ed7e8545cadadf2c10727de043474aec07e7ad121b1bfe324ac8d8c11efa77a15082a600c3ac26725146198359876a16b49178979b5d
7
+ data.tar.gz: 9cf63697464b8a65544002c1c50552c6a8c835012fad7cecd94373f5fbba7233361fde3bf16f41c4919409f6f5892092d12ea45f5d369bae960d0afc5ce017a1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.13.0](https://github.com/trycourier/courier-ruby/compare/v6.12.0...v6.13.0) (2026-10-23)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** journey run steps return error and skip_reason ([#179](https://github.com/trycourier/courier-ruby/issues/179)) ([d5a8120](https://github.com/trycourier/courier-ruby/commit/d5a8120a93e5524ea27c5c075819a9f6d2a8b9f4))
9
+
10
+
11
+ ### Chores
12
+
13
+ * **api:** regenerate SDK ([#181](https://github.com/trycourier/courier-ruby/issues/181)) ([eadaf17](https://github.com/trycourier/courier-ruby/commit/eadaf17a4f75bd8d8825522d213eecb513b3c872))
14
+
15
+ ## [6.12.0](https://github.com/trycourier/courier-ruby/compare/v6.11.3...v6.12.0) (2026-10-21)
16
+
17
+
18
+ ### Features
19
+
20
+ * **api:** add PATCH /providers/{id} for partial provider updates [C-21790] ([#177](https://github.com/trycourier/courier-ruby/issues/177)) ([caf13e0](https://github.com/trycourier/courier-ruby/commit/caf13e064a109dc25acafab3b780f4410e141292))
21
+ * **api:** expose email From, Reply-to, CC and BCC on notification templates [C-21709] ([#176](https://github.com/trycourier/courier-ruby/issues/176)) ([47e58ba](https://github.com/trycourier/courier-ruby/commit/47e58baa17aa96893a9f78ca59b67954a3644c6b))
22
+
23
+
24
+ ### Documentation
25
+
26
+ * **api:** describe the AI node model constraint [C-21614] ([#173](https://github.com/trycourier/courier-ruby/issues/173)) ([bf4895f](https://github.com/trycourier/courier-ruby/commit/bf4895fd98558354eadbd01128e53dc32bc9c2a4))
27
+ * **api:** document provider settings.rate_limit [C-21732] ([#175](https://github.com/trycourier/courier-ruby/issues/175)) ([d7b4ff9](https://github.com/trycourier/courier-ruby/commit/d7b4ff9f3e8d533d3d4e452d8f080cbb5f4b4823))
28
+
3
29
  ## [6.11.3](https://github.com/trycourier/courier-ruby/compare/v6.11.2...v6.11.3) (2026-09-30)
4
30
 
5
31
 
data/README.md CHANGED
@@ -9,7 +9,7 @@ Add the gem to your `Gemfile`:
9
9
  <!-- x-release-please-start-version -->
10
10
 
11
11
  ```ruby
12
- gem "trycourier", "~> 6.11.3"
12
+ gem "trycourier", "~> 6.13.0"
13
13
  ```
14
14
 
15
15
  <!-- x-release-please-end -->
@@ -28,6 +28,11 @@ module Courier
28
28
  optional :conditions, union: -> { Courier::JourneyConditionsField }
29
29
 
30
30
  # @!attribute model
31
+ # A supported AI model id. Requests with an unknown id may be rejected with a 400
32
+ # that lists the supported ids. Supported ids: `claude-fable-5-1`,
33
+ # `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `gpt-6-astra`,
34
+ # `gpt-5.5`, `gpt-5.4`, `gpt-6.1-sol`, `gpt-5.4-mini`, `gpt-5.4-nano`,
35
+ # `gpt-6-luna`.
31
36
  #
32
37
  # @return [String, nil]
33
38
  optional :model, String
@@ -57,7 +62,7 @@ module Courier
57
62
  #
58
63
  # @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
59
64
  #
60
- # @param model [String]
65
+ # @param model [String] A supported AI model id. Requests with an unknown id may be rejected with a 400
61
66
  #
62
67
  # @param user_prompt [String]
63
68
  #
@@ -14,7 +14,7 @@ module Courier
14
14
  # `starts with`, `ends with`, `greater than`, `greater than or equal`,
15
15
  # `less than`, `less than or equal`, `was`, `was not`.
16
16
  #
17
- # Example: `["user.tier", "is equal", "gold"]`.
17
+ # Example: `["profile.tier", "is equal", "gold"]`.
18
18
  #
19
19
  # `was` / `was not` compare a `send_status.<nodeId>` path (referencing
20
20
  # an earlier send node's node id) against one of `SENT`, `DELIVERED`,
@@ -29,9 +29,9 @@ module Courier
29
29
  # - Unary form (2 elements): `[path, operator]` where `operator` is
30
30
  # one of `exists`, `does not exist`.
31
31
  #
32
- # Example: `["user.email", "exists"]`.
32
+ # Example: `["profile.email", "exists"]`.
33
33
  #
34
- # The first element is a non-empty dot-path. The second element is the operator (must come from one of the two operator sets above). For the binary form, the third element is the comparison value (string). Runtime validation of the operator value and arity is performed by the backend; SDKs surface this as a string list.
34
+ # The first element is a non-empty dot-path that starts with `data.`, `profile.`, `tenant.` (only when the trigger sets a tenant), or `send_status.<nodeId>`. The second element is the operator (must come from one of the two operator sets above). For the binary form, the third element is the comparison value (string). Runtime validation of the operator value and arity is performed by the backend; SDKs surface this as a string list.
35
35
  variant -> { Courier::JourneyConditionAtom }
36
36
 
37
37
  # A leaf condition group. Exactly one of `AND` or `OR` must be present at runtime; each is a list of `JourneyConditionAtom` tuples.
@@ -9,6 +9,19 @@ module Courier
9
9
  # @return [String]
10
10
  required :action, String
11
11
 
12
+ # @!attribute error
13
+ # Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
14
+ #
15
+ # @return [Courier::Models::JourneyRunStep::Error, nil]
16
+ required :error, -> { Courier::JourneyRunStep::Error }, nil?: true
17
+
18
+ # @!attribute skip_reason
19
+ # Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is
20
+ # `SKIPPED`, `null` otherwise.
21
+ #
22
+ # @return [String, nil]
23
+ required :skip_reason, String, nil?: true
24
+
12
25
  # @!attribute status
13
26
  # The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
14
27
  # Not an enum — new values have been added before.
@@ -42,7 +55,7 @@ module Courier
42
55
  # @return [String, nil]
43
56
  optional :updated_at, String
44
57
 
45
- # @!method initialize(action:, status:, created_at: nil, message_id: nil, node_id: nil, updated_at: nil)
58
+ # @!method initialize(action:, error:, skip_reason:, status:, created_at: nil, message_id: nil, node_id: nil, updated_at: nil)
46
59
  # Some parameter documentations has been truncated, see
47
60
  # {Courier::Models::JourneyRunStep} for more details.
48
61
  #
@@ -51,6 +64,10 @@ module Courier
51
64
  #
52
65
  # @param action [String] The kind of node that ran, e.g. `send`, `delay`, or `exit`.
53
66
  #
67
+ # @param error [Courier::Models::JourneyRunStep::Error, nil] Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
68
+ #
69
+ # @param skip_reason [String, nil] Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is `
70
+ #
54
71
  # @param status [String] The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`. N
55
72
  #
56
73
  # @param created_at [String] When the step started, as an ISO 8601 timestamp.
@@ -60,6 +77,24 @@ module Courier
60
77
  # @param node_id [String] The id of the node in the published Journey that this step executed.
61
78
  #
62
79
  # @param updated_at [String] When the step last changed state, as an ISO 8601 timestamp.
80
+
81
+ # @see Courier::Models::JourneyRunStep#error
82
+ class Error < Courier::Internal::Type::BaseModel
83
+ # @!attribute message
84
+ # The reason, e.g. `Fetch failed: GET api.example.com returned 404` or
85
+ # `AI step timed out after 15 minutes`.
86
+ #
87
+ # @return [String]
88
+ required :message, String
89
+
90
+ # @!method initialize(message:)
91
+ # Some parameter documentations has been truncated, see
92
+ # {Courier::Models::JourneyRunStep::Error} for more details.
93
+ #
94
+ # Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
95
+ #
96
+ # @param message [String] The reason, e.g. `Fetch failed: GET api.example.com returned 404` or `AI step ti
97
+ end
63
98
  end
64
99
  end
65
100
  end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateEmail < Courier::Internal::Type::BaseModel
6
+ # @!attribute bcc
7
+ # BCC addresses.
8
+ #
9
+ # @return [Array<String>, nil]
10
+ optional :bcc, Courier::Internal::Type::ArrayOf[String]
11
+
12
+ # @!attribute cc
13
+ # CC addresses.
14
+ #
15
+ # @return [Array<String>, nil]
16
+ optional :cc, Courier::Internal::Type::ArrayOf[String]
17
+
18
+ # @!attribute from
19
+ # The From address.
20
+ #
21
+ # @return [String, nil]
22
+ optional :from, String
23
+
24
+ # @!attribute reply_to
25
+ # The Reply-to address.
26
+ #
27
+ # @return [String, nil]
28
+ optional :reply_to, String
29
+
30
+ # @!method initialize(bcc: nil, cc: nil, from: nil, reply_to: nil)
31
+ # Email header fields for the template's email channel: the From, Reply-to, CC and
32
+ # BCC values set in the Studio email channel settings. Each value may use template
33
+ # variables, such as `{{data.cc}}`, which are resolved at send time. Reads omit
34
+ # `email` when no header is set, and omit each unset field. Writes treat it as
35
+ # optional, with three meanings. Omit it to keep the stored headers. Send null to
36
+ # clear all four. Send an object to replace all four: a field the object leaves
37
+ # out is cleared. Other email channel settings, such as the subject, are kept
38
+ # either way. Headers only apply while `content` has an email channel; with no
39
+ # email channel they are not stored.
40
+ #
41
+ # @param bcc [Array<String>] BCC addresses.
42
+ #
43
+ # @param cc [Array<String>] CC addresses.
44
+ #
45
+ # @param from [String] The From address.
46
+ #
47
+ # @param reply_to [String] The Reply-to address.
48
+ end
49
+ end
50
+ end
@@ -39,7 +39,24 @@ module Courier
39
39
  # @return [Array<String>]
40
40
  required :tags, Courier::Internal::Type::ArrayOf[String]
41
41
 
42
- # @!method initialize(brand:, content:, name:, routing:, subscription:, tags:)
42
+ # @!attribute email
43
+ # Email header fields for the template's email channel: the From, Reply-to, CC and
44
+ # BCC values set in the Studio email channel settings. Each value may use template
45
+ # variables, such as `{{data.cc}}`, which are resolved at send time. Reads omit
46
+ # `email` when no header is set, and omit each unset field. Writes treat it as
47
+ # optional, with three meanings. Omit it to keep the stored headers. Send null to
48
+ # clear all four. Send an object to replace all four: a field the object leaves
49
+ # out is cleared. Other email channel settings, such as the subject, are kept
50
+ # either way. Headers only apply while `content` has an email channel; with no
51
+ # email channel they are not stored.
52
+ #
53
+ # @return [Courier::Models::NotificationTemplateEmail, nil]
54
+ optional :email, -> { Courier::NotificationTemplateEmail }, nil?: true
55
+
56
+ # @!method initialize(brand:, content:, name:, routing:, subscription:, tags:, email: nil)
57
+ # Some parameter documentations has been truncated, see
58
+ # {Courier::Models::NotificationTemplatePayload} for more details.
59
+ #
43
60
  # Core template fields used in POST and PUT request bodies (nested under a
44
61
  # `notification` key) and returned at the top level in responses.
45
62
  #
@@ -54,6 +71,8 @@ module Courier
54
71
  # @param subscription [Courier::Models::NotificationTemplatePayload::Subscription, nil] Subscription topic reference, or null for none.
55
72
  #
56
73
  # @param tags [Array<String>] Tags for categorization. Send empty array for none.
74
+ #
75
+ # @param email [Courier::Models::NotificationTemplateEmail, nil] Email header fields for the template's email channel: the From, Reply-to, CC and
57
76
 
58
77
  # @see Courier::Models::NotificationTemplatePayload#brand
59
78
  class Brand < Courier::Internal::Type::BaseModel
@@ -23,7 +23,10 @@ module Courier
23
23
  required :provider, String
24
24
 
25
25
  # @!attribute settings
26
- # Provider-specific settings (snake_case keys on the wire).
26
+ # Provider-specific settings (snake_case keys on the wire). `rate_limit` is this
27
+ # configuration's send rate limit,
28
+ # `{ "rate": number, "period": "second" | "minute" | "hour" }`, or null for no
29
+ # limit.
27
30
  #
28
31
  # @return [Hash{Symbol=>Object}]
29
32
  required :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
@@ -47,6 +50,9 @@ module Courier
47
50
  optional :updated, Integer, nil?: true
48
51
 
49
52
  # @!method initialize(id:, created:, provider:, settings:, title:, alias_: nil, updated: nil)
53
+ # Some parameter documentations has been truncated, see
54
+ # {Courier::Models::Provider} for more details.
55
+ #
50
56
  # A configured provider in the workspace.
51
57
  #
52
58
  # @param id [String] A unique identifier for the provider configuration.
@@ -55,7 +61,7 @@ module Courier
55
61
  #
56
62
  # @param provider [String] The provider key (e.g. "sendgrid", "twilio", "slack").
57
63
  #
58
- # @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys on the wire).
64
+ # @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys on the wire). `rate_limit` is this c
59
65
  #
60
66
  # @param title [String] Display title. Defaults to "Default Configuration" when not explicitly set.
61
67
  #
@@ -23,7 +23,17 @@ module Courier
23
23
  # @!attribute settings
24
24
  # Provider-specific settings (snake_case keys). Defaults to an empty object when
25
25
  # omitted. Use the catalog endpoint to discover required fields for a given
26
- # provider — omitting a required field returns a 400 validation error.
26
+ # provider — omitting a required field returns a 400 validation error. Set
27
+ # `rate_limit` to cap this configuration's send rate:
28
+ # `{ "rate": <number greater than 0>, "period": "second" | "minute" | "hour" }`,
29
+ # e.g. `{ "rate": 0.5, "period": "minute" }` for one send every 2 minutes. The
30
+ # interval between sends (`period` divided by `rate`) must be from 1 millisecond
31
+ # to 12 hours, otherwise the request returns a 400 `InvalidRateLimit` error. The
32
+ # limit applies per configuration and per environment (a test-environment
33
+ # configuration has its own limit). Sends above the rate are queued, not dropped,
34
+ # and changes take up to 60 seconds to apply. It has no effect on observability or
35
+ # CDP integrations, which do not send messages. Omit it or set it to null for no
36
+ # limit.
27
37
  #
28
38
  # @return [Hash{Symbol=>Object}, nil]
29
39
  optional :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Courier
4
+ module Models
5
+ # @see Courier::Resources::Providers#patch
6
+ class ProviderPatchParams < Courier::Internal::Type::BaseModel
7
+ extend Courier::Internal::Type::RequestParameters::Converter
8
+ include Courier::Internal::Type::RequestParameters
9
+
10
+ # @!attribute id
11
+ #
12
+ # @return [String]
13
+ required :id, String
14
+
15
+ # @!attribute alias_
16
+ # Updated alias. Set to null to clear it.
17
+ #
18
+ # @return [String, nil]
19
+ optional :alias_, String, api_name: :alias, nil?: true
20
+
21
+ # @!attribute provider
22
+ # The provider key identifying the type. Optional. When sent, it must match the
23
+ # stored provider, otherwise the request returns a 400.
24
+ #
25
+ # @return [String, nil]
26
+ optional :provider, String
27
+
28
+ # @!attribute settings
29
+ # Provider-specific settings (snake_case keys) to merge into the stored settings,
30
+ # using JSON Merge Patch (RFC 7396). Each key you send replaces the stored value,
31
+ # a key set to null is removed, nested objects merge recursively, and arrays
32
+ # replace the stored value. Keys you omit keep their stored values. Set
33
+ # `rate_limit` to null to remove this configuration's send rate limit.
34
+ #
35
+ # @return [Hash{Symbol=>Object}, nil]
36
+ optional :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
37
+
38
+ # @!attribute title
39
+ # Updated display title.
40
+ #
41
+ # @return [String, nil]
42
+ optional :title, String
43
+
44
+ # @!method initialize(id:, alias_: nil, provider: nil, settings: nil, title: nil, request_options: {})
45
+ # Some parameter documentations has been truncated, see
46
+ # {Courier::Models::ProviderPatchParams} for more details.
47
+ #
48
+ # @param id [String]
49
+ #
50
+ # @param alias_ [String, nil] Updated alias. Set to null to clear it.
51
+ #
52
+ # @param provider [String] The provider key identifying the type. Optional. When sent, it must match the st
53
+ #
54
+ # @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys) to merge into the stored settings,
55
+ #
56
+ # @param title [String] Updated display title.
57
+ #
58
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}]
59
+ end
60
+ end
61
+ end
@@ -28,7 +28,16 @@ module Courier
28
28
  # @!attribute settings
29
29
  # Provider-specific settings (snake_case keys). Replaces the full settings object
30
30
  # — omitted settings fields are removed. Use the catalog endpoint to check
31
- # required fields.
31
+ # required fields. Set `rate_limit` to cap this configuration's send rate:
32
+ # `{ "rate": <number greater than 0>, "period": "second" | "minute" | "hour" }`,
33
+ # e.g. `{ "rate": 0.5, "period": "minute" }` for one send every 2 minutes. The
34
+ # interval between sends (`period` divided by `rate`) must be from 1 millisecond
35
+ # to 12 hours, otherwise the request returns a 400 `InvalidRateLimit` error. The
36
+ # limit applies per configuration and per environment (a test-environment
37
+ # configuration has its own limit). Sends above the rate are queued, not dropped,
38
+ # and changes take up to 60 seconds to apply. It has no effect on observability or
39
+ # CDP integrations, which do not send messages. Omitting `rate_limit` or setting
40
+ # it to null removes any existing limit, including one set in Studio.
32
41
  #
33
42
  # @return [Hash{Symbol=>Object}, nil]
34
43
  optional :settings, Courier::Internal::Type::HashOf[Courier::Internal::Type::Unknown]
@@ -495,6 +495,8 @@ module Courier
495
495
 
496
496
  NotificationTemplateCreateRequest = Courier::Models::NotificationTemplateCreateRequest
497
497
 
498
+ NotificationTemplateEmail = Courier::Models::NotificationTemplateEmail
499
+
498
500
  NotificationTemplatePayload = Courier::Models::NotificationTemplatePayload
499
501
 
500
502
  NotificationTemplatePublishRequest = Courier::Models::NotificationTemplatePublishRequest
@@ -567,6 +569,8 @@ module Courier
567
569
 
568
570
  ProviderListParams = Courier::Models::ProviderListParams
569
571
 
572
+ ProviderPatchParams = Courier::Models::ProviderPatchParams
573
+
570
574
  ProviderRetrieveParams = Courier::Models::ProviderRetrieveParams
571
575
 
572
576
  Providers = Courier::Models::Providers
@@ -149,6 +149,41 @@ module Courier
149
149
  )
150
150
  end
151
151
 
152
+ # Some parameter documentations has been truncated, see
153
+ # {Courier::Models::ProviderPatchParams} for more details.
154
+ #
155
+ # Updates part of a provider's configuration and keeps every field you omit.
156
+ # Settings merge into the stored settings key by key, and a setting sent as null
157
+ # is removed.
158
+ #
159
+ # @overload patch(id, alias_: nil, provider: nil, settings: nil, title: nil, request_options: {})
160
+ #
161
+ # @param id [String] A unique identifier of the provider configuration to update.
162
+ #
163
+ # @param alias_ [String, nil] Updated alias. Set to null to clear it.
164
+ #
165
+ # @param provider [String] The provider key identifying the type. Optional. When sent, it must match the st
166
+ #
167
+ # @param settings [Hash{Symbol=>Object}] Provider-specific settings (snake_case keys) to merge into the stored settings,
168
+ #
169
+ # @param title [String] Updated display title.
170
+ #
171
+ # @param request_options [Courier::RequestOptions, Hash{Symbol=>Object}, nil]
172
+ #
173
+ # @return [Courier::Models::Provider]
174
+ #
175
+ # @see Courier::Models::ProviderPatchParams
176
+ def patch(id, params = {})
177
+ parsed, options = Courier::ProviderPatchParams.dump_request(params)
178
+ @client.request(
179
+ method: :patch,
180
+ path: ["providers/%1$s", id],
181
+ body: parsed,
182
+ model: Courier::Provider,
183
+ options: options
184
+ )
185
+ end
186
+
152
187
  # @api private
153
188
  #
154
189
  # @param client [Courier::Client]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Courier
4
- VERSION = "6.11.3"
4
+ VERSION = "6.13.0"
5
5
  end
data/lib/courier.rb CHANGED
@@ -348,6 +348,7 @@ require_relative "courier/models/notifications/previews/run_create_params"
348
348
  require_relative "courier/models/notifications/previews/run_list_params"
349
349
  require_relative "courier/models/notifications/previews/run_retrieve_params"
350
350
  require_relative "courier/models/notification_template_alias"
351
+ require_relative "courier/models/notification_template_email"
351
352
  require_relative "courier/models/notification_template_response"
352
353
  require_relative "courier/models/notification_template_state"
353
354
  require_relative "courier/models/notification_template_summary"
@@ -389,6 +390,7 @@ require_relative "courier/models/provider_create_params"
389
390
  require_relative "courier/models/provider_delete_params"
390
391
  require_relative "courier/models/provider_list_params"
391
392
  require_relative "courier/models/provider_list_response"
393
+ require_relative "courier/models/provider_patch_params"
392
394
  require_relative "courier/models/provider_retrieve_params"
393
395
  require_relative "courier/models/providers/catalog_list_params"
394
396
  require_relative "courier/models/providers/catalog_list_response"
@@ -49,6 +49,11 @@ module Courier
49
49
  end
50
50
  attr_writer :conditions
51
51
 
52
+ # A supported AI model id. Requests with an unknown id may be rejected with a 400
53
+ # that lists the supported ids. Supported ids: `claude-fable-5-1`,
54
+ # `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `gpt-6-astra`,
55
+ # `gpt-5.5`, `gpt-5.4`, `gpt-6.1-sol`, `gpt-5.4-mini`, `gpt-5.4-nano`,
56
+ # `gpt-6-luna`.
52
57
  sig { returns(T.nilable(String)) }
53
58
  attr_reader :model
54
59
 
@@ -94,6 +99,11 @@ module Courier
94
99
  # group, or an AND/OR nested group. Omit the `conditions` property entirely to
95
100
  # express "no conditions".
96
101
  conditions: nil,
102
+ # A supported AI model id. Requests with an unknown id may be rejected with a 400
103
+ # that lists the supported ids. Supported ids: `claude-fable-5-1`,
104
+ # `claude-opus-5-5`, `claude-sonnet-5-5`, `claude-haiku-5-5`, `gpt-6-astra`,
105
+ # `gpt-5.5`, `gpt-5.4`, `gpt-6.1-sol`, `gpt-5.4-mini`, `gpt-5.4-nano`,
106
+ # `gpt-6-luna`.
97
107
  model: nil,
98
108
  user_prompt: nil,
99
109
  web_search: nil
@@ -12,6 +12,20 @@ module Courier
12
12
  sig { returns(String) }
13
13
  attr_accessor :action
14
14
 
15
+ # Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
16
+ sig { returns(T.nilable(Courier::JourneyRunStep::Error)) }
17
+ attr_reader :error
18
+
19
+ sig do
20
+ params(error: T.nilable(Courier::JourneyRunStep::Error::OrHash)).void
21
+ end
22
+ attr_writer :error
23
+
24
+ # Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is
25
+ # `SKIPPED`, `null` otherwise.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_accessor :skip_reason
28
+
15
29
  # The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
16
30
  # Not an enum — new values have been added before.
17
31
  sig { returns(String) }
@@ -52,6 +66,8 @@ module Courier
52
66
  sig do
53
67
  params(
54
68
  action: String,
69
+ error: T.nilable(Courier::JourneyRunStep::Error::OrHash),
70
+ skip_reason: T.nilable(String),
55
71
  status: String,
56
72
  created_at: String,
57
73
  message_id: String,
@@ -62,6 +78,11 @@ module Courier
62
78
  def self.new(
63
79
  # The kind of node that ran, e.g. `send`, `delay`, or `exit`.
64
80
  action:,
81
+ # Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
82
+ error:,
83
+ # Why the step was skipped, e.g. `Node conditions not met`. Set when `status` is
84
+ # `SKIPPED`, `null` otherwise.
85
+ skip_reason:,
65
86
  # The state of the step: the seven run statuses, plus `SKIPPED` and `COMPUTING`.
66
87
  # Not an enum — new values have been added before.
67
88
  status:,
@@ -82,6 +103,8 @@ module Courier
82
103
  override.returns(
83
104
  {
84
105
  action: String,
106
+ error: T.nilable(Courier::JourneyRunStep::Error),
107
+ skip_reason: T.nilable(String),
85
108
  status: String,
86
109
  created_at: String,
87
110
  message_id: String,
@@ -92,6 +115,31 @@ module Courier
92
115
  end
93
116
  def to_hash
94
117
  end
118
+
119
+ class Error < Courier::Internal::Type::BaseModel
120
+ OrHash =
121
+ T.type_alias do
122
+ T.any(Courier::JourneyRunStep::Error, Courier::Internal::AnyHash)
123
+ end
124
+
125
+ # The reason, e.g. `Fetch failed: GET api.example.com returned 404` or
126
+ # `AI step timed out after 15 minutes`.
127
+ sig { returns(String) }
128
+ attr_accessor :message
129
+
130
+ # Why the step failed. Set when `status` is `ERROR`, `null` otherwise.
131
+ sig { params(message: String).returns(T.attached_class) }
132
+ def self.new(
133
+ # The reason, e.g. `Fetch failed: GET api.example.com returned 404` or
134
+ # `AI step timed out after 15 minutes`.
135
+ message:
136
+ )
137
+ end
138
+
139
+ sig { override.returns({ message: String }) }
140
+ def to_hash
141
+ end
142
+ end
95
143
  end
96
144
  end
97
145
  end
@@ -0,0 +1,82 @@
1
+ # typed: strong
2
+
3
+ module Courier
4
+ module Models
5
+ class NotificationTemplateEmail < Courier::Internal::Type::BaseModel
6
+ OrHash =
7
+ T.type_alias do
8
+ T.any(Courier::NotificationTemplateEmail, Courier::Internal::AnyHash)
9
+ end
10
+
11
+ # BCC addresses.
12
+ sig { returns(T.nilable(T::Array[String])) }
13
+ attr_reader :bcc
14
+
15
+ sig { params(bcc: T::Array[String]).void }
16
+ attr_writer :bcc
17
+
18
+ # CC addresses.
19
+ sig { returns(T.nilable(T::Array[String])) }
20
+ attr_reader :cc
21
+
22
+ sig { params(cc: T::Array[String]).void }
23
+ attr_writer :cc
24
+
25
+ # The From address.
26
+ sig { returns(T.nilable(String)) }
27
+ attr_reader :from
28
+
29
+ sig { params(from: String).void }
30
+ attr_writer :from
31
+
32
+ # The Reply-to address.
33
+ sig { returns(T.nilable(String)) }
34
+ attr_reader :reply_to
35
+
36
+ sig { params(reply_to: String).void }
37
+ attr_writer :reply_to
38
+
39
+ # Email header fields for the template's email channel: the From, Reply-to, CC and
40
+ # BCC values set in the Studio email channel settings. Each value may use template
41
+ # variables, such as `{{data.cc}}`, which are resolved at send time. Reads omit
42
+ # `email` when no header is set, and omit each unset field. Writes treat it as
43
+ # optional, with three meanings. Omit it to keep the stored headers. Send null to
44
+ # clear all four. Send an object to replace all four: a field the object leaves
45
+ # out is cleared. Other email channel settings, such as the subject, are kept
46
+ # either way. Headers only apply while `content` has an email channel; with no
47
+ # email channel they are not stored.
48
+ sig do
49
+ params(
50
+ bcc: T::Array[String],
51
+ cc: T::Array[String],
52
+ from: String,
53
+ reply_to: String
54
+ ).returns(T.attached_class)
55
+ end
56
+ def self.new(
57
+ # BCC addresses.
58
+ bcc: nil,
59
+ # CC addresses.
60
+ cc: nil,
61
+ # The From address.
62
+ from: nil,
63
+ # The Reply-to address.
64
+ reply_to: nil
65
+ )
66
+ end
67
+
68
+ sig do
69
+ override.returns(
70
+ {
71
+ bcc: T::Array[String],
72
+ cc: T::Array[String],
73
+ from: String,
74
+ reply_to: String
75
+ }
76
+ )
77
+ end
78
+ def to_hash
79
+ end
80
+ end
81
+ end
82
+ end