diff --git a/crawlora/client.pyi b/crawlora/client.pyi index 92c5657..0cfb0f1 100644 --- a/crawlora/client.pyi +++ b/crawlora/client.pyi @@ -10895,6 +10895,21 @@ ModelBooksyTreatmentHintsResponse = TypedDict('ModelBooksyTreatmentHintsResponse 'treatment_count': NotRequired[int], }, total=False) +ModelBooksyTreatmentRecord = TypedDict('ModelBooksyTreatmentRecord', { + 'id': NotRequired[int], + 'name': NotRequired[str], + 'slug': NotRequired[str], +}, total=False) + +ModelBooksyTreatmentsResponse = TypedDict('ModelBooksyTreatmentsResponse', { + 'category': NotRequired[int], + 'count': NotRequired[int], + 'country': NotRequired[str], + 'limit': NotRequired[int], + 'treatments': NotRequired[list[ModelBooksyTreatmentRecord]], + 'truncated': NotRequired[bool], +}, total=False) + ModelBooksyBusinessResponseDoc = TypedDict('ModelBooksyBusinessResponseDoc', { 'code': NotRequired[int], 'data': NotRequired[ModelBooksyBusinessResponse], @@ -10931,6 +10946,12 @@ ModelBooksyTreatmentHintsResponseDoc = TypedDict('ModelBooksyTreatmentHintsRespo 'msg': NotRequired[str], }, total=False) +ModelBooksyTreatmentsResponseDoc = TypedDict('ModelBooksyTreatmentsResponseDoc', { + 'code': NotRequired[int], + 'data': NotRequired[ModelBooksyTreatmentsResponse], + 'msg': NotRequired[str], +}, total=False) + ModelBootsFacet = TypedDict('ModelBootsFacet', { 'key': NotRequired[str], 'maximum': NotRequired[float], @@ -118300,6 +118321,16 @@ BooksyTreatmentHintsParams = TypedDict('BooksyTreatmentHintsParams', { 'country': NotRequired[Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']], }, total=False) +BooksyTreatmentsResponse = ModelBooksyTreatmentsResponseDoc +BooksyTreatmentsParams = TypedDict('BooksyTreatmentsParams', { + '_response_type': NotRequired[ResponseType], + '_timeout': NotRequired[float], + '_headers': NotRequired[Mapping[str, str]], + 'category': NotRequired[int], + 'limit': NotRequired[int], + 'country': NotRequired[Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']], +}, total=False) + BootsSearchResponse = ModelBootsSearchResponseDoc BootsSearchParams = TypedDict('BootsSearchParams', { '_response_type': NotRequired[ResponseType], @@ -168645,6 +168676,7 @@ class BooksyGroup: def businesses(self, **params: Unpack[BooksyBusinessesParams]) -> BooksyBusinessesResponse: ... def categories(self, **params: Unpack[BooksyCategoriesParams]) -> BooksyCategoriesResponse: ... def treatment_hints(self, **params: Unpack[BooksyTreatmentHintsParams]) -> BooksyTreatmentHintsResponse: ... + def treatments(self, **params: Unpack[BooksyTreatmentsParams]) -> BooksyTreatmentsResponse: ... class BootsGroup: def search(self, **params: Unpack[BootsSearchParams]) -> BootsSearchResponse: ... @@ -175287,6 +175319,7 @@ OperationId = Literal[ 'booksy-businesses', 'booksy-categories', 'booksy-treatment-hints', + 'booksy-treatments', 'boots-search', 'boots-suggest', 'bostonglobe-news', @@ -186294,6 +186327,18 @@ class CrawloraClient: retry_predicate: Callable[[int, BaseException | None], bool] | None = ..., ) -> BooksyTreatmentHintsResponse: ... @overload + def operation( + self, + operation_id: Literal['booksy-treatments'], + params: BooksyTreatmentsParams = ..., + *, + response_type: ResponseType = ..., + timeout: float | None = ..., + headers: Mapping[str, str] | None = ..., + retries: int | None = ..., + retry_predicate: Callable[[int, BaseException | None], bool] | None = ..., + ) -> BooksyTreatmentsResponse: ... + @overload def operation( self, operation_id: Literal['boots-search'], @@ -253386,6 +253431,18 @@ class CrawloraClient: retry_predicate: Callable[[int, BaseException | None], bool] | None = ..., ) -> BooksyTreatmentHintsResponse: ... @overload + def request( + self, + operation_id: Literal['booksy-treatments'], + params: BooksyTreatmentsParams = ..., + *, + response_type: ResponseType = ..., + timeout: float | None = ..., + headers: Mapping[str, str] | None = ..., + retries: int | None = ..., + retry_predicate: Callable[[int, BaseException | None], bool] | None = ..., + ) -> BooksyTreatmentsResponse: ... + @overload def request( self, operation_id: Literal['boots-search'], diff --git a/crawlora/operations.py b/crawlora/operations.py index 774d3f2..c5fd404 100644 --- a/crawlora/operations.py +++ b/crawlora/operations.py @@ -7331,6 +7331,39 @@ 'name': 'country', 'type': 'string'}], 'security': ['ApiKeyAuth']}, + 'booksy-treatments': {'bodyParam': None, + 'bodyRequired': False, + 'consumes': ['application/json'], + 'formParams': [], + 'id': 'booksy-treatments', + 'method': 'GET', + 'path': '/booksy/treatments', + 'pathParams': [], + 'produces': ['application/json'], + 'queryParams': [{'in': 'query', 'name': 'category', 'type': 'integer'}, + {'in': 'query', 'name': 'limit', 'type': 'integer'}, + {'enum': ['ar', + 'au', + 'br', + 'ca', + 'cl', + 'co', + 'de', + 'es', + 'fr', + 'gb', + 'ie', + 'it', + 'mx', + 'nl', + 'pl', + 'pt', + 'us', + 'za'], + 'in': 'query', + 'name': 'country', + 'type': 'string'}], + 'security': ['ApiKeyAuth']}, 'boots-search': {'bodyParam': None, 'bodyRequired': False, 'consumes': [], @@ -105226,7 +105259,8 @@ 'business_reviews': 'booksy-business-reviews', 'businesses': 'booksy-businesses', 'categories': 'booksy-categories', - 'treatment_hints': 'booksy-treatment-hints'}, + 'treatment_hints': 'booksy-treatment-hints', + 'treatments': 'booksy-treatments'}, 'boots': {'search': 'boots-search', 'suggest': 'boots-suggest'}, 'boston_globe': {'bostonglobe_news': 'bostonglobe-news'}, 'box_office_mojo': {'boxofficemojo_brand': 'boxofficemojo-brand', @@ -110342,7 +110376,7 @@ 'restaurant_menu': 'zomato-restaurant-menu', 'search': 'zomato-search'}} -OPERATION_COUNT = 5590 +OPERATION_COUNT = 5591 class OperationId: ABC_NEWS_ABCNEWS_ARTICLE = 'abcnews-article' @@ -110755,6 +110789,7 @@ class OperationId: BOOKSY_BUSINESSES = 'booksy-businesses' BOOKSY_CATEGORIES = 'booksy-categories' BOOKSY_TREATMENT_HINTS = 'booksy-treatment-hints' + BOOKSY_TREATMENTS = 'booksy-treatments' BOOTS_SEARCH = 'boots-search' BOOTS_SUGGEST = 'boots-suggest' BOSTON_GLOBE_BOSTONGLOBE_NEWS = 'bostonglobe-news' diff --git a/docs/operations.md b/docs/operations.md index 6126a2a..1dc48b9 100644 --- a/docs/operations.md +++ b/docs/operations.md @@ -2,7 +2,7 @@ Generated from `openapi/public.json`. Deprecated, admin, and internal operations are excluded from this SDK contract. -Total operations: `5590` +Total operations: `5591` | Group | SDK method | Operation ID | HTTP | Params | Auth | Response | Notes | | --- | --- | --- | --- | --- | --- | --- | --- | @@ -438,6 +438,7 @@ Total operations: `5590` | booksy | `booksy.businesses` | `booksy-businesses` | `GET /booksy/businesses` | `country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za'])
`page` (query int)
`page_size` (query int)
`category` (query int)
`treatment` (query int)
`query` (query str)
`location_id` (query int)
`location_name` (query str)
`sort_order` (query Literal['distance', 'score', 'top_rated', 'by_ids'])
`gender` (query Literal['M', 'F', 'R'])
`open_now` (query bool)
`has_special_offers` (query bool)
`has_online_services` (query bool)
`accept_booksy_pay` (query bool)
`accept_booksy_gift_cards` (query bool)
`has_traveling_services` (query bool)
`business_ids` (query str) | `ApiKeyAuth` | `BooksyBusinessesResponse` | | | booksy | `booksy.categories` | `booksy-categories` | `GET /booksy/categories` | `country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']) | `ApiKeyAuth` | `BooksyCategoriesResponse` | | | booksy | `booksy.treatment_hints` | `booksy-treatment-hints` | `GET /booksy/treatment-hints` | `query` (query str required)
`country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']) | `ApiKeyAuth` | `BooksyTreatmentHintsResponse` | | +| booksy | `booksy.treatments` | `booksy-treatments` | `GET /booksy/treatments` | `category` (query int)
`limit` (query int)
`country` (query Literal['ar', 'au', 'br', 'ca', 'cl', 'co', 'de', 'es', 'fr', 'gb', 'ie', 'it', 'mx', 'nl', 'pl', 'pt', 'us', 'za']) | `ApiKeyAuth` | `BooksyTreatmentsResponse` | | | boots | `boots.search` | `boots-search` | `GET /boots/search` | `q` (query str)
`category` (query list[str])
`filter` (query list[str])
`price_min` (query float)
`price_max` (query float)
`in_stock` (query bool)
`page` (query int)
`page_size` (query int)
`sort` (query Literal['relevance', 'price_low_to_high', 'price_high_to_low', 'top_rated', 'best_seller', 'newest']) | `ApiKeyAuth` | `BootsSearchResponse` | | | boots | `boots.suggest` | `boots-suggest` | `GET /boots/suggest` | `q` (query str required) | `ApiKeyAuth` | `BootsSuggestResponse` | | | boston_globe | `boston_globe.bostonglobe_news` | `bostonglobe-news` | `GET /bostonglobe/news` | none | `ApiKeyAuth` | `BostonGlobeBostonglobeNewsResponse` | | diff --git a/openapi/public.json b/openapi/public.json index 95396c0..62fc29b 100644 --- a/openapi/public.json +++ b/openapi/public.json @@ -34726,6 +34726,58 @@ }, "type": "object" }, + "booksy.TreatmentRecord": { + "properties": { + "id": { + "example": 363, + "type": "integer" + }, + "name": { + "example": "Male Haircut", + "type": "string" + }, + "slug": { + "example": "male-haircut", + "type": "string" + } + }, + "type": "object" + }, + "booksy.TreatmentsResponse": { + "properties": { + "category": { + "description": "Category is the requested category id, absent on the unscoped list.", + "type": "integer" + }, + "count": { + "description": "Count is how many treatments this response carries.", + "example": 18, + "type": "integer" + }, + "country": { + "example": "us", + "type": "string" + }, + "limit": { + "description": "Limit is the effective limit sent upstream.", + "example": 40, + "type": "integer" + }, + "treatments": { + "description": "Treatments in the upstream's own ranking order.", + "items": { + "$ref": "#/definitions/booksy.TreatmentRecord" + }, + "type": "array" + }, + "truncated": { + "description": "Truncated is true when the upstream returned exactly the requested limit,\nwhich is the only \"there may be more\" signal this route offers: it has no\npage, offset or cursor parameter. A category with a smaller set than the\nlimit cannot be truncated.", + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, "booksy.businessResponseDoc": { "properties": { "code": { @@ -34822,6 +34874,22 @@ }, "type": "object" }, + "booksy.treatmentsResponseDoc": { + "properties": { + "code": { + "example": 200, + "type": "integer" + }, + "data": { + "$ref": "#/definitions/booksy.TreatmentsResponse" + }, + "msg": { + "example": "OK", + "type": "string" + } + }, + "type": "object" + }, "boots.Facet": { "properties": { "key": { @@ -394567,6 +394635,96 @@ ] } }, + "/booksy/treatments": { + "get": { + "consumes": [ + "application/json" + ], + "description": "Returns the treatment ids Booksy's (booksy.com) Android app lists for one top-level category, in the upstream's own ranking order, with each treatment's integer id, name and slug. This is the category-scoped discovery step for the treatment parameter of booksy-businesses: combine the category with one of these treatments to filter a listing, and category 6 with treatment 363 returns the Male Haircut subset of the Barber marketplace. Pass a category id from booksy-categories; omit it for the upstream's unscoped popular list, which mixes categories. limit is 1 to 40, the upstream's own cap. The route has no page, offset or cursor parameter, so a category that publishes more treatments than the limit cannot be read past it: truncated=true means the upstream returned exactly the limit, which is the only signal that more may exist (Hair and Health and fitness both sit at 40). A category with no treatments or an unknown category id answers an honest empty list, not an error. For query-driven discovery by free text use booksy-treatment-hints instead.", + "operationId": "booksy-treatments", + "parameters": [ + { + "description": "Top-level category id from booksy-categories (integer, not a slug)", + "in": "query", + "name": "category", + "type": "integer", + "x-example": 6 + }, + { + "description": "Treatments to return, 1 to 40; defaults to 40, the upstream cap", + "in": "query", + "name": "limit", + "type": "integer", + "x-example": 40 + }, + { + "description": "Market host", + "enum": [ + "ar", + "au", + "br", + "ca", + "cl", + "co", + "de", + "es", + "fr", + "gb", + "ie", + "it", + "mx", + "nl", + "pl", + "pt", + "us", + "za" + ], + "in": "query", + "name": "country", + "type": "string", + "x-example": "us" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/booksy.treatmentsResponseDoc" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/app.Response" + } + }, + "429": { + "description": "Too Many Requests", + "schema": { + "$ref": "#/definitions/app.Response" + } + }, + "503": { + "description": "Service Unavailable", + "schema": { + "$ref": "#/definitions/app.Response" + } + } + }, + "security": [ + { + "ApiKeyAuth": [] + } + ], + "summary": "Discover Booksy treatment ids for one category", + "tags": [ + "Booksy" + ] + } + }, "/boots/search": { "get": { "description": "Returns one page of Boots UK's public product catalog, including product cards and live facets. Supply `q`, one or more hierarchical `category` keys, or both. Use repeatable `filter=facet_key:option_key` values from that response's dynamic facets, plus the dedicated price and stock controls. `sort` accepts `relevance`, `price_low_to_high`, `price_high_to_low`, `top_rated`, `best_seller`, or `newest`.", diff --git a/tests/test_client.py b/tests/test_client.py index 3029cff..2281565 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -268,7 +268,7 @@ def transport(_request, _timeout): def test_operation_metadata_count(self) -> None: self.assertEqual(len(OPERATIONS), OPERATION_COUNT) - self.assertEqual(OPERATION_COUNT, 5590) + self.assertEqual(OPERATION_COUNT, 5591) def test_deprecated_endpoints_are_not_generated(self) -> None: self.assertFalse(hasattr(CrawloraClient(api_key="api_test", base_url=self.base_url).google, "lens")) @@ -301,7 +301,7 @@ def test_docs_cover_operations_and_recipes(self): recipes_doc = root.joinpath("docs", "recipes.md").read_text() for expected in [ - "Total operations: `5590`", + "Total operations: `5591`", "`bing-search`", "`GET /bing/search`", "`bing.search`",