9
9
from starlette .requests import Request
10
10
11
11
from stac_fastapi .api .models import BaseSearchPostRequest
12
- from stac_fastapi .types .core import AsyncBaseCoreClient
12
+ from stac_fastapi .types .core import BaseCoreClient
13
13
from stac_fastapi .types .errors import NotFoundError
14
14
from stac_fastapi .types .rfc3339 import DateTimeType
15
15
from stac_fastapi .types .stac import BBox , Collection , Collections , Item , ItemCollection
16
16
17
17
18
- class Client (AsyncBaseCoreClient ): # type: ignore
18
+ class Client (BaseCoreClient ): # type: ignore
19
19
"""A stac-fastapi-geoparquet client."""
20
20
21
- async def all_collections (self , * , request : Request , ** kwargs : Any ) -> Collections :
21
+ def all_collections (self , * , request : Request , ** kwargs : Any ) -> Collections :
22
22
collections = cast (dict [str , dict [str , Any ]], request .state .collections )
23
23
return Collections (
24
24
collections = [
@@ -38,7 +38,7 @@ async def all_collections(self, *, request: Request, **kwargs: Any) -> Collectio
38
38
],
39
39
)
40
40
41
- async def get_collection (
41
+ def get_collection (
42
42
self , * , request : Request , collection_id : str , ** kwargs : Any
43
43
) -> Collection :
44
44
collections = cast (dict [str , dict [str , Any ]], request .state .collections )
@@ -47,10 +47,10 @@ async def get_collection(
47
47
else :
48
48
raise NotFoundError (f"Collection does not exist: { collection_id } " )
49
49
50
- async def get_item (
50
+ def get_item (
51
51
self , * , request : Request , item_id : str , collection_id : str , ** kwargs : Any
52
52
) -> Item :
53
- item_collection = await self .get_search (
53
+ item_collection = self .get_search (
54
54
request = request ,
55
55
ids = [item_id ],
56
56
collections = [collection_id ],
@@ -63,7 +63,7 @@ async def get_item(
63
63
f"Item does not exist: { item_id } in collection { collection_id } "
64
64
)
65
65
66
- async def get_search (
66
+ def get_search (
67
67
self ,
68
68
* ,
69
69
request : Request ,
@@ -110,15 +110,15 @@ async def get_search(
110
110
except ValidationError as e :
111
111
raise HTTPException (400 , f"invalid request: { e } " )
112
112
113
- return await self .search (
113
+ return self .search (
114
114
request = request ,
115
115
search = search ,
116
116
offset = offset ,
117
117
url = str (request .url_for ("Search" )),
118
118
** kwargs ,
119
119
)
120
120
121
- async def item_collection (
121
+ def item_collection (
122
122
self ,
123
123
* ,
124
124
request : Request ,
@@ -136,24 +136,24 @@ async def item_collection(
136
136
limit = limit ,
137
137
offset = offset ,
138
138
)
139
- return await self .search (
139
+ return self .search (
140
140
request = request ,
141
141
search = search ,
142
142
url = str (request .url_for ("Get ItemCollection" , collection_id = collection_id )),
143
143
** kwargs ,
144
144
)
145
145
146
- async def post_search (
146
+ def post_search (
147
147
self , search_request : BaseSearchPostRequest , * , request : Request , ** kwargs : Any
148
148
) -> ItemCollection :
149
- return await self .search (
149
+ return self .search (
150
150
search = search_request ,
151
151
request = request ,
152
152
url = str (request .url_for ("Search" )),
153
153
** kwargs ,
154
154
)
155
155
156
- async def search (
156
+ def search (
157
157
self ,
158
158
* ,
159
159
request : Request ,
0 commit comments