hubmap-search-sdk 1.0.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. hubmap_search_sdk/__init__.py +94 -0
  2. hubmap_search_sdk/_base_client.py +1969 -0
  3. hubmap_search_sdk/_client.py +464 -0
  4. hubmap_search_sdk/_compat.py +219 -0
  5. hubmap_search_sdk/_constants.py +14 -0
  6. hubmap_search_sdk/_exceptions.py +108 -0
  7. hubmap_search_sdk/_files.py +123 -0
  8. hubmap_search_sdk/_models.py +804 -0
  9. hubmap_search_sdk/_qs.py +150 -0
  10. hubmap_search_sdk/_resource.py +43 -0
  11. hubmap_search_sdk/_response.py +832 -0
  12. hubmap_search_sdk/_streaming.py +333 -0
  13. hubmap_search_sdk/_types.py +217 -0
  14. hubmap_search_sdk/_utils/__init__.py +57 -0
  15. hubmap_search_sdk/_utils/_logs.py +25 -0
  16. hubmap_search_sdk/_utils/_proxy.py +62 -0
  17. hubmap_search_sdk/_utils/_reflection.py +42 -0
  18. hubmap_search_sdk/_utils/_streams.py +12 -0
  19. hubmap_search_sdk/_utils/_sync.py +86 -0
  20. hubmap_search_sdk/_utils/_transform.py +402 -0
  21. hubmap_search_sdk/_utils/_typing.py +149 -0
  22. hubmap_search_sdk/_utils/_utils.py +414 -0
  23. hubmap_search_sdk/_version.py +4 -0
  24. hubmap_search_sdk/lib/.keep +4 -0
  25. hubmap_search_sdk/py.typed +0 -0
  26. hubmap_search_sdk/resources/__init__.py +145 -0
  27. hubmap_search_sdk/resources/add.py +367 -0
  28. hubmap_search_sdk/resources/clear_docs.py +342 -0
  29. hubmap_search_sdk/resources/indices.py +145 -0
  30. hubmap_search_sdk/resources/mapping.py +212 -0
  31. hubmap_search_sdk/resources/mget.py +265 -0
  32. hubmap_search_sdk/resources/param_search.py +197 -0
  33. hubmap_search_sdk/resources/reindex.py +164 -0
  34. hubmap_search_sdk/resources/scroll_search.py +181 -0
  35. hubmap_search_sdk/resources/search.py +313 -0
  36. hubmap_search_sdk/resources/update.py +367 -0
  37. hubmap_search_sdk/types/__init__.py +23 -0
  38. hubmap_search_sdk/types/add_create_document_params.py +11 -0
  39. hubmap_search_sdk/types/add_create_document_with_index_params.py +13 -0
  40. hubmap_search_sdk/types/add_update_document_with_scope_params.py +15 -0
  41. hubmap_search_sdk/types/index_list_response.py +11 -0
  42. hubmap_search_sdk/types/mget_retrieve_multiple_by_index_params.py +11 -0
  43. hubmap_search_sdk/types/mget_retrieve_multiple_params.py +11 -0
  44. hubmap_search_sdk/types/param_search_execute_params.py +18 -0
  45. hubmap_search_sdk/types/scroll_search_create_params.py +11 -0
  46. hubmap_search_sdk/types/search_execute_index_query_params.py +20 -0
  47. hubmap_search_sdk/types/search_execute_query_params.py +20 -0
  48. hubmap_search_sdk/types/update_update_document_at_index_params.py +13 -0
  49. hubmap_search_sdk/types/update_update_document_params.py +11 -0
  50. hubmap_search_sdk/types/update_update_document_with_scope_params.py +15 -0
  51. hubmap_search_sdk-1.0.0a1.dist-info/METADATA +355 -0
  52. hubmap_search_sdk-1.0.0a1.dist-info/RECORD +54 -0
  53. hubmap_search_sdk-1.0.0a1.dist-info/WHEEL +4 -0
  54. hubmap_search_sdk-1.0.0a1.dist-info/licenses/LICENSE +7 -0
@@ -0,0 +1,367 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ import httpx
6
+
7
+ from ..types import (
8
+ add_create_document_params,
9
+ add_create_document_with_index_params,
10
+ add_update_document_with_scope_params,
11
+ )
12
+ from .._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
13
+ from .._utils import (
14
+ maybe_transform,
15
+ async_maybe_transform,
16
+ )
17
+ from .._compat import cached_property
18
+ from .._resource import SyncAPIResource, AsyncAPIResource
19
+ from .._response import (
20
+ to_raw_response_wrapper,
21
+ to_streamed_response_wrapper,
22
+ async_to_raw_response_wrapper,
23
+ async_to_streamed_response_wrapper,
24
+ )
25
+ from .._base_client import make_request_options
26
+
27
+ __all__ = ["AddResource", "AsyncAddResource"]
28
+
29
+
30
+ class AddResource(SyncAPIResource):
31
+ @cached_property
32
+ def with_raw_response(self) -> AddResourceWithRawResponse:
33
+ """
34
+ This property can be used as a prefix for any HTTP method call to return
35
+ the raw response object instead of the parsed content.
36
+
37
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
38
+ """
39
+ return AddResourceWithRawResponse(self)
40
+
41
+ @cached_property
42
+ def with_streaming_response(self) -> AddResourceWithStreamingResponse:
43
+ """
44
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
45
+
46
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
47
+ """
48
+ return AddResourceWithStreamingResponse(self)
49
+
50
+ def create_document(
51
+ self,
52
+ uuid: str,
53
+ *,
54
+ body: object,
55
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
56
+ # The extra values given here take precedence over values defined on the client or passed to this method.
57
+ extra_headers: Headers | None = None,
58
+ extra_query: Query | None = None,
59
+ extra_body: Body | None = None,
60
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
61
+ ) -> None:
62
+ """
63
+ Add a specific document with the passed in UUID
64
+
65
+ Args:
66
+ extra_headers: Send extra headers
67
+
68
+ extra_query: Add additional query parameters to the request
69
+
70
+ extra_body: Add additional JSON properties to the request
71
+
72
+ timeout: Override the client-level default timeout for this request, in seconds
73
+ """
74
+ if not uuid:
75
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
76
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
77
+ return self._post(
78
+ f"/add/{uuid}",
79
+ body=maybe_transform(body, add_create_document_params.AddCreateDocumentParams),
80
+ options=make_request_options(
81
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
82
+ ),
83
+ cast_to=NoneType,
84
+ )
85
+
86
+ def create_document_with_index(
87
+ self,
88
+ index: str,
89
+ *,
90
+ uuid: str,
91
+ body: object,
92
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
93
+ # The extra values given here take precedence over values defined on the client or passed to this method.
94
+ extra_headers: Headers | None = None,
95
+ extra_query: Query | None = None,
96
+ extra_body: Body | None = None,
97
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
98
+ ) -> None:
99
+ """
100
+ Create a specific document with the passed in UUID and index
101
+
102
+ Args:
103
+ extra_headers: Send extra headers
104
+
105
+ extra_query: Add additional query parameters to the request
106
+
107
+ extra_body: Add additional JSON properties to the request
108
+
109
+ timeout: Override the client-level default timeout for this request, in seconds
110
+ """
111
+ if not uuid:
112
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
113
+ if not index:
114
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
115
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
116
+ return self._post(
117
+ f"/add/{uuid}/{index}",
118
+ body=maybe_transform(body, add_create_document_with_index_params.AddCreateDocumentWithIndexParams),
119
+ options=make_request_options(
120
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
121
+ ),
122
+ cast_to=NoneType,
123
+ )
124
+
125
+ def update_document_with_scope(
126
+ self,
127
+ scope: str,
128
+ *,
129
+ uuid: str,
130
+ index: str,
131
+ body: object,
132
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
133
+ # The extra values given here take precedence over values defined on the client or passed to this method.
134
+ extra_headers: Headers | None = None,
135
+ extra_query: Query | None = None,
136
+ extra_body: Body | None = None,
137
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
138
+ ) -> None:
139
+ """
140
+ Update a specific document with the passed in UUID, Index, and Scope
141
+
142
+ Args:
143
+ extra_headers: Send extra headers
144
+
145
+ extra_query: Add additional query parameters to the request
146
+
147
+ extra_body: Add additional JSON properties to the request
148
+
149
+ timeout: Override the client-level default timeout for this request, in seconds
150
+ """
151
+ if not uuid:
152
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
153
+ if not index:
154
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
155
+ if not scope:
156
+ raise ValueError(f"Expected a non-empty value for `scope` but received {scope!r}")
157
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
158
+ return self._post(
159
+ f"/add/{uuid}/{index}/{scope}",
160
+ body=maybe_transform(body, add_update_document_with_scope_params.AddUpdateDocumentWithScopeParams),
161
+ options=make_request_options(
162
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
163
+ ),
164
+ cast_to=NoneType,
165
+ )
166
+
167
+
168
+ class AsyncAddResource(AsyncAPIResource):
169
+ @cached_property
170
+ def with_raw_response(self) -> AsyncAddResourceWithRawResponse:
171
+ """
172
+ This property can be used as a prefix for any HTTP method call to return
173
+ the raw response object instead of the parsed content.
174
+
175
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
176
+ """
177
+ return AsyncAddResourceWithRawResponse(self)
178
+
179
+ @cached_property
180
+ def with_streaming_response(self) -> AsyncAddResourceWithStreamingResponse:
181
+ """
182
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
183
+
184
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
185
+ """
186
+ return AsyncAddResourceWithStreamingResponse(self)
187
+
188
+ async def create_document(
189
+ self,
190
+ uuid: str,
191
+ *,
192
+ body: object,
193
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
194
+ # The extra values given here take precedence over values defined on the client or passed to this method.
195
+ extra_headers: Headers | None = None,
196
+ extra_query: Query | None = None,
197
+ extra_body: Body | None = None,
198
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
199
+ ) -> None:
200
+ """
201
+ Add a specific document with the passed in UUID
202
+
203
+ Args:
204
+ extra_headers: Send extra headers
205
+
206
+ extra_query: Add additional query parameters to the request
207
+
208
+ extra_body: Add additional JSON properties to the request
209
+
210
+ timeout: Override the client-level default timeout for this request, in seconds
211
+ """
212
+ if not uuid:
213
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
214
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
215
+ return await self._post(
216
+ f"/add/{uuid}",
217
+ body=await async_maybe_transform(body, add_create_document_params.AddCreateDocumentParams),
218
+ options=make_request_options(
219
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
220
+ ),
221
+ cast_to=NoneType,
222
+ )
223
+
224
+ async def create_document_with_index(
225
+ self,
226
+ index: str,
227
+ *,
228
+ uuid: str,
229
+ body: object,
230
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
231
+ # The extra values given here take precedence over values defined on the client or passed to this method.
232
+ extra_headers: Headers | None = None,
233
+ extra_query: Query | None = None,
234
+ extra_body: Body | None = None,
235
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
236
+ ) -> None:
237
+ """
238
+ Create a specific document with the passed in UUID and index
239
+
240
+ Args:
241
+ extra_headers: Send extra headers
242
+
243
+ extra_query: Add additional query parameters to the request
244
+
245
+ extra_body: Add additional JSON properties to the request
246
+
247
+ timeout: Override the client-level default timeout for this request, in seconds
248
+ """
249
+ if not uuid:
250
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
251
+ if not index:
252
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
253
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
254
+ return await self._post(
255
+ f"/add/{uuid}/{index}",
256
+ body=await async_maybe_transform(
257
+ body, add_create_document_with_index_params.AddCreateDocumentWithIndexParams
258
+ ),
259
+ options=make_request_options(
260
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
261
+ ),
262
+ cast_to=NoneType,
263
+ )
264
+
265
+ async def update_document_with_scope(
266
+ self,
267
+ scope: str,
268
+ *,
269
+ uuid: str,
270
+ index: str,
271
+ body: object,
272
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
273
+ # The extra values given here take precedence over values defined on the client or passed to this method.
274
+ extra_headers: Headers | None = None,
275
+ extra_query: Query | None = None,
276
+ extra_body: Body | None = None,
277
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
278
+ ) -> None:
279
+ """
280
+ Update a specific document with the passed in UUID, Index, and Scope
281
+
282
+ Args:
283
+ extra_headers: Send extra headers
284
+
285
+ extra_query: Add additional query parameters to the request
286
+
287
+ extra_body: Add additional JSON properties to the request
288
+
289
+ timeout: Override the client-level default timeout for this request, in seconds
290
+ """
291
+ if not uuid:
292
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
293
+ if not index:
294
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
295
+ if not scope:
296
+ raise ValueError(f"Expected a non-empty value for `scope` but received {scope!r}")
297
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
298
+ return await self._post(
299
+ f"/add/{uuid}/{index}/{scope}",
300
+ body=await async_maybe_transform(
301
+ body, add_update_document_with_scope_params.AddUpdateDocumentWithScopeParams
302
+ ),
303
+ options=make_request_options(
304
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
305
+ ),
306
+ cast_to=NoneType,
307
+ )
308
+
309
+
310
+ class AddResourceWithRawResponse:
311
+ def __init__(self, add: AddResource) -> None:
312
+ self._add = add
313
+
314
+ self.create_document = to_raw_response_wrapper(
315
+ add.create_document,
316
+ )
317
+ self.create_document_with_index = to_raw_response_wrapper(
318
+ add.create_document_with_index,
319
+ )
320
+ self.update_document_with_scope = to_raw_response_wrapper(
321
+ add.update_document_with_scope,
322
+ )
323
+
324
+
325
+ class AsyncAddResourceWithRawResponse:
326
+ def __init__(self, add: AsyncAddResource) -> None:
327
+ self._add = add
328
+
329
+ self.create_document = async_to_raw_response_wrapper(
330
+ add.create_document,
331
+ )
332
+ self.create_document_with_index = async_to_raw_response_wrapper(
333
+ add.create_document_with_index,
334
+ )
335
+ self.update_document_with_scope = async_to_raw_response_wrapper(
336
+ add.update_document_with_scope,
337
+ )
338
+
339
+
340
+ class AddResourceWithStreamingResponse:
341
+ def __init__(self, add: AddResource) -> None:
342
+ self._add = add
343
+
344
+ self.create_document = to_streamed_response_wrapper(
345
+ add.create_document,
346
+ )
347
+ self.create_document_with_index = to_streamed_response_wrapper(
348
+ add.create_document_with_index,
349
+ )
350
+ self.update_document_with_scope = to_streamed_response_wrapper(
351
+ add.update_document_with_scope,
352
+ )
353
+
354
+
355
+ class AsyncAddResourceWithStreamingResponse:
356
+ def __init__(self, add: AsyncAddResource) -> None:
357
+ self._add = add
358
+
359
+ self.create_document = async_to_streamed_response_wrapper(
360
+ add.create_document,
361
+ )
362
+ self.create_document_with_index = async_to_streamed_response_wrapper(
363
+ add.create_document_with_index,
364
+ )
365
+ self.update_document_with_scope = async_to_streamed_response_wrapper(
366
+ add.update_document_with_scope,
367
+ )