66
77import httpx
88
9- from ..types import (
10- batch_list_params ,
11- batch_cancel_params ,
12- batch_submit_params ,
13- batch_retrieve_params ,
14- batch_get_results_params ,
15- )
9+ from ..types import batch_list_params , batch_submit_params , batch_get_results_params
1610from .._types import Body , Omit , Query , Headers , NotGiven , SequenceNotStr , omit , not_given
1711from .._utils import path_template , maybe_transform , async_maybe_transform
1812from .._compat import cached_property
@@ -57,7 +51,6 @@ def retrieve(
5751 self ,
5852 batch_id : str ,
5953 * ,
60- tags : SequenceNotStr [str ] | Omit = omit ,
6154 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6255 # The extra values given here take precedence over values defined on the client or passed to this method.
6356 extra_headers : Headers | None = None ,
@@ -74,10 +67,6 @@ def retrieve(
7467 Args:
7568 batch_id: ID of the batch to retrieve or cancel.
7669
77- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
78- recorded on the request's usage log and can be used to filter usage on the
79- dashboard usage page. Up to 20 tags, each 1-50 characters.
80-
8170 extra_headers: Send extra headers
8271
8372 extra_query: Add additional query parameters to the request
@@ -91,11 +80,7 @@ def retrieve(
9180 return self ._get (
9281 path_template ("/batch/{batch_id}" , batch_id = batch_id ),
9382 options = make_request_options (
94- extra_headers = extra_headers ,
95- extra_query = extra_query ,
96- extra_body = extra_body ,
97- timeout = timeout ,
98- query = maybe_transform ({"tags" : tags }, batch_retrieve_params .BatchRetrieveParams ),
83+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
9984 ),
10085 cast_to = BatchRetrieveResponse ,
10186 )
@@ -105,8 +90,10 @@ def list(
10590 * ,
10691 cursor : str | Omit = omit ,
10792 limit : int | Omit = omit ,
93+ q : str | Omit = omit ,
94+ search_type : Literal ["exact" , "prefix" ] | Omit = omit ,
10895 status : Literal ["queued" , "running" , "cancelling" , "completed" , "cancelled" , "failed" ] | Omit = omit ,
109- tags : SequenceNotStr [ str ] | Omit = omit ,
96+ tags : str | Omit = omit ,
11097 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11198 # The extra values given here take precedence over values defined on the client or passed to this method.
11299 extra_headers : Headers | None = None ,
@@ -124,11 +111,15 @@ def list(
124111
125112 limit: Batches per page. Defaults to 25.
126113
114+ q: Free-text search term, matched against the batch id, crawl source (start URL or
115+ sitemap domain), and tags.
116+
117+ search_type: `prefix` for as-you-type prefix matching (default), `exact` for full-token
118+ matching.
119+
127120 status: Filter by status.
128121
129- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
130- recorded on the request's usage log and can be used to filter usage on the
131- dashboard usage page. Up to 20 tags, each 1-50 characters.
122+ tags: Comma-separated list of tags to filter by (matches batches having any of them).
132123
133124 extra_headers: Send extra headers
134125
@@ -149,6 +140,8 @@ def list(
149140 {
150141 "cursor" : cursor ,
151142 "limit" : limit ,
143+ "q" : q ,
144+ "search_type" : search_type ,
152145 "status" : status ,
153146 "tags" : tags ,
154147 },
@@ -162,7 +155,6 @@ def cancel(
162155 self ,
163156 batch_id : str ,
164157 * ,
165- tags : SequenceNotStr [str ] | Omit = omit ,
166158 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
167159 # The extra values given here take precedence over values defined on the client or passed to this method.
168160 extra_headers : Headers | None = None ,
@@ -178,10 +170,6 @@ def cancel(
178170 Args:
179171 batch_id: ID of the batch to retrieve or cancel.
180172
181- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
182- recorded on the request's usage log and can be used to filter usage on the
183- dashboard usage page. Up to 20 tags, each 1-50 characters.
184-
185173 extra_headers: Send extra headers
186174
187175 extra_query: Add additional query parameters to the request
@@ -195,11 +183,7 @@ def cancel(
195183 return self ._post (
196184 path_template ("/batch/{batch_id}/cancel" , batch_id = batch_id ),
197185 options = make_request_options (
198- extra_headers = extra_headers ,
199- extra_query = extra_query ,
200- extra_body = extra_body ,
201- timeout = timeout ,
202- query = maybe_transform ({"tags" : tags }, batch_cancel_params .BatchCancelParams ),
186+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
203187 ),
204188 cast_to = BatchCancelResponse ,
205189 )
@@ -210,7 +194,6 @@ def get_results(
210194 * ,
211195 cursor : str | Omit = omit ,
212196 limit : int | Omit = omit ,
213- tags : SequenceNotStr [str ] | Omit = omit ,
214197 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
215198 # The extra values given here take precedence over values defined on the client or passed to this method.
216199 extra_headers : Headers | None = None ,
@@ -231,10 +214,6 @@ def get_results(
231214 limit: Records per page. Defaults to 25. A page can close early so its payload stays
232215 under ~8 MB; rely on next_cursor rather than counting records.
233216
234- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
235- recorded on the request's usage log and can be used to filter usage on the
236- dashboard usage page. Up to 20 tags, each 1-50 characters.
237-
238217 extra_headers: Send extra headers
239218
240219 extra_query: Add additional query parameters to the request
@@ -256,7 +235,6 @@ def get_results(
256235 {
257236 "cursor" : cursor ,
258237 "limit" : limit ,
259- "tags" : tags ,
260238 },
261239 batch_get_results_params .BatchGetResultsParams ,
262240 ),
@@ -338,7 +316,6 @@ async def retrieve(
338316 self ,
339317 batch_id : str ,
340318 * ,
341- tags : SequenceNotStr [str ] | Omit = omit ,
342319 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
343320 # The extra values given here take precedence over values defined on the client or passed to this method.
344321 extra_headers : Headers | None = None ,
@@ -355,10 +332,6 @@ async def retrieve(
355332 Args:
356333 batch_id: ID of the batch to retrieve or cancel.
357334
358- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
359- recorded on the request's usage log and can be used to filter usage on the
360- dashboard usage page. Up to 20 tags, each 1-50 characters.
361-
362335 extra_headers: Send extra headers
363336
364337 extra_query: Add additional query parameters to the request
@@ -372,11 +345,7 @@ async def retrieve(
372345 return await self ._get (
373346 path_template ("/batch/{batch_id}" , batch_id = batch_id ),
374347 options = make_request_options (
375- extra_headers = extra_headers ,
376- extra_query = extra_query ,
377- extra_body = extra_body ,
378- timeout = timeout ,
379- query = await async_maybe_transform ({"tags" : tags }, batch_retrieve_params .BatchRetrieveParams ),
348+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
380349 ),
381350 cast_to = BatchRetrieveResponse ,
382351 )
@@ -386,8 +355,10 @@ async def list(
386355 * ,
387356 cursor : str | Omit = omit ,
388357 limit : int | Omit = omit ,
358+ q : str | Omit = omit ,
359+ search_type : Literal ["exact" , "prefix" ] | Omit = omit ,
389360 status : Literal ["queued" , "running" , "cancelling" , "completed" , "cancelled" , "failed" ] | Omit = omit ,
390- tags : SequenceNotStr [ str ] | Omit = omit ,
361+ tags : str | Omit = omit ,
391362 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
392363 # The extra values given here take precedence over values defined on the client or passed to this method.
393364 extra_headers : Headers | None = None ,
@@ -405,11 +376,15 @@ async def list(
405376
406377 limit: Batches per page. Defaults to 25.
407378
379+ q: Free-text search term, matched against the batch id, crawl source (start URL or
380+ sitemap domain), and tags.
381+
382+ search_type: `prefix` for as-you-type prefix matching (default), `exact` for full-token
383+ matching.
384+
408385 status: Filter by status.
409386
410- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
411- recorded on the request's usage log and can be used to filter usage on the
412- dashboard usage page. Up to 20 tags, each 1-50 characters.
387+ tags: Comma-separated list of tags to filter by (matches batches having any of them).
413388
414389 extra_headers: Send extra headers
415390
@@ -430,6 +405,8 @@ async def list(
430405 {
431406 "cursor" : cursor ,
432407 "limit" : limit ,
408+ "q" : q ,
409+ "search_type" : search_type ,
433410 "status" : status ,
434411 "tags" : tags ,
435412 },
@@ -443,7 +420,6 @@ async def cancel(
443420 self ,
444421 batch_id : str ,
445422 * ,
446- tags : SequenceNotStr [str ] | Omit = omit ,
447423 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
448424 # The extra values given here take precedence over values defined on the client or passed to this method.
449425 extra_headers : Headers | None = None ,
@@ -459,10 +435,6 @@ async def cancel(
459435 Args:
460436 batch_id: ID of the batch to retrieve or cancel.
461437
462- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
463- recorded on the request's usage log and can be used to filter usage on the
464- dashboard usage page. Up to 20 tags, each 1-50 characters.
465-
466438 extra_headers: Send extra headers
467439
468440 extra_query: Add additional query parameters to the request
@@ -476,11 +448,7 @@ async def cancel(
476448 return await self ._post (
477449 path_template ("/batch/{batch_id}/cancel" , batch_id = batch_id ),
478450 options = make_request_options (
479- extra_headers = extra_headers ,
480- extra_query = extra_query ,
481- extra_body = extra_body ,
482- timeout = timeout ,
483- query = await async_maybe_transform ({"tags" : tags }, batch_cancel_params .BatchCancelParams ),
451+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
484452 ),
485453 cast_to = BatchCancelResponse ,
486454 )
@@ -491,7 +459,6 @@ async def get_results(
491459 * ,
492460 cursor : str | Omit = omit ,
493461 limit : int | Omit = omit ,
494- tags : SequenceNotStr [str ] | Omit = omit ,
495462 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
496463 # The extra values given here take precedence over values defined on the client or passed to this method.
497464 extra_headers : Headers | None = None ,
@@ -512,10 +479,6 @@ async def get_results(
512479 limit: Records per page. Defaults to 25. A page can close early so its payload stays
513480 under ~8 MB; rely on next_cursor rather than counting records.
514481
515- tags: Optional comma-separated caller-defined tags for tracking this request. Tags are
516- recorded on the request's usage log and can be used to filter usage on the
517- dashboard usage page. Up to 20 tags, each 1-50 characters.
518-
519482 extra_headers: Send extra headers
520483
521484 extra_query: Add additional query parameters to the request
@@ -537,7 +500,6 @@ async def get_results(
537500 {
538501 "cursor" : cursor ,
539502 "limit" : limit ,
540- "tags" : tags ,
541503 },
542504 batch_get_results_params .BatchGetResultsParams ,
543505 ),
0 commit comments