Skip to content

Commit 6b41b85

Browse files
release: 7.15.0 (#136)
* feat(openapi): add DELETE /users/{id}/preferences/{topicId} * feat(openapi): add add-to-digest JourneyNode variant * release: 7.15.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 07db232 commit 6b41b85

12 files changed

Lines changed: 313 additions & 8 deletions

File tree

.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.14.0"
2+
".": "7.15.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 119
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-a64bb97c3455b0689de7f6a297ba1dc1e747561ce310ddb18b9c4a5f4d3d510a.yml
3-
openapi_spec_hash: 6a3b89f3ea7600e784902f61680f8f1a
4-
config_hash: 822a92efc80e63cdb2d496dbd6176620
1+
configured_endpoints: 120
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-cf10f3428ad9b9f636939a9305e80dd49118fea2c3f86cf61bf2b95367469e0f.yml
3+
openapi_spec_hash: a61356bb015cec773770d2b61cabaa58
4+
config_hash: 86b472590f1c27b5a74499744b30c2ee

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.15.0 (2026-06-17)
4+
5+
Full Changelog: [v7.14.0...v7.15.0](https://github.com/trycourier/courier-python/compare/v7.14.0...v7.15.0)
6+
7+
### Features
8+
9+
* **openapi:** add add-to-digest JourneyNode variant ([7abe0d3](https://github.com/trycourier/courier-python/commit/7abe0d346d51a31301753dc54ac0025285a14dc8))
10+
* **openapi:** add DELETE /users/{id}/preferences/{topicId} ([1f14fd0](https://github.com/trycourier/courier-python/commit/1f14fd06794d54d5cc6d959867561a72d660462a))
11+
312
## 7.14.0 (2026-06-12)
413

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

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ from courier.types.users import (
604604
Methods:
605605

606606
- <code title="get /users/{user_id}/preferences">client.users.preferences.<a href="./src/courier/resources/users/preferences.py">retrieve</a>(user_id, \*\*<a href="src/courier/types/users/preference_retrieve_params.py">params</a>) -> <a href="./src/courier/types/users/preference_retrieve_response.py">PreferenceRetrieveResponse</a></code>
607+
- <code title="delete /users/{user_id}/preferences/{topic_id}">client.users.preferences.<a href="./src/courier/resources/users/preferences.py">delete_topic</a>(topic_id, \*, user_id, \*\*<a href="src/courier/types/users/preference_delete_topic_params.py">params</a>) -> None</code>
607608
- <code title="get /users/{user_id}/preferences/{topic_id}">client.users.preferences.<a href="./src/courier/resources/users/preferences.py">retrieve_topic</a>(topic_id, \*, user_id, \*\*<a href="src/courier/types/users/preference_retrieve_topic_params.py">params</a>) -> <a href="./src/courier/types/users/preference_retrieve_topic_response.py">PreferenceRetrieveTopicResponse</a></code>
608609
- <code title="put /users/{user_id}/preferences/{topic_id}">client.users.preferences.<a href="./src/courier/resources/users/preferences.py">update_or_create_topic</a>(topic_id, \*, user_id, \*\*<a href="src/courier/types/users/preference_update_or_create_topic_params.py">params</a>) -> <a href="./src/courier/types/users/preference_update_or_create_topic_response.py">PreferenceUpdateOrCreateTopicResponse</a></code>
609610

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.14.0"
3+
version = "7.15.0"
44
description = "The official Python library for the Courier API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

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.14.0" # x-release-please-version
4+
__version__ = "7.15.0" # x-release-please-version

src/courier/resources/users/preferences.py

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import httpx
88

9-
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
9+
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
1010
from ..._utils import path_template, maybe_transform, async_maybe_transform
1111
from ..._compat import cached_property
1212
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -18,6 +18,7 @@
1818
)
1919
from ...types.users import (
2020
preference_retrieve_params,
21+
preference_delete_topic_params,
2122
preference_retrieve_topic_params,
2223
preference_update_or_create_topic_params,
2324
)
@@ -89,6 +90,54 @@ def retrieve(
8990
cast_to=PreferenceRetrieveResponse,
9091
)
9192

93+
def delete_topic(
94+
self,
95+
topic_id: str,
96+
*,
97+
user_id: str,
98+
tenant_id: Optional[str] | Omit = omit,
99+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
100+
# The extra values given here take precedence over values defined on the client or passed to this method.
101+
extra_headers: Headers | None = None,
102+
extra_query: Query | None = None,
103+
extra_body: Body | None = None,
104+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
105+
) -> None:
106+
"""
107+
Remove a user's preferences for a specific subscription topic, resetting the
108+
topic to its effective default. This operation is idempotent: deleting a
109+
preference that does not exist succeeds with no error.
110+
111+
Args:
112+
tenant_id: Delete the preferences of a user for this specific tenant context.
113+
114+
extra_headers: Send extra headers
115+
116+
extra_query: Add additional query parameters to the request
117+
118+
extra_body: Add additional JSON properties to the request
119+
120+
timeout: Override the client-level default timeout for this request, in seconds
121+
"""
122+
if not user_id:
123+
raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}")
124+
if not topic_id:
125+
raise ValueError(f"Expected a non-empty value for `topic_id` but received {topic_id!r}")
126+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
127+
return self._delete(
128+
path_template("/users/{user_id}/preferences/{topic_id}", user_id=user_id, topic_id=topic_id),
129+
options=make_request_options(
130+
extra_headers=extra_headers,
131+
extra_query=extra_query,
132+
extra_body=extra_body,
133+
timeout=timeout,
134+
query=maybe_transform(
135+
{"tenant_id": tenant_id}, preference_delete_topic_params.PreferenceDeleteTopicParams
136+
),
137+
),
138+
cast_to=NoneType,
139+
)
140+
92141
def retrieve_topic(
93142
self,
94143
topic_id: str,
@@ -247,6 +296,54 @@ async def retrieve(
247296
cast_to=PreferenceRetrieveResponse,
248297
)
249298

299+
async def delete_topic(
300+
self,
301+
topic_id: str,
302+
*,
303+
user_id: str,
304+
tenant_id: Optional[str] | Omit = omit,
305+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
306+
# The extra values given here take precedence over values defined on the client or passed to this method.
307+
extra_headers: Headers | None = None,
308+
extra_query: Query | None = None,
309+
extra_body: Body | None = None,
310+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
311+
) -> None:
312+
"""
313+
Remove a user's preferences for a specific subscription topic, resetting the
314+
topic to its effective default. This operation is idempotent: deleting a
315+
preference that does not exist succeeds with no error.
316+
317+
Args:
318+
tenant_id: Delete the preferences of a user for this specific tenant context.
319+
320+
extra_headers: Send extra headers
321+
322+
extra_query: Add additional query parameters to the request
323+
324+
extra_body: Add additional JSON properties to the request
325+
326+
timeout: Override the client-level default timeout for this request, in seconds
327+
"""
328+
if not user_id:
329+
raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}")
330+
if not topic_id:
331+
raise ValueError(f"Expected a non-empty value for `topic_id` but received {topic_id!r}")
332+
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
333+
return await self._delete(
334+
path_template("/users/{user_id}/preferences/{topic_id}", user_id=user_id, topic_id=topic_id),
335+
options=make_request_options(
336+
extra_headers=extra_headers,
337+
extra_query=extra_query,
338+
extra_body=extra_body,
339+
timeout=timeout,
340+
query=await async_maybe_transform(
341+
{"tenant_id": tenant_id}, preference_delete_topic_params.PreferenceDeleteTopicParams
342+
),
343+
),
344+
cast_to=NoneType,
345+
)
346+
250347
async def retrieve_topic(
251348
self,
252349
topic_id: str,
@@ -350,6 +447,9 @@ def __init__(self, preferences: PreferencesResource) -> None:
350447
self.retrieve = to_raw_response_wrapper(
351448
preferences.retrieve,
352449
)
450+
self.delete_topic = to_raw_response_wrapper(
451+
preferences.delete_topic,
452+
)
353453
self.retrieve_topic = to_raw_response_wrapper(
354454
preferences.retrieve_topic,
355455
)
@@ -365,6 +465,9 @@ def __init__(self, preferences: AsyncPreferencesResource) -> None:
365465
self.retrieve = async_to_raw_response_wrapper(
366466
preferences.retrieve,
367467
)
468+
self.delete_topic = async_to_raw_response_wrapper(
469+
preferences.delete_topic,
470+
)
368471
self.retrieve_topic = async_to_raw_response_wrapper(
369472
preferences.retrieve_topic,
370473
)
@@ -380,6 +483,9 @@ def __init__(self, preferences: PreferencesResource) -> None:
380483
self.retrieve = to_streamed_response_wrapper(
381484
preferences.retrieve,
382485
)
486+
self.delete_topic = to_streamed_response_wrapper(
487+
preferences.delete_topic,
488+
)
383489
self.retrieve_topic = to_streamed_response_wrapper(
384490
preferences.retrieve_topic,
385491
)
@@ -395,6 +501,9 @@ def __init__(self, preferences: AsyncPreferencesResource) -> None:
395501
self.retrieve = async_to_streamed_response_wrapper(
396502
preferences.retrieve,
397503
)
504+
self.delete_topic = async_to_streamed_response_wrapper(
505+
preferences.delete_topic,
506+
)
398507
self.retrieve_topic = async_to_streamed_response_wrapper(
399508
preferences.retrieve_topic,
400509
)

src/courier/types/journey_node.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"JourneyNode",
2424
"JourneyBatchNode",
2525
"JourneyBatchNodeRetain",
26+
"JourneyAddToDigestNode",
2627
"JourneyBranchNode",
2728
"JourneyBranchNodeDefault",
2829
"JourneyBranchNodePath",
@@ -94,6 +95,27 @@ class JourneyBatchNode(BaseModel):
9495
"""Releases the batch once this many events have been collected."""
9596

9697

98+
class JourneyAddToDigestNode(BaseModel):
99+
"""Add the current event to a digest keyed by the given subscription topic.
100+
101+
The digest accumulates events and releases them on the schedule configured for the topic.
102+
"""
103+
104+
subscription_topic_id: str
105+
"""The subscription topic that owns the digest the event is added to."""
106+
107+
type: Literal["add-to-digest"]
108+
109+
id: Optional[str] = None
110+
111+
conditions: Optional[JourneyConditionsField] = None
112+
"""Condition spec for a journey node.
113+
114+
Accepts a single condition atom, an AND/OR group, or an AND/OR nested group.
115+
Omit the `conditions` property entirely to express "no conditions".
116+
"""
117+
118+
97119
class JourneyBranchNodeDefault(BaseModel):
98120
nodes: List["JourneyNode"]
99121

@@ -140,6 +162,7 @@ class JourneyBranchNode(BaseModel):
140162
JourneyThrottleStaticNode,
141163
JourneyThrottleDynamicNode,
142164
JourneyBatchNode,
165+
JourneyAddToDigestNode,
143166
JourneyExitNode,
144167
JourneyBranchNode,
145168
]

src/courier/types/journey_node_param.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"JourneyNodeParam",
2323
"JourneyBatchNode",
2424
"JourneyBatchNodeRetain",
25+
"JourneyAddToDigestNode",
2526
"JourneyBranchNode",
2627
"JourneyBranchNodeDefault",
2728
"JourneyBranchNodePath",
@@ -93,6 +94,27 @@ class JourneyBatchNode(TypedDict, total=False):
9394
"""Releases the batch once this many events have been collected."""
9495

9596

97+
class JourneyAddToDigestNode(TypedDict, total=False):
98+
"""Add the current event to a digest keyed by the given subscription topic.
99+
100+
The digest accumulates events and releases them on the schedule configured for the topic.
101+
"""
102+
103+
subscription_topic_id: Required[str]
104+
"""The subscription topic that owns the digest the event is added to."""
105+
106+
type: Required[Literal["add-to-digest"]]
107+
108+
id: str
109+
110+
conditions: JourneyConditionsFieldParam
111+
"""Condition spec for a journey node.
112+
113+
Accepts a single condition atom, an AND/OR group, or an AND/OR nested group.
114+
Omit the `conditions` property entirely to express "no conditions".
115+
"""
116+
117+
96118
class JourneyBranchNodeDefault(TypedDict, total=False):
97119
nodes: Required[Iterable["JourneyNodeParam"]]
98120

@@ -139,6 +161,7 @@ class JourneyBranchNode(TypedDict, total=False):
139161
JourneyThrottleStaticNodeParam,
140162
JourneyThrottleDynamicNodeParam,
141163
JourneyBatchNode,
164+
JourneyAddToDigestNode,
142165
JourneyExitNodeParam,
143166
JourneyBranchNode,
144167
]

src/courier/types/users/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from .preference_retrieve_params import PreferenceRetrieveParams as PreferenceRetrieveParams
1515
from .tenant_add_multiple_params import TenantAddMultipleParams as TenantAddMultipleParams
1616
from .preference_retrieve_response import PreferenceRetrieveResponse as PreferenceRetrieveResponse
17+
from .preference_delete_topic_params import PreferenceDeleteTopicParams as PreferenceDeleteTopicParams
1718
from .preference_retrieve_topic_params import PreferenceRetrieveTopicParams as PreferenceRetrieveTopicParams
1819
from .preference_retrieve_topic_response import PreferenceRetrieveTopicResponse as PreferenceRetrieveTopicResponse
1920
from .preference_update_or_create_topic_params import (

0 commit comments

Comments
 (0)