forked from typesense/typesense-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcuration_sets.py
More file actions
34 lines (25 loc) · 967 Bytes
/
curation_sets.py
File metadata and controls
34 lines (25 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""Client for Curation Sets collection operations."""
import sys
if sys.version_info >= (3, 11):
import typing
else:
import typing_extensions as typing
from typesense.api_call import ApiCall
from typesense.curation_set import CurationSet
from typesense.types.curation_set import (
CurationSetsListResponseSchema,
)
class CurationSets:
resource_path: typing.Final[str] = "/curation_sets"
def __init__(self, api_call: ApiCall) -> None:
self.api_call = api_call
def retrieve(self) -> CurationSetsListResponseSchema:
response: CurationSetsListResponseSchema = self.api_call.get(
CurationSets.resource_path,
as_json=True,
entity_type=CurationSetsListResponseSchema,
)
return response
def __getitem__(self, curation_set_name: str) -> CurationSet:
from typesense.curation_set import CurationSet as PerSet
return PerSet(self.api_call, curation_set_name)