55import httpx
66
77from ..types import context_create_params
8- from .._types import Body , Omit , Query , Headers , NoneType , NotGiven , omit , not_given
8+ from .._types import Body , Query , Headers , NotGiven , not_given
99from .._utils import maybe_transform , async_maybe_transform
1010from .._compat import cached_property
1111from .._resource import SyncAPIResource , AsyncAPIResource
1616 async_to_streamed_response_wrapper ,
1717)
1818from .._base_client import make_request_options
19- from ..types .context import Context
2019from ..types .context_create_response import ContextCreateResponse
2120from ..types .context_update_response import ContextUpdateResponse
21+ from ..types .context_retrieve_response import ContextRetrieveResponse
2222
2323__all__ = ["ContextsResource" , "AsyncContextsResource" ]
2424
@@ -46,7 +46,7 @@ def with_streaming_response(self) -> ContextsResourceWithStreamingResponse:
4646 def create (
4747 self ,
4848 * ,
49- project_id : str | Omit = omit ,
49+ project_id : str ,
5050 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5151 # The extra values given here take precedence over values defined on the client or passed to this method.
5252 extra_headers : Headers | None = None ,
@@ -89,9 +89,9 @@ def retrieve(
8989 extra_query : Query | None = None ,
9090 extra_body : Body | None = None ,
9191 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
92- ) -> Context :
92+ ) -> ContextRetrieveResponse :
9393 """
94- Context
94+ Get a Context
9595
9696 Args:
9797 extra_headers: Send extra headers
@@ -109,7 +109,7 @@ def retrieve(
109109 options = make_request_options (
110110 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
111111 ),
112- cast_to = Context ,
112+ cast_to = ContextRetrieveResponse ,
113113 )
114114
115115 def update (
@@ -124,7 +124,7 @@ def update(
124124 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
125125 ) -> ContextUpdateResponse :
126126 """
127- Update Context
127+ Update a Context
128128
129129 Args:
130130 extra_headers: Send extra headers
@@ -145,40 +145,6 @@ def update(
145145 cast_to = ContextUpdateResponse ,
146146 )
147147
148- def delete (
149- self ,
150- id : str ,
151- * ,
152- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153- # The extra values given here take precedence over values defined on the client or passed to this method.
154- extra_headers : Headers | None = None ,
155- extra_query : Query | None = None ,
156- extra_body : Body | None = None ,
157- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
158- ) -> None :
159- """
160- Delete Context
161-
162- Args:
163- extra_headers: Send extra headers
164-
165- extra_query: Add additional query parameters to the request
166-
167- extra_body: Add additional JSON properties to the request
168-
169- timeout: Override the client-level default timeout for this request, in seconds
170- """
171- if not id :
172- raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
173- extra_headers = {"Accept" : "*/*" , ** (extra_headers or {})}
174- return self ._delete (
175- f"/v1/contexts/{ id } " ,
176- options = make_request_options (
177- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
178- ),
179- cast_to = NoneType ,
180- )
181-
182148
183149class AsyncContextsResource (AsyncAPIResource ):
184150 @cached_property
@@ -203,7 +169,7 @@ def with_streaming_response(self) -> AsyncContextsResourceWithStreamingResponse:
203169 async def create (
204170 self ,
205171 * ,
206- project_id : str | Omit = omit ,
172+ project_id : str ,
207173 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
208174 # The extra values given here take precedence over values defined on the client or passed to this method.
209175 extra_headers : Headers | None = None ,
@@ -246,9 +212,9 @@ async def retrieve(
246212 extra_query : Query | None = None ,
247213 extra_body : Body | None = None ,
248214 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
249- ) -> Context :
215+ ) -> ContextRetrieveResponse :
250216 """
251- Context
217+ Get a Context
252218
253219 Args:
254220 extra_headers: Send extra headers
@@ -266,7 +232,7 @@ async def retrieve(
266232 options = make_request_options (
267233 extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
268234 ),
269- cast_to = Context ,
235+ cast_to = ContextRetrieveResponse ,
270236 )
271237
272238 async def update (
@@ -281,7 +247,7 @@ async def update(
281247 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
282248 ) -> ContextUpdateResponse :
283249 """
284- Update Context
250+ Update a Context
285251
286252 Args:
287253 extra_headers: Send extra headers
@@ -302,40 +268,6 @@ async def update(
302268 cast_to = ContextUpdateResponse ,
303269 )
304270
305- async def delete (
306- self ,
307- id : str ,
308- * ,
309- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
310- # The extra values given here take precedence over values defined on the client or passed to this method.
311- extra_headers : Headers | None = None ,
312- extra_query : Query | None = None ,
313- extra_body : Body | None = None ,
314- timeout : float | httpx .Timeout | None | NotGiven = not_given ,
315- ) -> None :
316- """
317- Delete Context
318-
319- Args:
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 id :
329- raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
330- extra_headers = {"Accept" : "*/*" , ** (extra_headers or {})}
331- return await self ._delete (
332- f"/v1/contexts/{ id } " ,
333- options = make_request_options (
334- extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
335- ),
336- cast_to = NoneType ,
337- )
338-
339271
340272class ContextsResourceWithRawResponse :
341273 def __init__ (self , contexts : ContextsResource ) -> None :
@@ -350,9 +282,6 @@ def __init__(self, contexts: ContextsResource) -> None:
350282 self .update = to_raw_response_wrapper (
351283 contexts .update ,
352284 )
353- self .delete = to_raw_response_wrapper (
354- contexts .delete ,
355- )
356285
357286
358287class AsyncContextsResourceWithRawResponse :
@@ -368,9 +297,6 @@ def __init__(self, contexts: AsyncContextsResource) -> None:
368297 self .update = async_to_raw_response_wrapper (
369298 contexts .update ,
370299 )
371- self .delete = async_to_raw_response_wrapper (
372- contexts .delete ,
373- )
374300
375301
376302class ContextsResourceWithStreamingResponse :
@@ -386,9 +312,6 @@ def __init__(self, contexts: ContextsResource) -> None:
386312 self .update = to_streamed_response_wrapper (
387313 contexts .update ,
388314 )
389- self .delete = to_streamed_response_wrapper (
390- contexts .delete ,
391- )
392315
393316
394317class AsyncContextsResourceWithStreamingResponse :
@@ -404,6 +327,3 @@ def __init__(self, contexts: AsyncContextsResource) -> None:
404327 self .update = async_to_streamed_response_wrapper (
405328 contexts .update ,
406329 )
407- self .delete = async_to_streamed_response_wrapper (
408- contexts .delete ,
409- )
0 commit comments