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.25.0"
".": "7.26.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 145
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-31abe25287f6885a9e18e84b9317abcb36a9fff5f694feb7a4353c5622d93730.yml
openapi_spec_hash: 65d48382e29817ef7b89e70b20bf8d4d
config_hash: 3eb0070d128aef7a6da16173f7050177
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-82881993f19c5fac9ac662f1a516e5b54bd7c6655d07f29a3779dfb0286cafd3.yml
openapi_spec_hash: 92f4c510a5a15d091036d70caa8ee573
config_hash: 768b0f5ada2bf01cf2659d5dbbad1fa0
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 7.26.0 (2026-08-10)

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

### Features

* Merge pull request [#185](https://github.com/trycourier/courier-python/issues/185) from trycourier/geraldosilva/c-19821-notifications-alias-v2 ([7559ff3](https://github.com/trycourier/courier-python/commit/7559ff3012059025eb764927e1a2246b93fd8bbb))

## 7.25.0 (2026-08-04)

Full Changelog: [v7.24.0...v7.25.0](https://github.com/trycourier/courier-python/compare/v7.24.0...v7.25.0)
Expand Down
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ from courier.types import (
NotificationElementPutRequest,
NotificationGetContent,
NotificationLocalePutRequest,
NotificationTemplateAlias,
NotificationTemplateCreateRequest,
NotificationTemplatePayload,
NotificationTemplatePublishRequest,
Expand All @@ -438,6 +439,7 @@ from courier.types import (
NotificationTemplateSummary,
NotificationTemplateUpdateRequest,
NotificationTemplateVersionListResponse,
NotificationTemplateWritePayload,
VersionNode,
NotificationListResponse,
NotificationRetrieveContentResponse,
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.25.0"
version = "7.26.0"
description = "The official Python library for the Courier API"
dynamic = ["readme"]
license = "Apache-2.0"
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.25.0" # x-release-please-version
__version__ = "7.26.0" # x-release-please-version
26 changes: 13 additions & 13 deletions src/courier/resources/notifications/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
from ...types.notification_list_response import NotificationListResponse
from ...types.notification_template_state import NotificationTemplateState
from ...types.notification_template_response import NotificationTemplateResponse
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_write_payload_param import NotificationTemplateWritePayloadParam
from ...types.notification_template_version_list_response import NotificationTemplateVersionListResponse

__all__ = ["NotificationsResource", "AsyncNotificationsResource"]
Expand Down Expand Up @@ -84,7 +84,7 @@ def with_streaming_response(self) -> NotificationsResourceWithStreamingResponse:
def create(
self,
*,
notification: NotificationTemplatePayloadParam,
notification: NotificationTemplateWritePayloadParam,
state: Literal["DRAFT", "PUBLISHED"] | Omit = omit,
idempotency_key: str | Omit = omit,
x_idempotency_expiration: str | Omit = omit,
Expand All @@ -101,8 +101,8 @@ def create(
Templates are created in draft state by default.

Args:
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
notification: Template fields accepted in POST and PUT request bodies, nested under a
`notification` key.

state: Template state after creation. Case-insensitive input, normalized to uppercase
in the response. Defaults to "DRAFT".
Expand Down Expand Up @@ -569,7 +569,7 @@ def replace(
self,
id: str,
*,
notification: NotificationTemplatePayloadParam,
notification: NotificationTemplateWritePayloadParam,
state: Literal["DRAFT", "PUBLISHED"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -583,8 +583,8 @@ def replace(
the ones you want changed. Publish separately to make it live.

Args:
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
notification: Template fields accepted in POST and PUT request bodies, nested under a
`notification` key.

state: Template state after update. Case-insensitive input, normalized to uppercase in
the response. Defaults to "DRAFT".
Expand Down Expand Up @@ -699,7 +699,7 @@ def with_streaming_response(self) -> AsyncNotificationsResourceWithStreamingResp
async def create(
self,
*,
notification: NotificationTemplatePayloadParam,
notification: NotificationTemplateWritePayloadParam,
state: Literal["DRAFT", "PUBLISHED"] | Omit = omit,
idempotency_key: str | Omit = omit,
x_idempotency_expiration: str | Omit = omit,
Expand All @@ -716,8 +716,8 @@ async def create(
Templates are created in draft state by default.

Args:
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
notification: Template fields accepted in POST and PUT request bodies, nested under a
`notification` key.

state: Template state after creation. Case-insensitive input, normalized to uppercase
in the response. Defaults to "DRAFT".
Expand Down Expand Up @@ -1188,7 +1188,7 @@ async def replace(
self,
id: str,
*,
notification: NotificationTemplatePayloadParam,
notification: NotificationTemplateWritePayloadParam,
state: Literal["DRAFT", "PUBLISHED"] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand All @@ -1202,8 +1202,8 @@ async def replace(
the ones you want changed. Publish separately to make it live.

Args:
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
notification: Template fields accepted in POST and PUT request bodies, nested under a
`notification` key.

state: Template state after update. Case-insensitive input, normalized to uppercase in
the response. Defaults to "DRAFT".
Expand Down
4 changes: 4 additions & 0 deletions src/courier/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
from .journey_fetch_post_put_node import JourneyFetchPostPutNode as JourneyFetchPostPutNode
from .notification_publish_params import NotificationPublishParams as NotificationPublishParams
from .notification_replace_params import NotificationReplaceParams as NotificationReplaceParams
from .notification_template_alias import NotificationTemplateAlias as NotificationTemplateAlias
from .notification_template_state import NotificationTemplateState as NotificationTemplateState
from .tenant_template_input_param import TenantTemplateInputParam as TenantTemplateInputParam
from .audience_list_members_params import AudienceListMembersParams as AudienceListMembersParams
Expand Down Expand Up @@ -310,6 +311,9 @@
from .workspace_preference_topic_list_response import (
WorkspacePreferenceTopicListResponse as WorkspacePreferenceTopicListResponse,
)
from .notification_template_write_payload_param import (
NotificationTemplateWritePayloadParam as NotificationTemplateWritePayloadParam,
)
from .routing_strategy_list_notifications_params import (
RoutingStrategyListNotificationsParams as RoutingStrategyListNotificationsParams,
)
Expand Down
8 changes: 4 additions & 4 deletions src/courier/types/notification_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
from typing_extensions import Literal, Required, Annotated, TypedDict

from .._utils import PropertyInfo
from .notification_template_payload_param import NotificationTemplatePayloadParam
from .notification_template_write_payload_param import NotificationTemplateWritePayloadParam

__all__ = ["NotificationCreateParams"]


class NotificationCreateParams(TypedDict, total=False):
notification: Required[NotificationTemplatePayloadParam]
notification: Required[NotificationTemplateWritePayloadParam]
"""
Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
Template fields accepted in POST and PUT request bodies, nested under a
`notification` key.
"""

state: Literal["DRAFT", "PUBLISHED"]
Expand Down
8 changes: 4 additions & 4 deletions src/courier/types/notification_replace_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

from typing_extensions import Literal, Required, TypedDict

from .notification_template_payload_param import NotificationTemplatePayloadParam
from .notification_template_write_payload_param import NotificationTemplateWritePayloadParam

__all__ = ["NotificationReplaceParams"]


class NotificationReplaceParams(TypedDict, total=False):
notification: Required[NotificationTemplatePayloadParam]
notification: Required[NotificationTemplateWritePayloadParam]
"""
Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
Template fields accepted in POST and PUT request bodies, nested under a
`notification` key.
"""

state: Literal["DRAFT", "PUBLISHED"]
Expand Down
8 changes: 8 additions & 0 deletions src/courier/types/notification_template_alias.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Union
from typing_extensions import TypeAlias

__all__ = ["NotificationTemplateAlias"]

NotificationTemplateAlias: TypeAlias = Union[str, List[str]]
10 changes: 10 additions & 0 deletions src/courier/types/notification_template_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Optional
from typing_extensions import Literal

from .notification_template_alias import NotificationTemplateAlias
from .notification_template_payload import NotificationTemplatePayload

__all__ = ["NotificationTemplateResponse"]
Expand All @@ -25,6 +26,15 @@ class NotificationTemplateResponse(NotificationTemplatePayload):
state: Literal["DRAFT", "PUBLISHED"]
"""The template state. Always uppercase."""

alias: Optional[NotificationTemplateAlias] = None
"""
A template's send-time alias as returned by a read, omitted entirely when it has
none. Usually a single string; an array for a template that resolves from
several aliases, which writes through this API can no longer produce — only
templates predating that restriction, or aliases attached outside this API, hold
more than one.
"""

updated: Optional[int] = None
"""Epoch milliseconds of last update."""

Expand Down
26 changes: 26 additions & 0 deletions src/courier/types/notification_template_write_payload_param.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Optional

from .notification_template_payload_param import NotificationTemplatePayloadParam

__all__ = ["NotificationTemplateWritePayloadParam"]


class NotificationTemplateWritePayloadParam(NotificationTemplatePayloadParam, total=False):
"""
Template fields accepted in POST and PUT request bodies, nested under a `notification` key.
"""

alias: Optional[str]
"""Send-time alias for this template — the value you pass as `event` to POST /send.

Writes accept a single alias only. Optional, with three distinct meanings. Omit
it to leave any existing aliases untouched. Send a string to make this the
template's only alias — a template that already resolved from several aliases
keeps just this one and the rest are detached. Send null to remove every alias
from the template. An alias may not be claimed by another template — doing so
returns 409 — and may not begin with "tenant/".
"""
4 changes: 4 additions & 0 deletions tests/api_resources/test_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_method_create_with_all_params(self, client: Courier) -> None:
"routing": {"strategy_id": "rs_01kx4h2jdafq8bk9amzvy6hbv0"},
"subscription": {"topic_id": "pt_01kx4h2jdafq8bk9a26x0kvd1t"},
"tags": ["onboarding", "welcome"],
"alias": "welcome",
},
state="DRAFT",
idempotency_key="order-ORD-456-user-123",
Expand Down Expand Up @@ -620,6 +621,7 @@ def test_method_replace_with_all_params(self, client: Courier) -> None:
"routing": {"strategy_id": "strategy_id"},
"subscription": {"topic_id": "topic_id"},
"tags": ["updated"],
"alias": "alias",
},
state="PUBLISHED",
)
Expand Down Expand Up @@ -781,6 +783,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCourier) -
"routing": {"strategy_id": "rs_01kx4h2jdafq8bk9amzvy6hbv0"},
"subscription": {"topic_id": "pt_01kx4h2jdafq8bk9a26x0kvd1t"},
"tags": ["onboarding", "welcome"],
"alias": "welcome",
},
state="DRAFT",
idempotency_key="order-ORD-456-user-123",
Expand Down Expand Up @@ -1346,6 +1349,7 @@ async def test_method_replace_with_all_params(self, async_client: AsyncCourier)
"routing": {"strategy_id": "strategy_id"},
"subscription": {"topic_id": "topic_id"},
"tags": ["updated"],
"alias": "alias",
},
state="PUBLISHED",
)
Expand Down