1515 async_to_streamed_response_wrapper ,
1616)
1717from ..._base_client import make_request_options
18- from ...types .agents import api_key_list_params , api_key_create_params
18+ from ...types .agents import api_key_list_params , api_key_create_params , api_key_update_params
1919from ...types .agents .api_key_list_response import APIKeyListResponse
2020from ...types .agents .api_key_create_response import APIKeyCreateResponse
21+ from ...types .agents .api_key_delete_response import APIKeyDeleteResponse
22+ from ...types .agents .api_key_update_response import APIKeyUpdateResponse
2123
2224__all__ = ["APIKeysResource" , "AsyncAPIKeysResource" ]
2325
@@ -85,6 +87,54 @@ def create(
8587 cast_to = APIKeyCreateResponse ,
8688 )
8789
90+ def update (
91+ self ,
92+ path_api_key_uuid : str ,
93+ * ,
94+ path_agent_uuid : str ,
95+ body_agent_uuid : str | NotGiven = NOT_GIVEN ,
96+ body_api_key_uuid : str | NotGiven = NOT_GIVEN ,
97+ name : str | NotGiven = NOT_GIVEN ,
98+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
99+ # The extra values given here take precedence over values defined on the client or passed to this method.
100+ extra_headers : Headers | None = None ,
101+ extra_query : Query | None = None ,
102+ extra_body : Body | None = None ,
103+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
104+ ) -> APIKeyUpdateResponse :
105+ """
106+ To update an agent API key, send a PUT request to
107+ `/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}`.
108+
109+ Args:
110+ extra_headers: Send extra headers
111+
112+ extra_query: Add additional query parameters to the request
113+
114+ extra_body: Add additional JSON properties to the request
115+
116+ timeout: Override the client-level default timeout for this request, in seconds
117+ """
118+ if not path_agent_uuid :
119+ raise ValueError (f"Expected a non-empty value for `path_agent_uuid` but received { path_agent_uuid !r} " )
120+ if not path_api_key_uuid :
121+ raise ValueError (f"Expected a non-empty value for `path_api_key_uuid` but received { path_api_key_uuid !r} " )
122+ return self ._put (
123+ f"/v2/gen-ai/agents/{ path_agent_uuid } /api_keys/{ path_api_key_uuid } " ,
124+ body = maybe_transform (
125+ {
126+ "body_agent_uuid" : body_agent_uuid ,
127+ "body_api_key_uuid" : body_api_key_uuid ,
128+ "name" : name ,
129+ },
130+ api_key_update_params .APIKeyUpdateParams ,
131+ ),
132+ options = make_request_options (
133+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
134+ ),
135+ cast_to = APIKeyUpdateResponse ,
136+ )
137+
88138 def list (
89139 self ,
90140 agent_uuid : str ,
@@ -135,6 +185,43 @@ def list(
135185 cast_to = APIKeyListResponse ,
136186 )
137187
188+ def delete (
189+ self ,
190+ api_key_uuid : str ,
191+ * ,
192+ agent_uuid : str ,
193+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194+ # The extra values given here take precedence over values defined on the client or passed to this method.
195+ extra_headers : Headers | None = None ,
196+ extra_query : Query | None = None ,
197+ extra_body : Body | None = None ,
198+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
199+ ) -> APIKeyDeleteResponse :
200+ """
201+ To delete an API key for an agent, send a DELETE request to
202+ `/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}`.
203+
204+ Args:
205+ extra_headers: Send extra headers
206+
207+ extra_query: Add additional query parameters to the request
208+
209+ extra_body: Add additional JSON properties to the request
210+
211+ timeout: Override the client-level default timeout for this request, in seconds
212+ """
213+ if not agent_uuid :
214+ raise ValueError (f"Expected a non-empty value for `agent_uuid` but received { agent_uuid !r} " )
215+ if not api_key_uuid :
216+ raise ValueError (f"Expected a non-empty value for `api_key_uuid` but received { api_key_uuid !r} " )
217+ return self ._delete (
218+ f"/v2/gen-ai/agents/{ agent_uuid } /api_keys/{ api_key_uuid } " ,
219+ options = make_request_options (
220+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
221+ ),
222+ cast_to = APIKeyDeleteResponse ,
223+ )
224+
138225
139226class AsyncAPIKeysResource (AsyncAPIResource ):
140227 @cached_property
@@ -199,6 +286,54 @@ async def create(
199286 cast_to = APIKeyCreateResponse ,
200287 )
201288
289+ async def update (
290+ self ,
291+ path_api_key_uuid : str ,
292+ * ,
293+ path_agent_uuid : str ,
294+ body_agent_uuid : str | NotGiven = NOT_GIVEN ,
295+ body_api_key_uuid : str | NotGiven = NOT_GIVEN ,
296+ name : str | NotGiven = NOT_GIVEN ,
297+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
298+ # The extra values given here take precedence over values defined on the client or passed to this method.
299+ extra_headers : Headers | None = None ,
300+ extra_query : Query | None = None ,
301+ extra_body : Body | None = None ,
302+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
303+ ) -> APIKeyUpdateResponse :
304+ """
305+ To update an agent API key, send a PUT request to
306+ `/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}`.
307+
308+ Args:
309+ extra_headers: Send extra headers
310+
311+ extra_query: Add additional query parameters to the request
312+
313+ extra_body: Add additional JSON properties to the request
314+
315+ timeout: Override the client-level default timeout for this request, in seconds
316+ """
317+ if not path_agent_uuid :
318+ raise ValueError (f"Expected a non-empty value for `path_agent_uuid` but received { path_agent_uuid !r} " )
319+ if not path_api_key_uuid :
320+ raise ValueError (f"Expected a non-empty value for `path_api_key_uuid` but received { path_api_key_uuid !r} " )
321+ return await self ._put (
322+ f"/v2/gen-ai/agents/{ path_agent_uuid } /api_keys/{ path_api_key_uuid } " ,
323+ body = await async_maybe_transform (
324+ {
325+ "body_agent_uuid" : body_agent_uuid ,
326+ "body_api_key_uuid" : body_api_key_uuid ,
327+ "name" : name ,
328+ },
329+ api_key_update_params .APIKeyUpdateParams ,
330+ ),
331+ options = make_request_options (
332+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
333+ ),
334+ cast_to = APIKeyUpdateResponse ,
335+ )
336+
202337 async def list (
203338 self ,
204339 agent_uuid : str ,
@@ -249,6 +384,43 @@ async def list(
249384 cast_to = APIKeyListResponse ,
250385 )
251386
387+ async def delete (
388+ self ,
389+ api_key_uuid : str ,
390+ * ,
391+ agent_uuid : str ,
392+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
393+ # The extra values given here take precedence over values defined on the client or passed to this method.
394+ extra_headers : Headers | None = None ,
395+ extra_query : Query | None = None ,
396+ extra_body : Body | None = None ,
397+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
398+ ) -> APIKeyDeleteResponse :
399+ """
400+ To delete an API key for an agent, send a DELETE request to
401+ `/v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}`.
402+
403+ Args:
404+ extra_headers: Send extra headers
405+
406+ extra_query: Add additional query parameters to the request
407+
408+ extra_body: Add additional JSON properties to the request
409+
410+ timeout: Override the client-level default timeout for this request, in seconds
411+ """
412+ if not agent_uuid :
413+ raise ValueError (f"Expected a non-empty value for `agent_uuid` but received { agent_uuid !r} " )
414+ if not api_key_uuid :
415+ raise ValueError (f"Expected a non-empty value for `api_key_uuid` but received { api_key_uuid !r} " )
416+ return await self ._delete (
417+ f"/v2/gen-ai/agents/{ agent_uuid } /api_keys/{ api_key_uuid } " ,
418+ options = make_request_options (
419+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
420+ ),
421+ cast_to = APIKeyDeleteResponse ,
422+ )
423+
252424
253425class APIKeysResourceWithRawResponse :
254426 def __init__ (self , api_keys : APIKeysResource ) -> None :
@@ -257,9 +429,15 @@ def __init__(self, api_keys: APIKeysResource) -> None:
257429 self .create = to_raw_response_wrapper (
258430 api_keys .create ,
259431 )
432+ self .update = to_raw_response_wrapper (
433+ api_keys .update ,
434+ )
260435 self .list = to_raw_response_wrapper (
261436 api_keys .list ,
262437 )
438+ self .delete = to_raw_response_wrapper (
439+ api_keys .delete ,
440+ )
263441
264442
265443class AsyncAPIKeysResourceWithRawResponse :
@@ -269,9 +447,15 @@ def __init__(self, api_keys: AsyncAPIKeysResource) -> None:
269447 self .create = async_to_raw_response_wrapper (
270448 api_keys .create ,
271449 )
450+ self .update = async_to_raw_response_wrapper (
451+ api_keys .update ,
452+ )
272453 self .list = async_to_raw_response_wrapper (
273454 api_keys .list ,
274455 )
456+ self .delete = async_to_raw_response_wrapper (
457+ api_keys .delete ,
458+ )
275459
276460
277461class APIKeysResourceWithStreamingResponse :
@@ -281,9 +465,15 @@ def __init__(self, api_keys: APIKeysResource) -> None:
281465 self .create = to_streamed_response_wrapper (
282466 api_keys .create ,
283467 )
468+ self .update = to_streamed_response_wrapper (
469+ api_keys .update ,
470+ )
284471 self .list = to_streamed_response_wrapper (
285472 api_keys .list ,
286473 )
474+ self .delete = to_streamed_response_wrapper (
475+ api_keys .delete ,
476+ )
287477
288478
289479class AsyncAPIKeysResourceWithStreamingResponse :
@@ -293,6 +483,12 @@ def __init__(self, api_keys: AsyncAPIKeysResource) -> None:
293483 self .create = async_to_streamed_response_wrapper (
294484 api_keys .create ,
295485 )
486+ self .update = async_to_streamed_response_wrapper (
487+ api_keys .update ,
488+ )
296489 self .list = async_to_streamed_response_wrapper (
297490 api_keys .list ,
298491 )
492+ self .delete = async_to_streamed_response_wrapper (
493+ api_keys .delete ,
494+ )
0 commit comments