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.1"
".": "7.11.2"
}
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-f0ac5c2fa86eabda773c549f5809d3e2d109e3e1d5a07f6fe1ace18355e4680a.yml
openapi_spec_hash: b25dc0b42dd9386ab4a025bb2143bde6
config_hash: 6037e4a9909efb8b2edac2dcc907b84f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier%2Fcourier-3f78581b4e078a1f620d9f587f18d77bcde6d20f56b0e4ae798648f4236494fb.yml
openapi_spec_hash: 6bd33e0396d85e11bb46f0d549af93a3
config_hash: afcc4f6f8c33ca3f338589e32e086f56
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.2 (2026-04-14)

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

### Bug Fixes

* **types:** flatten NotificationTemplateResponse structure ([de82b20](https://github.com/trycourier/courier-python/commit/de82b206f9d038b259de06360a6e52420c97c156))
* **types:** make note optional in ResultNotification, flatten template response ([b7dc001](https://github.com/trycourier/courier-python/commit/b7dc001d77e093a2d93b4c8e7b7c93f5b4518edd))

## 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)
Expand Down
8 changes: 4 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,9 @@ from courier.types import (
NotificationGetContent,
NotificationLocalePutRequest,
NotificationTemplateCreateRequest,
NotificationTemplateGetResponse,
NotificationTemplatePayload,
NotificationTemplatePublishRequest,
NotificationTemplateResponse,
NotificationTemplateState,
NotificationTemplateSummary,
NotificationTemplateUpdateRequest,
Expand All @@ -366,16 +366,16 @@ 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_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="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_response.py">NotificationTemplateResponse</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_response.py">NotificationTemplateResponse</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>
- <code title="get /notifications/{id}/versions">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">list_versions</a>(id, \*\*<a href="src/courier/types/notification_list_versions_params.py">params</a>) -> <a href="./src/courier/types/notification_template_version_list_response.py">NotificationTemplateVersionListResponse</a></code>
- <code title="post /notifications/{id}/publish">client.notifications.<a href="./src/courier/resources/notifications/notifications.py">publish</a>(id, \*\*<a href="src/courier/types/notification_publish_params.py">params</a>) -> None</code>
- <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_get_response.py">NotificationTemplateGetResponse</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_response.py">NotificationTemplateResponse</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 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.1"
version = "7.11.2"
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.11.1" # x-release-please-version
__version__ = "7.11.2" # x-release-please-version
12 changes: 12 additions & 0 deletions src/courier/resources/notifications/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CheckUpdateResponse:
"""
Replace the checks for a notification template submission.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -94,6 +96,8 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CheckListResponse:
"""
Retrieve the checks for a notification template submission.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -128,6 +132,8 @@ def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
"""
Cancel a notification template submission.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -185,6 +191,8 @@ async def update(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CheckUpdateResponse:
"""
Replace the checks for a notification template submission.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -220,6 +228,8 @@ async def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> CheckListResponse:
"""
Retrieve the checks for a notification template submission.

Args:
extra_headers: Send extra headers

Expand Down Expand Up @@ -254,6 +264,8 @@ async def delete(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> None:
"""
Cancel a notification template submission.

Args:
extra_headers: Send extra headers

Expand Down
42 changes: 21 additions & 21 deletions src/courier/resources/notifications/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from ..._base_client import make_request_options
from ...types.notification_list_response import NotificationListResponse
from ...types.notification_template_state import NotificationTemplateState
from ...types.notification_template_get_response import NotificationTemplateGetResponse
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
Expand Down Expand Up @@ -85,15 +85,15 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NotificationTemplateGetResponse:
) -> NotificationTemplateResponse:
"""Create a notification template.

Requires all fields in the notification object.
Templates are created in draft state by default.

Args:
notification: Full document shape used in POST and PUT request bodies, and returned inside the
GET response envelope.
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.

state: Template state after creation. Case-insensitive input, normalized to uppercase
in the response. Defaults to "DRAFT".
Expand All @@ -118,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=NotificationTemplateGetResponse,
cast_to=NotificationTemplateResponse,
)

def retrieve(
Expand All @@ -132,7 +132,7 @@ def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NotificationTemplateGetResponse:
) -> NotificationTemplateResponse:
"""Retrieve a notification template by ID.

Returns the published version by
Expand Down Expand Up @@ -161,7 +161,7 @@ def retrieve(
timeout=timeout,
query=maybe_transform({"version": version}, notification_retrieve_params.NotificationRetrieveParams),
),
cast_to=NotificationTemplateGetResponse,
cast_to=NotificationTemplateResponse,
)

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

All fields are required.

Args:
notification: Full document shape used in POST and PUT request bodies, and returned inside the
GET response envelope.
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.

state: Template state after update. Case-insensitive input, normalized to uppercase in
the response. Defaults to "DRAFT".
Expand All @@ -545,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=NotificationTemplateGetResponse,
cast_to=NotificationTemplateResponse,
)

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

Requires all fields in the notification object.
Templates are created in draft state by default.

Args:
notification: Full document shape used in POST and PUT request bodies, and returned inside the
GET response envelope.
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.

state: Template state after creation. Case-insensitive input, normalized to uppercase
in the response. Defaults to "DRAFT".
Expand All @@ -669,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=NotificationTemplateGetResponse,
cast_to=NotificationTemplateResponse,
)

async def retrieve(
Expand All @@ -683,7 +683,7 @@ async def retrieve(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NotificationTemplateGetResponse:
) -> NotificationTemplateResponse:
"""Retrieve a notification template by ID.

Returns the published version by
Expand Down Expand Up @@ -714,7 +714,7 @@ async def retrieve(
{"version": version}, notification_retrieve_params.NotificationRetrieveParams
),
),
cast_to=NotificationTemplateGetResponse,
cast_to=NotificationTemplateResponse,
)

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

All fields are required.

Args:
notification: Full document shape used in POST and PUT request bodies, and returned inside the
GET response envelope.
notification: Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.

state: Template state after update. Case-insensitive input, normalized to uppercase in
the response. Defaults to "DRAFT".
Expand All @@ -1100,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=NotificationTemplateGetResponse,
cast_to=NotificationTemplateResponse,
)

async def retrieve_content(
Expand Down
2 changes: 1 addition & 1 deletion src/courier/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
from .translation_retrieve_response import TranslationRetrieveResponse as TranslationRetrieveResponse
from .audience_list_members_response import AudienceListMembersResponse as AudienceListMembersResponse
from .notification_put_locale_params import NotificationPutLocaleParams as NotificationPutLocaleParams
from .notification_template_response import NotificationTemplateResponse as NotificationTemplateResponse
from .routing_strategy_create_params import RoutingStrategyCreateParams as RoutingStrategyCreateParams
from .routing_strategy_list_response import RoutingStrategyListResponse as RoutingStrategyListResponse
from .inbound_bulk_message_user_param import InboundBulkMessageUserParam as InboundBulkMessageUserParam
Expand All @@ -226,7 +227,6 @@
from .notification_content_get_response import NotificationContentGetResponse as NotificationContentGetResponse
from .notification_list_versions_params import NotificationListVersionsParams as NotificationListVersionsParams
from .put_subscriptions_recipient_param import PutSubscriptionsRecipientParam as PutSubscriptionsRecipientParam
from .notification_template_get_response import NotificationTemplateGetResponse as NotificationTemplateGetResponse
from .notification_template_payload_param import NotificationTemplatePayloadParam as NotificationTemplatePayloadParam
from .notification_retrieve_content_params import NotificationRetrieveContentParams as NotificationRetrieveContentParams
from .associated_notification_list_response import (
Expand Down
4 changes: 2 additions & 2 deletions src/courier/types/notification_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
class NotificationCreateParams(TypedDict, total=False):
notification: Required[NotificationTemplatePayloadParam]
"""
Full document shape used in POST and PUT request bodies, and returned inside the
GET response envelope.
Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
"""

state: Literal["DRAFT", "PUBLISHED"]
Expand Down
4 changes: 2 additions & 2 deletions src/courier/types/notification_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class ResultNotification(BaseModel):
event_ids: List[str]
"""Array of event IDs associated with this notification"""

note: str

routing: "MessageRouting"

topic_id: str

updated_at: int

note: Optional[str] = None

tags: Optional[ResultNotificationTags] = None

title: Optional[str] = None
Expand Down
4 changes: 2 additions & 2 deletions src/courier/types/notification_replace_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
class NotificationReplaceParams(TypedDict, total=False):
notification: Required[NotificationTemplatePayloadParam]
"""
Full document shape used in POST and PUT request bodies, and returned inside the
GET response envelope.
Core template fields used in POST and PUT request bodies (nested under a
`notification` key) and returned at the top level in responses.
"""

state: Literal["DRAFT", "PUBLISHED"]
Expand Down
2 changes: 1 addition & 1 deletion src/courier/types/notification_template_payload.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Subscription(BaseModel):

class NotificationTemplatePayload(BaseModel):
"""
Full document shape used in POST and PUT request bodies, and returned inside the GET response envelope.
Core template fields used in POST and PUT request bodies (nested under a `notification` key) and returned at the top level in responses.
"""

brand: Optional[Brand] = None
Expand Down
2 changes: 1 addition & 1 deletion src/courier/types/notification_template_payload_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Subscription(TypedDict, total=False):

class NotificationTemplatePayloadParam(TypedDict, total=False):
"""
Full document shape used in POST and PUT request bodies, and returned inside the GET response envelope.
Core template fields used in POST and PUT request bodies (nested under a `notification` key) and returned at the top level in responses.
"""

brand: Required[Optional[Brand]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,25 @@
from typing import Optional
from typing_extensions import Literal

from .._models import BaseModel
from .notification_template_payload import NotificationTemplatePayload

__all__ = ["NotificationTemplateGetResponse", "Notification"]
__all__ = ["NotificationTemplateResponse"]


class Notification(NotificationTemplatePayload):
class NotificationTemplateResponse(NotificationTemplatePayload):
"""
Full document shape used in POST and PUT request bodies, and returned inside the GET response envelope.
Response for GET /notifications/{id}, POST /notifications, and PUT /notifications/{id}. Returns all template fields at the top level.
"""

id: str
"""The template ID."""


class NotificationTemplateGetResponse(BaseModel):
"""Envelope response for GET /notifications/{id}.

The notification object mirrors the POST/PUT input shape. Nullable fields return null when unset.
"""

created: int
"""Epoch milliseconds when the template was created."""

creator: str
"""User ID of the creator."""

notification: Notification
"""
Full document shape used in POST and PUT request bodies, and returned inside the
GET response envelope.
"""

state: Literal["DRAFT", "PUBLISHED"]
"""The template state. Always uppercase."""

Expand Down
Loading