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,342 @@
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 NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
8
+ from .._compat import cached_property
9
+ from .._resource import SyncAPIResource, AsyncAPIResource
10
+ from .._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from .._base_client import make_request_options
17
+
18
+ __all__ = ["ClearDocsResource", "AsyncClearDocsResource"]
19
+
20
+
21
+ class ClearDocsResource(SyncAPIResource):
22
+ @cached_property
23
+ def with_raw_response(self) -> ClearDocsResourceWithRawResponse:
24
+ """
25
+ This property can be used as a prefix for any HTTP method call to return
26
+ the raw response object instead of the parsed content.
27
+
28
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
29
+ """
30
+ return ClearDocsResourceWithRawResponse(self)
31
+
32
+ @cached_property
33
+ def with_streaming_response(self) -> ClearDocsResourceWithStreamingResponse:
34
+ """
35
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36
+
37
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
38
+ """
39
+ return ClearDocsResourceWithStreamingResponse(self)
40
+
41
+ def clear_all(
42
+ self,
43
+ index: str,
44
+ *,
45
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
+ # The extra values given here take precedence over values defined on the client or passed to this method.
47
+ extra_headers: Headers | None = None,
48
+ extra_query: Query | None = None,
49
+ extra_body: Body | None = None,
50
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
+ ) -> None:
52
+ """
53
+ Clear all docs for the given index
54
+
55
+ Args:
56
+ extra_headers: Send extra headers
57
+
58
+ extra_query: Add additional query parameters to the request
59
+
60
+ extra_body: Add additional JSON properties to the request
61
+
62
+ timeout: Override the client-level default timeout for this request, in seconds
63
+ """
64
+ if not index:
65
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
66
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
67
+ return self._post(
68
+ f"/clear-docs/{index}",
69
+ options=make_request_options(
70
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
71
+ ),
72
+ cast_to=NoneType,
73
+ )
74
+
75
+ def clear_by_uuid(
76
+ self,
77
+ uuid: str,
78
+ *,
79
+ index: str,
80
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
81
+ # The extra values given here take precedence over values defined on the client or passed to this method.
82
+ extra_headers: Headers | None = None,
83
+ extra_query: Query | None = None,
84
+ extra_body: Body | None = None,
85
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
86
+ ) -> None:
87
+ """
88
+ Clear all docs for the given uuid within the index
89
+
90
+ Args:
91
+ extra_headers: Send extra headers
92
+
93
+ extra_query: Add additional query parameters to the request
94
+
95
+ extra_body: Add additional JSON properties to the request
96
+
97
+ timeout: Override the client-level default timeout for this request, in seconds
98
+ """
99
+ if not index:
100
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
101
+ if not uuid:
102
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
103
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
104
+ return self._post(
105
+ f"/clear-docs/{index}/{uuid}",
106
+ options=make_request_options(
107
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
108
+ ),
109
+ cast_to=NoneType,
110
+ )
111
+
112
+ def clear_by_uuid_and_scope(
113
+ self,
114
+ scope: str,
115
+ *,
116
+ index: str,
117
+ uuid: str,
118
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
119
+ # The extra values given here take precedence over values defined on the client or passed to this method.
120
+ extra_headers: Headers | None = None,
121
+ extra_query: Query | None = None,
122
+ extra_body: Body | None = None,
123
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
124
+ ) -> None:
125
+ """
126
+ Clear all docs for the given uuid within the index and scope
127
+
128
+ Args:
129
+ extra_headers: Send extra headers
130
+
131
+ extra_query: Add additional query parameters to the request
132
+
133
+ extra_body: Add additional JSON properties to the request
134
+
135
+ timeout: Override the client-level default timeout for this request, in seconds
136
+ """
137
+ if not index:
138
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
139
+ if not uuid:
140
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
141
+ if not scope:
142
+ raise ValueError(f"Expected a non-empty value for `scope` but received {scope!r}")
143
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
144
+ return self._post(
145
+ f"/clear-docs/{index}/{uuid}/{scope}",
146
+ options=make_request_options(
147
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
148
+ ),
149
+ cast_to=NoneType,
150
+ )
151
+
152
+
153
+ class AsyncClearDocsResource(AsyncAPIResource):
154
+ @cached_property
155
+ def with_raw_response(self) -> AsyncClearDocsResourceWithRawResponse:
156
+ """
157
+ This property can be used as a prefix for any HTTP method call to return
158
+ the raw response object instead of the parsed content.
159
+
160
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
161
+ """
162
+ return AsyncClearDocsResourceWithRawResponse(self)
163
+
164
+ @cached_property
165
+ def with_streaming_response(self) -> AsyncClearDocsResourceWithStreamingResponse:
166
+ """
167
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
168
+
169
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
170
+ """
171
+ return AsyncClearDocsResourceWithStreamingResponse(self)
172
+
173
+ async def clear_all(
174
+ self,
175
+ index: str,
176
+ *,
177
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
178
+ # The extra values given here take precedence over values defined on the client or passed to this method.
179
+ extra_headers: Headers | None = None,
180
+ extra_query: Query | None = None,
181
+ extra_body: Body | None = None,
182
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
183
+ ) -> None:
184
+ """
185
+ Clear all docs for the given index
186
+
187
+ Args:
188
+ extra_headers: Send extra headers
189
+
190
+ extra_query: Add additional query parameters to the request
191
+
192
+ extra_body: Add additional JSON properties to the request
193
+
194
+ timeout: Override the client-level default timeout for this request, in seconds
195
+ """
196
+ if not index:
197
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
198
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
199
+ return await self._post(
200
+ f"/clear-docs/{index}",
201
+ options=make_request_options(
202
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
203
+ ),
204
+ cast_to=NoneType,
205
+ )
206
+
207
+ async def clear_by_uuid(
208
+ self,
209
+ uuid: str,
210
+ *,
211
+ index: str,
212
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
213
+ # The extra values given here take precedence over values defined on the client or passed to this method.
214
+ extra_headers: Headers | None = None,
215
+ extra_query: Query | None = None,
216
+ extra_body: Body | None = None,
217
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
218
+ ) -> None:
219
+ """
220
+ Clear all docs for the given uuid within the index
221
+
222
+ Args:
223
+ extra_headers: Send extra headers
224
+
225
+ extra_query: Add additional query parameters to the request
226
+
227
+ extra_body: Add additional JSON properties to the request
228
+
229
+ timeout: Override the client-level default timeout for this request, in seconds
230
+ """
231
+ if not index:
232
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
233
+ if not uuid:
234
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
235
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
236
+ return await self._post(
237
+ f"/clear-docs/{index}/{uuid}",
238
+ options=make_request_options(
239
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
240
+ ),
241
+ cast_to=NoneType,
242
+ )
243
+
244
+ async def clear_by_uuid_and_scope(
245
+ self,
246
+ scope: str,
247
+ *,
248
+ index: str,
249
+ uuid: str,
250
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
251
+ # The extra values given here take precedence over values defined on the client or passed to this method.
252
+ extra_headers: Headers | None = None,
253
+ extra_query: Query | None = None,
254
+ extra_body: Body | None = None,
255
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
256
+ ) -> None:
257
+ """
258
+ Clear all docs for the given uuid within the index and scope
259
+
260
+ Args:
261
+ extra_headers: Send extra headers
262
+
263
+ extra_query: Add additional query parameters to the request
264
+
265
+ extra_body: Add additional JSON properties to the request
266
+
267
+ timeout: Override the client-level default timeout for this request, in seconds
268
+ """
269
+ if not index:
270
+ raise ValueError(f"Expected a non-empty value for `index` but received {index!r}")
271
+ if not uuid:
272
+ raise ValueError(f"Expected a non-empty value for `uuid` but received {uuid!r}")
273
+ if not scope:
274
+ raise ValueError(f"Expected a non-empty value for `scope` but received {scope!r}")
275
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
276
+ return await self._post(
277
+ f"/clear-docs/{index}/{uuid}/{scope}",
278
+ options=make_request_options(
279
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
280
+ ),
281
+ cast_to=NoneType,
282
+ )
283
+
284
+
285
+ class ClearDocsResourceWithRawResponse:
286
+ def __init__(self, clear_docs: ClearDocsResource) -> None:
287
+ self._clear_docs = clear_docs
288
+
289
+ self.clear_all = to_raw_response_wrapper(
290
+ clear_docs.clear_all,
291
+ )
292
+ self.clear_by_uuid = to_raw_response_wrapper(
293
+ clear_docs.clear_by_uuid,
294
+ )
295
+ self.clear_by_uuid_and_scope = to_raw_response_wrapper(
296
+ clear_docs.clear_by_uuid_and_scope,
297
+ )
298
+
299
+
300
+ class AsyncClearDocsResourceWithRawResponse:
301
+ def __init__(self, clear_docs: AsyncClearDocsResource) -> None:
302
+ self._clear_docs = clear_docs
303
+
304
+ self.clear_all = async_to_raw_response_wrapper(
305
+ clear_docs.clear_all,
306
+ )
307
+ self.clear_by_uuid = async_to_raw_response_wrapper(
308
+ clear_docs.clear_by_uuid,
309
+ )
310
+ self.clear_by_uuid_and_scope = async_to_raw_response_wrapper(
311
+ clear_docs.clear_by_uuid_and_scope,
312
+ )
313
+
314
+
315
+ class ClearDocsResourceWithStreamingResponse:
316
+ def __init__(self, clear_docs: ClearDocsResource) -> None:
317
+ self._clear_docs = clear_docs
318
+
319
+ self.clear_all = to_streamed_response_wrapper(
320
+ clear_docs.clear_all,
321
+ )
322
+ self.clear_by_uuid = to_streamed_response_wrapper(
323
+ clear_docs.clear_by_uuid,
324
+ )
325
+ self.clear_by_uuid_and_scope = to_streamed_response_wrapper(
326
+ clear_docs.clear_by_uuid_and_scope,
327
+ )
328
+
329
+
330
+ class AsyncClearDocsResourceWithStreamingResponse:
331
+ def __init__(self, clear_docs: AsyncClearDocsResource) -> None:
332
+ self._clear_docs = clear_docs
333
+
334
+ self.clear_all = async_to_streamed_response_wrapper(
335
+ clear_docs.clear_all,
336
+ )
337
+ self.clear_by_uuid = async_to_streamed_response_wrapper(
338
+ clear_docs.clear_by_uuid,
339
+ )
340
+ self.clear_by_uuid_and_scope = async_to_streamed_response_wrapper(
341
+ clear_docs.clear_by_uuid_and_scope,
342
+ )
@@ -0,0 +1,145 @@
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 NOT_GIVEN, Body, Query, Headers, NotGiven
8
+ from .._compat import cached_property
9
+ from .._resource import SyncAPIResource, AsyncAPIResource
10
+ from .._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from .._base_client import make_request_options
17
+ from ..types.index_list_response import IndexListResponse
18
+
19
+ __all__ = ["IndicesResource", "AsyncIndicesResource"]
20
+
21
+
22
+ class IndicesResource(SyncAPIResource):
23
+ @cached_property
24
+ def with_raw_response(self) -> IndicesResourceWithRawResponse:
25
+ """
26
+ This property can be used as a prefix for any HTTP method call to return
27
+ the raw response object instead of the parsed content.
28
+
29
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
30
+ """
31
+ return IndicesResourceWithRawResponse(self)
32
+
33
+ @cached_property
34
+ def with_streaming_response(self) -> IndicesResourceWithStreamingResponse:
35
+ """
36
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
37
+
38
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
39
+ """
40
+ return IndicesResourceWithStreamingResponse(self)
41
+
42
+ def list(
43
+ self,
44
+ *,
45
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
46
+ # The extra values given here take precedence over values defined on the client or passed to this method.
47
+ extra_headers: Headers | None = None,
48
+ extra_query: Query | None = None,
49
+ extra_body: Body | None = None,
50
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
51
+ ) -> IndexListResponse:
52
+ """Reindex for a given UUID of dataset.
53
+
54
+ Use this method to obtain a list of valid
55
+ indices within the search-api endpoint. These index names are used in some of
56
+ the subsequent calls made to the endpoint.
57
+ """
58
+ return self._get(
59
+ "/indices",
60
+ options=make_request_options(
61
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
62
+ ),
63
+ cast_to=IndexListResponse,
64
+ )
65
+
66
+
67
+ class AsyncIndicesResource(AsyncAPIResource):
68
+ @cached_property
69
+ def with_raw_response(self) -> AsyncIndicesResourceWithRawResponse:
70
+ """
71
+ This property can be used as a prefix for any HTTP method call to return
72
+ the raw response object instead of the parsed content.
73
+
74
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
75
+ """
76
+ return AsyncIndicesResourceWithRawResponse(self)
77
+
78
+ @cached_property
79
+ def with_streaming_response(self) -> AsyncIndicesResourceWithStreamingResponse:
80
+ """
81
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
82
+
83
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
84
+ """
85
+ return AsyncIndicesResourceWithStreamingResponse(self)
86
+
87
+ async def list(
88
+ self,
89
+ *,
90
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
91
+ # The extra values given here take precedence over values defined on the client or passed to this method.
92
+ extra_headers: Headers | None = None,
93
+ extra_query: Query | None = None,
94
+ extra_body: Body | None = None,
95
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
96
+ ) -> IndexListResponse:
97
+ """Reindex for a given UUID of dataset.
98
+
99
+ Use this method to obtain a list of valid
100
+ indices within the search-api endpoint. These index names are used in some of
101
+ the subsequent calls made to the endpoint.
102
+ """
103
+ return await self._get(
104
+ "/indices",
105
+ options=make_request_options(
106
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
107
+ ),
108
+ cast_to=IndexListResponse,
109
+ )
110
+
111
+
112
+ class IndicesResourceWithRawResponse:
113
+ def __init__(self, indices: IndicesResource) -> None:
114
+ self._indices = indices
115
+
116
+ self.list = to_raw_response_wrapper(
117
+ indices.list,
118
+ )
119
+
120
+
121
+ class AsyncIndicesResourceWithRawResponse:
122
+ def __init__(self, indices: AsyncIndicesResource) -> None:
123
+ self._indices = indices
124
+
125
+ self.list = async_to_raw_response_wrapper(
126
+ indices.list,
127
+ )
128
+
129
+
130
+ class IndicesResourceWithStreamingResponse:
131
+ def __init__(self, indices: IndicesResource) -> None:
132
+ self._indices = indices
133
+
134
+ self.list = to_streamed_response_wrapper(
135
+ indices.list,
136
+ )
137
+
138
+
139
+ class AsyncIndicesResourceWithStreamingResponse:
140
+ def __init__(self, indices: AsyncIndicesResource) -> None:
141
+ self._indices = indices
142
+
143
+ self.list = async_to_streamed_response_wrapper(
144
+ indices.list,
145
+ )
@@ -0,0 +1,212 @@
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 NOT_GIVEN, Body, Query, Headers, NotGiven
8
+ from .._compat import cached_property
9
+ from .._resource import SyncAPIResource, AsyncAPIResource
10
+ from .._response import (
11
+ to_raw_response_wrapper,
12
+ to_streamed_response_wrapper,
13
+ async_to_raw_response_wrapper,
14
+ async_to_streamed_response_wrapper,
15
+ )
16
+ from .._base_client import make_request_options
17
+
18
+ __all__ = ["MappingResource", "AsyncMappingResource"]
19
+
20
+
21
+ class MappingResource(SyncAPIResource):
22
+ @cached_property
23
+ def with_raw_response(self) -> MappingResourceWithRawResponse:
24
+ """
25
+ This property can be used as a prefix for any HTTP method call to return
26
+ the raw response object instead of the parsed content.
27
+
28
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
29
+ """
30
+ return MappingResourceWithRawResponse(self)
31
+
32
+ @cached_property
33
+ def with_streaming_response(self) -> MappingResourceWithStreamingResponse:
34
+ """
35
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
36
+
37
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
38
+ """
39
+ return MappingResourceWithStreamingResponse(self)
40
+
41
+ def retrieve_default(
42
+ self,
43
+ *,
44
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
45
+ # The extra values given here take precedence over values defined on the client or passed to this method.
46
+ extra_headers: Headers | None = None,
47
+ extra_query: Query | None = None,
48
+ extra_body: Body | None = None,
49
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
50
+ ) -> object:
51
+ """Retrieve mapping information for the defeault index, which is consortium." """
52
+ return self._get(
53
+ "/mapping",
54
+ options=make_request_options(
55
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
56
+ ),
57
+ cast_to=object,
58
+ )
59
+
60
+ def retrieve_index(
61
+ self,
62
+ index_name: str,
63
+ *,
64
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
65
+ # The extra values given here take precedence over values defined on the client or passed to this method.
66
+ extra_headers: Headers | None = None,
67
+ extra_query: Query | None = None,
68
+ extra_body: Body | None = None,
69
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
70
+ ) -> object:
71
+ """
72
+ Retrieve mapping information for the specified index
73
+
74
+ Args:
75
+ extra_headers: Send extra headers
76
+
77
+ extra_query: Add additional query parameters to the request
78
+
79
+ extra_body: Add additional JSON properties to the request
80
+
81
+ timeout: Override the client-level default timeout for this request, in seconds
82
+ """
83
+ if not index_name:
84
+ raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}")
85
+ return self._get(
86
+ f"/{index_name}/mapping",
87
+ options=make_request_options(
88
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
89
+ ),
90
+ cast_to=object,
91
+ )
92
+
93
+
94
+ class AsyncMappingResource(AsyncAPIResource):
95
+ @cached_property
96
+ def with_raw_response(self) -> AsyncMappingResourceWithRawResponse:
97
+ """
98
+ This property can be used as a prefix for any HTTP method call to return
99
+ the raw response object instead of the parsed content.
100
+
101
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
102
+ """
103
+ return AsyncMappingResourceWithRawResponse(self)
104
+
105
+ @cached_property
106
+ def with_streaming_response(self) -> AsyncMappingResourceWithStreamingResponse:
107
+ """
108
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
109
+
110
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
111
+ """
112
+ return AsyncMappingResourceWithStreamingResponse(self)
113
+
114
+ async def retrieve_default(
115
+ self,
116
+ *,
117
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
118
+ # The extra values given here take precedence over values defined on the client or passed to this method.
119
+ extra_headers: Headers | None = None,
120
+ extra_query: Query | None = None,
121
+ extra_body: Body | None = None,
122
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
123
+ ) -> object:
124
+ """Retrieve mapping information for the defeault index, which is consortium." """
125
+ return await self._get(
126
+ "/mapping",
127
+ options=make_request_options(
128
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
129
+ ),
130
+ cast_to=object,
131
+ )
132
+
133
+ async def retrieve_index(
134
+ self,
135
+ index_name: str,
136
+ *,
137
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
138
+ # The extra values given here take precedence over values defined on the client or passed to this method.
139
+ extra_headers: Headers | None = None,
140
+ extra_query: Query | None = None,
141
+ extra_body: Body | None = None,
142
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
143
+ ) -> object:
144
+ """
145
+ Retrieve mapping information for the specified index
146
+
147
+ Args:
148
+ extra_headers: Send extra headers
149
+
150
+ extra_query: Add additional query parameters to the request
151
+
152
+ extra_body: Add additional JSON properties to the request
153
+
154
+ timeout: Override the client-level default timeout for this request, in seconds
155
+ """
156
+ if not index_name:
157
+ raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}")
158
+ return await self._get(
159
+ f"/{index_name}/mapping",
160
+ options=make_request_options(
161
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
162
+ ),
163
+ cast_to=object,
164
+ )
165
+
166
+
167
+ class MappingResourceWithRawResponse:
168
+ def __init__(self, mapping: MappingResource) -> None:
169
+ self._mapping = mapping
170
+
171
+ self.retrieve_default = to_raw_response_wrapper(
172
+ mapping.retrieve_default,
173
+ )
174
+ self.retrieve_index = to_raw_response_wrapper(
175
+ mapping.retrieve_index,
176
+ )
177
+
178
+
179
+ class AsyncMappingResourceWithRawResponse:
180
+ def __init__(self, mapping: AsyncMappingResource) -> None:
181
+ self._mapping = mapping
182
+
183
+ self.retrieve_default = async_to_raw_response_wrapper(
184
+ mapping.retrieve_default,
185
+ )
186
+ self.retrieve_index = async_to_raw_response_wrapper(
187
+ mapping.retrieve_index,
188
+ )
189
+
190
+
191
+ class MappingResourceWithStreamingResponse:
192
+ def __init__(self, mapping: MappingResource) -> None:
193
+ self._mapping = mapping
194
+
195
+ self.retrieve_default = to_streamed_response_wrapper(
196
+ mapping.retrieve_default,
197
+ )
198
+ self.retrieve_index = to_streamed_response_wrapper(
199
+ mapping.retrieve_index,
200
+ )
201
+
202
+
203
+ class AsyncMappingResourceWithStreamingResponse:
204
+ def __init__(self, mapping: AsyncMappingResource) -> None:
205
+ self._mapping = mapping
206
+
207
+ self.retrieve_default = async_to_streamed_response_wrapper(
208
+ mapping.retrieve_default,
209
+ )
210
+ self.retrieve_index = async_to_streamed_response_wrapper(
211
+ mapping.retrieve_index,
212
+ )