1919from ..._wrappers import ResultWrapper
2020from ...pagination import SyncV4PagePaginationArray , AsyncV4PagePaginationArray
2121from ..._base_client import AsyncPaginator , make_request_options
22- from ...types .aisearch import token_list_params , token_create_params
22+ from ...types .aisearch import token_list_params , token_create_params , token_update_params
2323from ...types .aisearch .token_list_response import TokenListResponse
2424from ...types .aisearch .token_read_response import TokenReadResponse
2525from ...types .aisearch .token_create_response import TokenCreateResponse
@@ -102,6 +102,9 @@ def update(
102102 id : str ,
103103 * ,
104104 account_id : str ,
105+ cf_api_id : str ,
106+ cf_api_key : str ,
107+ name : str ,
105108 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
106109 # The extra values given here take precedence over values defined on the client or passed to this method.
107110 extra_headers : Headers | None = None ,
@@ -110,7 +113,7 @@ def update(
110113 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
111114 ) -> TokenUpdateResponse :
112115 """
113- Delete tokens.
116+ Update tokens.
114117
115118 Args:
116119 extra_headers: Send extra headers
@@ -125,8 +128,16 @@ def update(
125128 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
126129 if not id :
127130 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
128- return self ._delete (
131+ return self ._put (
129132 f"/accounts/{ account_id } /ai-search/tokens/{ id } " ,
133+ body = maybe_transform (
134+ {
135+ "cf_api_id" : cf_api_id ,
136+ "cf_api_key" : cf_api_key ,
137+ "name" : name ,
138+ },
139+ token_update_params .TokenUpdateParams ,
140+ ),
130141 options = make_request_options (
131142 extra_headers = extra_headers ,
132143 extra_query = extra_query ,
@@ -236,7 +247,7 @@ def read(
236247 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
237248 ) -> TokenReadResponse :
238249 """
239- Delete tokens.
250+ Read tokens.
240251
241252 Args:
242253 extra_headers: Send extra headers
@@ -251,7 +262,7 @@ def read(
251262 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
252263 if not id :
253264 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
254- return self ._delete (
265+ return self ._get (
255266 f"/accounts/{ account_id } /ai-search/tokens/{ id } " ,
256267 options = make_request_options (
257268 extra_headers = extra_headers ,
@@ -337,6 +348,9 @@ async def update(
337348 id : str ,
338349 * ,
339350 account_id : str ,
351+ cf_api_id : str ,
352+ cf_api_key : str ,
353+ name : str ,
340354 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
341355 # The extra values given here take precedence over values defined on the client or passed to this method.
342356 extra_headers : Headers | None = None ,
@@ -345,7 +359,7 @@ async def update(
345359 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
346360 ) -> TokenUpdateResponse :
347361 """
348- Delete tokens.
362+ Update tokens.
349363
350364 Args:
351365 extra_headers: Send extra headers
@@ -360,8 +374,16 @@ async def update(
360374 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
361375 if not id :
362376 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
363- return await self ._delete (
377+ return await self ._put (
364378 f"/accounts/{ account_id } /ai-search/tokens/{ id } " ,
379+ body = await async_maybe_transform (
380+ {
381+ "cf_api_id" : cf_api_id ,
382+ "cf_api_key" : cf_api_key ,
383+ "name" : name ,
384+ },
385+ token_update_params .TokenUpdateParams ,
386+ ),
365387 options = make_request_options (
366388 extra_headers = extra_headers ,
367389 extra_query = extra_query ,
@@ -471,7 +493,7 @@ async def read(
471493 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
472494 ) -> TokenReadResponse :
473495 """
474- Delete tokens.
496+ Read tokens.
475497
476498 Args:
477499 extra_headers: Send extra headers
@@ -486,7 +508,7 @@ async def read(
486508 raise ValueError (f"Expected a non-empty value for `account_id` but received { account_id !r} " )
487509 if not id :
488510 raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
489- return await self ._delete (
511+ return await self ._get (
490512 f"/accounts/{ account_id } /ai-search/tokens/{ id } " ,
491513 options = make_request_options (
492514 extra_headers = extra_headers ,
0 commit comments