Skip to content

Commit a21d5fe

Browse files
release: 7.11.1 (#131)
* codegen metadata * fix: ensure file data are only sent as 1 parameter * fix(api): correct providers update method, notifications/routing_strategies return types * codegen metadata * release: 7.11.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 78fe99d commit a21d5fe

17 files changed

Lines changed: 103 additions & 117 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "7.11.0"
2+
".": "7.11.1"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 103
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-d891c800ffe6b7eddce179c225367cedcb49dab758ebc03e352d945240918d96.yml
3-
openapi_spec_hash: 852d55192b8d7ad96c1f85cd9070ef64
4-
config_hash: a730d0e598dc108e89c016802008c9b3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-f0ac5c2fa86eabda773c549f5809d3e2d109e3e1d5a07f6fe1ace18355e4680a.yml
3+
openapi_spec_hash: b25dc0b42dd9386ab4a025bb2143bde6
4+
config_hash: 6037e4a9909efb8b2edac2dcc907b84f

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 7.11.1 (2026-04-13)
4+
5+
Full Changelog: [v7.11.0...v7.11.1](https://github.com/trycourier/courier-python/compare/v7.11.0...v7.11.1)
6+
7+
### Bug Fixes
8+
9+
* **api:** correct providers update method, notifications/routing_strategies return types ([069bf70](https://github.com/trycourier/courier-python/commit/069bf70791042c6ac0233022a8066cf1724a173c))
10+
* ensure file data are only sent as 1 parameter ([ca4b529](https://github.com/trycourier/courier-python/commit/ca4b529bf902fa70de9776bd66154d9bb5783b2b))
11+
312
## 7.11.0 (2026-04-08)
413

514
Full Changelog: [v7.10.0...v7.11.0](https://github.com/trycourier/courier-python/compare/v7.10.0...v7.11.0)

api.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Methods:
127127

128128
- <code title="post /providers">client.providers.<a href="./src/courier/resources/providers/providers.py">create</a>(\*\*<a href="src/courier/types/provider_create_params.py">params</a>) -> <a href="./src/courier/types/provider.py">Provider</a></code>
129129
- <code title="get /providers/{id}">client.providers.<a href="./src/courier/resources/providers/providers.py">retrieve</a>(id) -> <a href="./src/courier/types/provider.py">Provider</a></code>
130-
- <code title="post /providers/{id}">client.providers.<a href="./src/courier/resources/providers/providers.py">update</a>(id, \*\*<a href="src/courier/types/provider_update_params.py">params</a>) -> <a href="./src/courier/types/provider.py">Provider</a></code>
130+
- <code title="put /providers/{id}">client.providers.<a href="./src/courier/resources/providers/providers.py">update</a>(id, \*\*<a href="src/courier/types/provider_update_params.py">params</a>) -> <a href="./src/courier/types/provider.py">Provider</a></code>
131131
- <code title="get /providers">client.providers.<a href="./src/courier/resources/providers/providers.py">list</a>(\*\*<a href="src/courier/types/provider_list_params.py">params</a>) -> <a href="./src/courier/types/provider_list_response.py">ProviderListResponse</a></code>
132132
- <code title="delete /providers/{id}">client.providers.<a href="./src/courier/resources/providers/providers.py">delete</a>(id) -> None</code>
133133

@@ -352,7 +352,6 @@ from courier.types import (
352352
NotificationLocalePutRequest,
353353
NotificationTemplateCreateRequest,
354354
NotificationTemplateGetResponse,
355-
NotificationTemplateMutationResponse,
356355
NotificationTemplatePayload,
357356
NotificationTemplatePublishRequest,
358357
NotificationTemplateState,
@@ -367,7 +366,7 @@ from courier.types import (
367366

368367
Methods:
369368

370-
- <code title="post /notifications">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">create</a>(\*\*<a href="src/courier/types/notification_create_params.py">params</a>) -> <a href="./src/courier/types/notification_template_mutation_response.py">NotificationTemplateMutationResponse</a></code>
369+
- <code title="post /notifications">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">create</a>(\*\*<a href="src/courier/types/notification_create_params.py">params</a>) -> <a href="./src/courier/types/notification_template_get_response.py">NotificationTemplateGetResponse</a></code>
371370
- <code title="get /notifications/{id}">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">retrieve</a>(id, \*\*<a href="src/courier/types/notification_retrieve_params.py">params</a>) -> <a href="./src/courier/types/notification_template_get_response.py">NotificationTemplateGetResponse</a></code>
372371
- <code title="get /notifications">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">list</a>(\*\*<a href="src/courier/types/notification_list_params.py">params</a>) -> <a href="./src/courier/types/notification_list_response.py">NotificationListResponse</a></code>
373372
- <code title="delete /notifications/{id}">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">archive</a>(id) -> None</code>
@@ -376,7 +375,7 @@ Methods:
376375
- <code title="put /notifications/{id}/content">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">put_content</a>(id, \*\*<a href="src/courier/types/notification_put_content_params.py">params</a>) -> <a href="./src/courier/types/notification_content_mutation_response.py">NotificationContentMutationResponse</a></code>
377376
- <code title="put /notifications/{id}/elements/{elementId}">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">put_element</a>(element_id, \*, id, \*\*<a href="src/courier/types/notification_put_element_params.py">params</a>) -> <a href="./src/courier/types/notification_content_mutation_response.py">NotificationContentMutationResponse</a></code>
378377
- <code title="put /notifications/{id}/locales/{localeId}">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">put_locale</a>(locale_id, \*, id, \*\*<a href="src/courier/types/notification_put_locale_params.py">params</a>) -> <a href="./src/courier/types/notification_content_mutation_response.py">NotificationContentMutationResponse</a></code>
379-
- <code title="put /notifications/{id}">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">replace</a>(id, \*\*<a href="src/courier/types/notification_replace_params.py">params</a>) -> <a href="./src/courier/types/notification_template_mutation_response.py">NotificationTemplateMutationResponse</a></code>
378+
- <code title="put /notifications/{id}">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">replace</a>(id, \*\*<a href="src/courier/types/notification_replace_params.py">params</a>) -> <a href="./src/courier/types/notification_template_get_response.py">NotificationTemplateGetResponse</a></code>
380379
- <code title="get /notifications/{id}/content">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">retrieve_content</a>(id, \*\*<a href="src/courier/types/notification_retrieve_content_params.py">params</a>) -> <a href="./src/courier/types/notification_retrieve_content_response.py">NotificationRetrieveContentResponse</a></code>
381380

382381
## Checks
@@ -403,20 +402,19 @@ from courier.types import (
403402
RoutingStrategyCreateRequest,
404403
RoutingStrategyGetResponse,
405404
RoutingStrategyListResponse,
406-
RoutingStrategyMutationResponse,
407405
RoutingStrategyReplaceRequest,
408406
RoutingStrategySummary,
409407
)
410408
```
411409

412410
Methods:
413411

414-
- <code title="post /routing-strategies">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">create</a>(\*\*<a href="src/courier/types/routing_strategy_create_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_mutation_response.py">RoutingStrategyMutationResponse</a></code>
412+
- <code title="post /routing-strategies">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">create</a>(\*\*<a href="src/courier/types/routing_strategy_create_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_get_response.py">RoutingStrategyGetResponse</a></code>
415413
- <code title="get /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">retrieve</a>(id) -> <a href="./src/courier/types/routing_strategy_get_response.py">RoutingStrategyGetResponse</a></code>
416414
- <code title="get /routing-strategies">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">list</a>(\*\*<a href="src/courier/types/routing_strategy_list_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_list_response.py">RoutingStrategyListResponse</a></code>
417415
- <code title="delete /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">archive</a>(id) -> None</code>
418416
- <code title="get /routing-strategies/{id}/notifications">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">list_notifications</a>(id, \*\*<a href="src/courier/types/routing_strategy_list_notifications_params.py">params</a>) -> <a href="./src/courier/types/associated_notification_list_response.py">AssociatedNotificationListResponse</a></code>
419-
- <code title="put /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">replace</a>(id, \*\*<a href="src/courier/types/routing_strategy_replace_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_mutation_response.py">RoutingStrategyMutationResponse</a></code>
417+
- <code title="put /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">replace</a>(id, \*\*<a href="src/courier/types/routing_strategy_replace_params.py">params</a>) -> <a href="./src/courier/types/routing_strategy_get_response.py">RoutingStrategyGetResponse</a></code>
420418

421419
# Profiles
422420

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "trycourier"
3-
version = "7.11.0"
3+
version = "7.11.1"
44
description = "The official Python library for the Courier API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/courier/_utils/_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ def _extract_items(
8686
index += 1
8787
if is_dict(obj):
8888
try:
89-
# We are at the last entry in the path so we must remove the field
90-
if (len(path)) == index:
89+
# Remove the field if there are no more dict keys in the path,
90+
# only "<array>" traversal markers or end.
91+
if all(p == "<array>" for p in path[index:]):
9192
item = obj.pop(key)
9293
else:
9394
item = obj[key]

src/courier/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "courier"
4-
__version__ = "7.11.0" # x-release-please-version
4+
__version__ = "7.11.1" # x-release-please-version

src/courier/resources/notifications/notifications.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
from ...types.notification_template_payload_param import NotificationTemplatePayloadParam
4646
from ...types.notification_content_mutation_response import NotificationContentMutationResponse
4747
from ...types.notification_retrieve_content_response import NotificationRetrieveContentResponse
48-
from ...types.notification_template_mutation_response import NotificationTemplateMutationResponse
4948
from ...types.notification_template_version_list_response import NotificationTemplateVersionListResponse
5049

5150
__all__ = ["NotificationsResource", "AsyncNotificationsResource"]
@@ -86,7 +85,7 @@ def create(
8685
extra_query: Query | None = None,
8786
extra_body: Body | None = None,
8887
timeout: float | httpx.Timeout | None | NotGiven = not_given,
89-
) -> NotificationTemplateMutationResponse:
88+
) -> NotificationTemplateGetResponse:
9089
"""Create a notification template.
9190
9291
Requires all fields in the notification object.
@@ -119,7 +118,7 @@ def create(
119118
options=make_request_options(
120119
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
121120
),
122-
cast_to=NotificationTemplateMutationResponse,
121+
cast_to=NotificationTemplateGetResponse,
123122
)
124123

125124
def retrieve(
@@ -512,7 +511,7 @@ def replace(
512511
extra_query: Query | None = None,
513512
extra_body: Body | None = None,
514513
timeout: float | httpx.Timeout | None | NotGiven = not_given,
515-
) -> NotificationTemplateMutationResponse:
514+
) -> NotificationTemplateGetResponse:
516515
"""Replace a notification template.
517516
518517
All fields are required.
@@ -546,7 +545,7 @@ def replace(
546545
options=make_request_options(
547546
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
548547
),
549-
cast_to=NotificationTemplateMutationResponse,
548+
cast_to=NotificationTemplateGetResponse,
550549
)
551550

552551
def retrieve_content(
@@ -637,7 +636,7 @@ async def create(
637636
extra_query: Query | None = None,
638637
extra_body: Body | None = None,
639638
timeout: float | httpx.Timeout | None | NotGiven = not_given,
640-
) -> NotificationTemplateMutationResponse:
639+
) -> NotificationTemplateGetResponse:
641640
"""Create a notification template.
642641
643642
Requires all fields in the notification object.
@@ -670,7 +669,7 @@ async def create(
670669
options=make_request_options(
671670
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
672671
),
673-
cast_to=NotificationTemplateMutationResponse,
672+
cast_to=NotificationTemplateGetResponse,
674673
)
675674

676675
async def retrieve(
@@ -1067,7 +1066,7 @@ async def replace(
10671066
extra_query: Query | None = None,
10681067
extra_body: Body | None = None,
10691068
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1070-
) -> NotificationTemplateMutationResponse:
1069+
) -> NotificationTemplateGetResponse:
10711070
"""Replace a notification template.
10721071
10731072
All fields are required.
@@ -1101,7 +1100,7 @@ async def replace(
11011100
options=make_request_options(
11021101
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
11031102
),
1104-
cast_to=NotificationTemplateMutationResponse,
1103+
cast_to=NotificationTemplateGetResponse,
11051104
)
11061105

11071106
async def retrieve_content(

src/courier/resources/providers/providers.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,17 @@ def update(
160160
extra_body: Body | None = None,
161161
timeout: float | httpx.Timeout | None | NotGiven = not_given,
162162
) -> Provider:
163-
"""Update an existing provider configuration.
163+
"""Replace an existing provider configuration.
164164
165-
The `provider` key is required. All
166-
other fields are optional — omitted fields are cleared from the stored
167-
configuration (this is a full replacement, not a partial merge).
165+
The `provider` key is required and
166+
determines which provider-specific settings schema is applied. All other fields
167+
are optional — omitted fields are cleared from the stored configuration (this is
168+
a full replacement, not a partial merge). Changing the provider type for an
169+
existing configuration is not supported.
168170
169171
Args:
170-
provider: The provider key identifying the type.
172+
provider: The provider key identifying the type. Required on every request because it
173+
selects the provider-specific settings schema for validation.
171174
172175
alias: Updated alias. Omit to clear.
173176
@@ -187,7 +190,7 @@ def update(
187190
"""
188191
if not id:
189192
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
190-
return self._post(
193+
return self._put(
191194
path_template("/providers/{id}", id=id),
192195
body=maybe_transform(
193196
{
@@ -408,14 +411,17 @@ async def update(
408411
extra_body: Body | None = None,
409412
timeout: float | httpx.Timeout | None | NotGiven = not_given,
410413
) -> Provider:
411-
"""Update an existing provider configuration.
414+
"""Replace an existing provider configuration.
412415
413-
The `provider` key is required. All
414-
other fields are optional — omitted fields are cleared from the stored
415-
configuration (this is a full replacement, not a partial merge).
416+
The `provider` key is required and
417+
determines which provider-specific settings schema is applied. All other fields
418+
are optional — omitted fields are cleared from the stored configuration (this is
419+
a full replacement, not a partial merge). Changing the provider type for an
420+
existing configuration is not supported.
416421
417422
Args:
418-
provider: The provider key identifying the type.
423+
provider: The provider key identifying the type. Required on every request because it
424+
selects the provider-specific settings schema for validation.
419425
420426
alias: Updated alias. Omit to clear.
421427
@@ -435,7 +441,7 @@ async def update(
435441
"""
436442
if not id:
437443
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
438-
return await self._post(
444+
return await self._put(
439445
path_template("/providers/{id}", id=id),
440446
body=await async_maybe_transform(
441447
{

src/courier/resources/routing_strategies.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from ..types.routing_strategy_list_response import RoutingStrategyListResponse
2929
from ..types.shared_params.message_channels import MessageChannels
3030
from ..types.shared_params.message_providers import MessageProviders
31-
from ..types.routing_strategy_mutation_response import RoutingStrategyMutationResponse
3231
from ..types.associated_notification_list_response import AssociatedNotificationListResponse
3332

3433
__all__ = ["RoutingStrategiesResource", "AsyncRoutingStrategiesResource"]
@@ -69,7 +68,7 @@ def create(
6968
extra_query: Query | None = None,
7069
extra_body: Body | None = None,
7170
timeout: float | httpx.Timeout | None | NotGiven = not_given,
72-
) -> RoutingStrategyMutationResponse:
71+
) -> RoutingStrategyGetResponse:
7372
"""Create a routing strategy.
7473
7574
Requires a name and routing configuration at minimum.
@@ -112,7 +111,7 @@ def create(
112111
options=make_request_options(
113112
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
114113
),
115-
cast_to=RoutingStrategyMutationResponse,
114+
cast_to=RoutingStrategyGetResponse,
116115
)
117116

118117
def retrieve(
@@ -302,7 +301,7 @@ def replace(
302301
extra_query: Query | None = None,
303302
extra_body: Body | None = None,
304303
timeout: float | httpx.Timeout | None | NotGiven = not_given,
305-
) -> RoutingStrategyMutationResponse:
304+
) -> RoutingStrategyGetResponse:
306305
"""Replace a routing strategy.
307306
308307
Full document replacement; the caller must send the
@@ -347,7 +346,7 @@ def replace(
347346
options=make_request_options(
348347
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
349348
),
350-
cast_to=RoutingStrategyMutationResponse,
349+
cast_to=RoutingStrategyGetResponse,
351350
)
352351

353352

@@ -386,7 +385,7 @@ async def create(
386385
extra_query: Query | None = None,
387386
extra_body: Body | None = None,
388387
timeout: float | httpx.Timeout | None | NotGiven = not_given,
389-
) -> RoutingStrategyMutationResponse:
388+
) -> RoutingStrategyGetResponse:
390389
"""Create a routing strategy.
391390
392391
Requires a name and routing configuration at minimum.
@@ -429,7 +428,7 @@ async def create(
429428
options=make_request_options(
430429
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
431430
),
432-
cast_to=RoutingStrategyMutationResponse,
431+
cast_to=RoutingStrategyGetResponse,
433432
)
434433

435434
async def retrieve(
@@ -619,7 +618,7 @@ async def replace(
619618
extra_query: Query | None = None,
620619
extra_body: Body | None = None,
621620
timeout: float | httpx.Timeout | None | NotGiven = not_given,
622-
) -> RoutingStrategyMutationResponse:
621+
) -> RoutingStrategyGetResponse:
623622
"""Replace a routing strategy.
624623
625624
Full document replacement; the caller must send the
@@ -664,7 +663,7 @@ async def replace(
664663
options=make_request_options(
665664
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
666665
),
667-
cast_to=RoutingStrategyMutationResponse,
666+
cast_to=RoutingStrategyGetResponse,
668667
)
669668

670669

0 commit comments

Comments
 (0)