@@ -17,50 +17,6 @@ class FileUploadParams(TypedDict):
1717 filename : str
1818 content_type : NotRequired [str ]
1919
20-
21-
22-
23- config : RequestConfig
24-
25- def __init__ (
26- self ,
27- api_key : str ,
28- api_url : str ,
29- disable_request_logging : Union [bool , None ] = False ,
30- ):
31- super ().__init__ (api_key , api_url , disable_request_logging )
32- self .config = RequestConfig (
33- api_url = api_url ,
34- api_key = api_key ,
35- disable_request_logging = disable_request_logging ,
36- )
37-
38- def add (self , params : KVAddParams ) -> KVAddResponse :
39- path = "/store/kv"
40- resp = Request (
41- config = self .config ,
42- path = path ,
43- params = cast (Dict [Any , Any ], params ),
44- verb = "post" ,
45- ).perform_with_content ()
46- return resp
47-
48- def get (self , key : str ) -> KVGetResponse :
49- path = f"/store/kv/{ key } "
50- resp = Request (config = self .config , path = path , verb = "get" ).perform_with_content ()
51- return resp
52-
53- def delete (self , key : str ) -> KVGetResponse :
54- path = f"/store/kv/{ key } "
55- resp = Request (
56- config = self .config ,
57- path = path ,
58- params = cast (Dict [Any , Any ], params = {}),
59- verb = "delete" ,
60- ).perform_with_content ()
61- return resp
62-
63-
6420class Store (ClientConfig ):
6521
6622 config : RequestConfig
@@ -113,51 +69,7 @@ def delete(self, key: str) -> FileDeleteResponse:
11369 resp = Request (
11470 config = self .config ,
11571 path = path ,
116- params = cast (Dict [Any , Any ], params = {}),
117- verb = "delete" ,
118- ).perform_with_content ()
119- return resp
120-
121-
122-
123- config : AsyncRequestConfig
124-
125- def __init__ (
126- self ,
127- api_key : str ,
128- api_url : str ,
129- disable_request_logging : Union [bool , None ] = False ,
130- ):
131- super ().__init__ (api_key , api_url , disable_request_logging )
132- self .config = AsyncRequestConfig (
133- api_url = api_url ,
134- api_key = api_key ,
135- disable_request_logging = disable_request_logging ,
136- )
137-
138- async def add (self , params : KVAddParams ) -> KVAddResponse :
139- path = "/store/kv"
140- resp = await AsyncRequest (
141- config = self .config ,
142- path = path ,
143- params = cast (Dict [Any , Any ], params ),
144- verb = "post" ,
145- ).perform_with_content ()
146- return resp
147-
148- async def get (self , key : str ) -> KVGetResponse :
149- path = f"/store/kv/{ key } "
150- resp = await AsyncRequest (
151- config = self .config , path = path , verb = "get" , params = {}
152- ).perform_with_content ()
153- return resp
154-
155- async def delete (self , key : str ) -> KVGetResponse :
156- path = f"/store/kv/{ key } "
157- resp = await AsyncRequest (
158- config = self .config ,
159- path = path ,
160- params = cast (Dict [Any , Any ], params = {}),
72+ params = key ,
16173 verb = "delete" ,
16274 ).perform_with_content ()
16375 return resp
0 commit comments