Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.11.0"
".": "7.11.1"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 103
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-d891c800ffe6b7eddce179c225367cedcb49dab758ebc03e352d945240918d96.yml
openapi_spec_hash: 852d55192b8d7ad96c1f85cd9070ef64
config_hash: a730d0e598dc108e89c016802008c9b3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-f0ac5c2fa86eabda773c549f5809d3e2d109e3e1d5a07f6fe1ace18355e4680a.yml
openapi_spec_hash: b25dc0b42dd9386ab4a025bb2143bde6
config_hash: 6037e4a9909efb8b2edac2dcc907b84f
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 7.11.1 (2026-04-13)

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

### Bug Fixes

* **api:** correct providers update method, notifications/routing_strategies return types ([069bf70](https://github.com/trycourier/courier-python/commit/069bf70791042c6ac0233022a8066cf1724a173c))
* ensure file data are only sent as 1 parameter ([ca4b529](https://github.com/trycourier/courier-python/commit/ca4b529bf902fa70de9776bd66154d9bb5783b2b))

## 7.11.0 (2026-04-08)

Full Changelog: [v7.10.0...v7.11.0](https://github.com/trycourier/courier-python/compare/v7.10.0...v7.11.0)
Expand Down
12 changes: 5 additions & 7 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Methods:

- <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>
- <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>
- <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>
- <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>
- <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>
- <code title="delete /providers/{id}">client.providers.<a href="./src/courier/resources/providers/providers.py">delete</a>(id) -> None</code>

Expand Down Expand Up @@ -352,7 +352,6 @@ from courier.types import (
NotificationLocalePutRequest,
NotificationTemplateCreateRequest,
NotificationTemplateGetResponse,
NotificationTemplateMutationResponse,
NotificationTemplatePayload,
NotificationTemplatePublishRequest,
NotificationTemplateState,
Expand All @@ -367,7 +366,7 @@ from courier.types import (

Methods:

- <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>
- <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>
- <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>
- <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>
- <code title="delete /notifications/{id}">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">archive</a>(id) -> None</code>
Expand All @@ -376,7 +375,7 @@ Methods:
- <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>
- <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>
- <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>
- <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>
- <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>
- <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>

## Checks
Expand All @@ -403,20 +402,19 @@ from courier.types import (
RoutingStrategyCreateRequest,
RoutingStrategyGetResponse,
RoutingStrategyListResponse,
RoutingStrategyMutationResponse,
RoutingStrategyReplaceRequest,
RoutingStrategySummary,
)
```

Methods:

- <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>
- <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>
- <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>
- <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>
- <code title="delete /routing-strategies/{id}">client.routing_strategies.<a href="./src/courier/resources/routing_strategies.py">archive</a>(id) -> None</code>
- <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>
- <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>
- <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>

# Profiles

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "trycourier"
version = "7.11.0"
version = "7.11.1"
description = "The official Python library for the Courier API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
5 changes: 3 additions & 2 deletions src/courier/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def _extract_items(
index += 1
if is_dict(obj):
try:
# We are at the last entry in the path so we must remove the field
if (len(path)) == index:
# Remove the field if there are no more dict keys in the path,
# only "<array>" traversal markers or end.
if all(p == "<array>" for p in path[index:]):
item = obj.pop(key)
else:
item = obj[key]
Expand Down
2 changes: 1 addition & 1 deletion src/courier/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "courier"
__version__ = "7.11.0" # x-release-please-version
__version__ = "7.11.1" # x-release-please-version
17 changes: 8 additions & 9 deletions src/courier/resources/notifications/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
from ...types.notification_template_payload_param import NotificationTemplatePayloadParam
from ...types.notification_content_mutation_response import NotificationContentMutationResponse
from ...types.notification_retrieve_content_response import NotificationRetrieveContentResponse
from ...types.notification_template_mutation_response import NotificationTemplateMutationResponse
from ...types.notification_template_version_list_response import NotificationTemplateVersionListResponse

__all__ = ["NotificationsResource", "AsyncNotificationsResource"]
Expand Down Expand Up @@ -86,7 +85,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NotificationTemplateMutationResponse:
) -> NotificationTemplateGetResponse:
"""Create a notification template.

Requires all fields in the notification object.
Expand Down Expand Up @@ -119,7 +118,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NotificationTemplateMutationResponse,
cast_to=NotificationTemplateGetResponse,
)

def retrieve(
Expand Down Expand Up @@ -512,7 +511,7 @@ def replace(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NotificationTemplateMutationResponse:
) -> NotificationTemplateGetResponse:
"""Replace a notification template.

All fields are required.
Expand Down Expand Up @@ -546,7 +545,7 @@ def replace(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NotificationTemplateMutationResponse,
cast_to=NotificationTemplateGetResponse,
)

def retrieve_content(
Expand Down Expand Up @@ -637,7 +636,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NotificationTemplateMutationResponse:
) -> NotificationTemplateGetResponse:
"""Create a notification template.

Requires all fields in the notification object.
Expand Down Expand Up @@ -670,7 +669,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NotificationTemplateMutationResponse,
cast_to=NotificationTemplateGetResponse,
)

async def retrieve(
Expand Down Expand Up @@ -1067,7 +1066,7 @@ async def replace(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NotificationTemplateMutationResponse:
) -> NotificationTemplateGetResponse:
"""Replace a notification template.

All fields are required.
Expand Down Expand Up @@ -1101,7 +1100,7 @@ async def replace(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NotificationTemplateMutationResponse,
cast_to=NotificationTemplateGetResponse,
)

async def retrieve_content(
Expand Down
30 changes: 18 additions & 12 deletions src/courier/resources/providers/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,17 @@ def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Provider:
"""Update an existing provider configuration.
"""Replace an existing provider configuration.

The `provider` key is required. All
other fields are optional — omitted fields are cleared from the stored
configuration (this is a full replacement, not a partial merge).
The `provider` key is required and
determines which provider-specific settings schema is applied. All other fields
are optional — omitted fields are cleared from the stored configuration (this is
a full replacement, not a partial merge). Changing the provider type for an
existing configuration is not supported.

Args:
provider: The provider key identifying the type.
provider: The provider key identifying the type. Required on every request because it
selects the provider-specific settings schema for validation.

alias: Updated alias. Omit to clear.

Expand All @@ -187,7 +190,7 @@ def update(
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return self._post(
return self._put(
path_template("/providers/{id}", id=id),
body=maybe_transform(
{
Expand Down Expand Up @@ -408,14 +411,17 @@ async def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> Provider:
"""Update an existing provider configuration.
"""Replace an existing provider configuration.

The `provider` key is required. All
other fields are optional — omitted fields are cleared from the stored
configuration (this is a full replacement, not a partial merge).
The `provider` key is required and
determines which provider-specific settings schema is applied. All other fields
are optional — omitted fields are cleared from the stored configuration (this is
a full replacement, not a partial merge). Changing the provider type for an
existing configuration is not supported.

Args:
provider: The provider key identifying the type.
provider: The provider key identifying the type. Required on every request because it
selects the provider-specific settings schema for validation.

alias: Updated alias. Omit to clear.

Expand All @@ -435,7 +441,7 @@ async def update(
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
return await self._post(
return await self._put(
path_template("/providers/{id}", id=id),
body=await async_maybe_transform(
{
Expand Down
17 changes: 8 additions & 9 deletions src/courier/resources/routing_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from ..types.routing_strategy_list_response import RoutingStrategyListResponse
from ..types.shared_params.message_channels import MessageChannels
from ..types.shared_params.message_providers import MessageProviders
from ..types.routing_strategy_mutation_response import RoutingStrategyMutationResponse
from ..types.associated_notification_list_response import AssociatedNotificationListResponse

__all__ = ["RoutingStrategiesResource", "AsyncRoutingStrategiesResource"]
Expand Down Expand Up @@ -69,7 +68,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RoutingStrategyMutationResponse:
) -> RoutingStrategyGetResponse:
"""Create a routing strategy.

Requires a name and routing configuration at minimum.
Expand Down Expand Up @@ -112,7 +111,7 @@ def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=RoutingStrategyMutationResponse,
cast_to=RoutingStrategyGetResponse,
)

def retrieve(
Expand Down Expand Up @@ -302,7 +301,7 @@ def replace(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RoutingStrategyMutationResponse:
) -> RoutingStrategyGetResponse:
"""Replace a routing strategy.

Full document replacement; the caller must send the
Expand Down Expand Up @@ -347,7 +346,7 @@ def replace(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=RoutingStrategyMutationResponse,
cast_to=RoutingStrategyGetResponse,
)


Expand Down Expand Up @@ -386,7 +385,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RoutingStrategyMutationResponse:
) -> RoutingStrategyGetResponse:
"""Create a routing strategy.

Requires a name and routing configuration at minimum.
Expand Down Expand Up @@ -429,7 +428,7 @@ async def create(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=RoutingStrategyMutationResponse,
cast_to=RoutingStrategyGetResponse,
)

async def retrieve(
Expand Down Expand Up @@ -619,7 +618,7 @@ async def replace(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> RoutingStrategyMutationResponse:
) -> RoutingStrategyGetResponse:
"""Replace a routing strategy.

Full document replacement; the caller must send the
Expand Down Expand Up @@ -664,7 +663,7 @@ async def replace(
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=RoutingStrategyMutationResponse,
cast_to=RoutingStrategyGetResponse,
)


Expand Down
Loading