Skip to content

Commit 0cc760d

Browse files
author
stlc-bot
committed
feat(zdr): accept zero data retention on people search and company search (#2852)
Stainless-Generated-From: 89c99e58889260b1f8c8ff44dc4345e0f592767f
1 parent d4d77b3 commit 0cc760d

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/context/dev/resources/people.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def search(
129129
filters: person_search_params.Filters | Omit = omit,
130130
mode: Literal["fast", "ultra"] | Omit = omit,
131131
tags: SequenceNotStr[str] | Omit = omit,
132+
zdr: Literal["enabled", "disabled"] | Omit = omit,
132133
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
133134
# The extra values given here take precedence over values defined on the client or passed to this method.
134135
extra_headers: Headers | None = None,
@@ -154,6 +155,9 @@ def search(
154155
155156
tags: Labels for filtering usage in the dashboard.
156157
158+
zdr: `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
159+
your organization has ZDR.
160+
157161
extra_headers: Send extra headers
158162
159163
extra_query: Add additional query parameters to the request
@@ -171,6 +175,7 @@ def search(
171175
"filters": filters,
172176
"mode": mode,
173177
"tags": tags,
178+
"zdr": zdr,
174179
},
175180
person_search_params.PersonSearchParams,
176181
),
@@ -285,6 +290,7 @@ async def search(
285290
filters: person_search_params.Filters | Omit = omit,
286291
mode: Literal["fast", "ultra"] | Omit = omit,
287292
tags: SequenceNotStr[str] | Omit = omit,
293+
zdr: Literal["enabled", "disabled"] | Omit = omit,
288294
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
289295
# The extra values given here take precedence over values defined on the client or passed to this method.
290296
extra_headers: Headers | None = None,
@@ -310,6 +316,9 @@ async def search(
310316
311317
tags: Labels for filtering usage in the dashboard.
312318
319+
zdr: `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
320+
your organization has ZDR.
321+
313322
extra_headers: Send extra headers
314323
315324
extra_query: Add additional query parameters to the request
@@ -327,6 +336,7 @@ async def search(
327336
"filters": filters,
328337
"mode": mode,
329338
"tags": tags,
339+
"zdr": zdr,
330340
},
331341
person_search_params.PersonSearchParams,
332342
),

‎src/context/dev/types/person_search_params.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class PersonSearchParams(TypedDict, total=False):
3333
tags: SequenceNotStr[str]
3434
"""Labels for filtering usage in the dashboard."""
3535

36+
zdr: Literal["enabled", "disabled"]
37+
"""`enabled` turns on zero data retention.
38+
39+
Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.
40+
"""
41+
3642

3743
class Filters(TypedDict, total=False):
3844
"""Additional constraints every result must match."""

‎tests/api_resources/test_people.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def test_method_search_with_all_params(self, client: ContextDev) -> None:
105105
},
106106
mode="fast",
107107
tags=["production", "team-alpha"],
108+
zdr="enabled",
108109
)
109110
assert_matches_type(PersonSearchResponse, person, path=["response"])
110111

@@ -228,6 +229,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncContextDev
228229
},
229230
mode="fast",
230231
tags=["production", "team-alpha"],
232+
zdr="enabled",
231233
)
232234
assert_matches_type(PersonSearchResponse, person, path=["response"])
233235

0 commit comments

Comments
 (0)