@@ -126,6 +126,43 @@ def list(
126126 model = AnalysisSummary ,
127127 )
128128
129+ def cancel (
130+ self ,
131+ id : str ,
132+ * ,
133+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
134+ # The extra values given here take precedence over values defined on the client or passed to this method.
135+ extra_headers : Headers | None = None ,
136+ extra_query : Query | None = None ,
137+ extra_body : Body | None = None ,
138+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
139+ ) -> ConfigRegistryResponse :
140+ """Requests cancellation of a running project-scoped analysis.
141+
142+ Cancellation is
143+ asynchronous; poll the analysis until its status becomes canceled. Repeating the
144+ request after the analysis reaches a terminal state returns the existing
145+ outcome.
146+
147+ Args:
148+ extra_headers: Send extra headers
149+
150+ extra_query: Add additional query parameters to the request
151+
152+ extra_body: Add additional JSON properties to the request
153+
154+ timeout: Override the client-level default timeout for this request, in seconds
155+ """
156+ if not id :
157+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
158+ return self ._post (
159+ path_template ("/config-registry/analyses/{id}/cancel" , id = id ),
160+ options = make_request_options (
161+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
162+ ),
163+ cast_to = ConfigRegistryResponse ,
164+ )
165+
129166
130167class AsyncAnalysesResource (AsyncAPIResource ):
131168 """Resolve browser and proxy recommendations for bot-protected sites."""
@@ -230,6 +267,43 @@ def list(
230267 model = AnalysisSummary ,
231268 )
232269
270+ async def cancel (
271+ self ,
272+ id : str ,
273+ * ,
274+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
275+ # The extra values given here take precedence over values defined on the client or passed to this method.
276+ extra_headers : Headers | None = None ,
277+ extra_query : Query | None = None ,
278+ extra_body : Body | None = None ,
279+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
280+ ) -> ConfigRegistryResponse :
281+ """Requests cancellation of a running project-scoped analysis.
282+
283+ Cancellation is
284+ asynchronous; poll the analysis until its status becomes canceled. Repeating the
285+ request after the analysis reaches a terminal state returns the existing
286+ outcome.
287+
288+ Args:
289+ extra_headers: Send extra headers
290+
291+ extra_query: Add additional query parameters to the request
292+
293+ extra_body: Add additional JSON properties to the request
294+
295+ timeout: Override the client-level default timeout for this request, in seconds
296+ """
297+ if not id :
298+ raise ValueError (f"Expected a non-empty value for `id` but received { id !r} " )
299+ return await self ._post (
300+ path_template ("/config-registry/analyses/{id}/cancel" , id = id ),
301+ options = make_request_options (
302+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
303+ ),
304+ cast_to = ConfigRegistryResponse ,
305+ )
306+
233307
234308class AnalysesResourceWithRawResponse :
235309 def __init__ (self , analyses : AnalysesResource ) -> None :
@@ -241,6 +315,9 @@ def __init__(self, analyses: AnalysesResource) -> None:
241315 self .list = to_raw_response_wrapper (
242316 analyses .list ,
243317 )
318+ self .cancel = to_raw_response_wrapper (
319+ analyses .cancel ,
320+ )
244321
245322
246323class AsyncAnalysesResourceWithRawResponse :
@@ -253,6 +330,9 @@ def __init__(self, analyses: AsyncAnalysesResource) -> None:
253330 self .list = async_to_raw_response_wrapper (
254331 analyses .list ,
255332 )
333+ self .cancel = async_to_raw_response_wrapper (
334+ analyses .cancel ,
335+ )
256336
257337
258338class AnalysesResourceWithStreamingResponse :
@@ -265,6 +345,9 @@ def __init__(self, analyses: AnalysesResource) -> None:
265345 self .list = to_streamed_response_wrapper (
266346 analyses .list ,
267347 )
348+ self .cancel = to_streamed_response_wrapper (
349+ analyses .cancel ,
350+ )
268351
269352
270353class AsyncAnalysesResourceWithStreamingResponse :
@@ -277,3 +360,6 @@ def __init__(self, analyses: AsyncAnalysesResource) -> None:
277360 self .list = async_to_streamed_response_wrapper (
278361 analyses .list ,
279362 )
363+ self .cancel = async_to_streamed_response_wrapper (
364+ analyses .cancel ,
365+ )
0 commit comments