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,265 @@
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 mget_retrieve_multiple_params, mget_retrieve_multiple_by_index_params
8
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from .._utils import (
10
+ maybe_transform,
11
+ async_maybe_transform,
12
+ )
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+
23
+ __all__ = ["MgetResource", "AsyncMgetResource"]
24
+
25
+
26
+ class MgetResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> MgetResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
34
+ """
35
+ return MgetResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> MgetResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
43
+ """
44
+ return MgetResourceWithStreamingResponse(self)
45
+
46
+ def retrieve_multiple(
47
+ self,
48
+ *,
49
+ body: object,
50
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
51
+ # The extra values given here take precedence over values defined on the client or passed to this method.
52
+ extra_headers: Headers | None = None,
53
+ extra_query: Query | None = None,
54
+ extra_body: Body | None = None,
55
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
56
+ ) -> object:
57
+ """
58
+ To retrieve multiple documents by their IDs, the POST method must provide 1) a
59
+ request body containing an array of document IDs in the \\__mget format, 2) a
60
+ bearer token in the Authorization header supplied by HuBMAP. Results are limited
61
+ to those authorized by the bearer token. Uses the <strong>entities</strong>
62
+ index by default
63
+
64
+ Args:
65
+ extra_headers: Send extra headers
66
+
67
+ extra_query: Add additional query parameters to the request
68
+
69
+ extra_body: Add additional JSON properties to the request
70
+
71
+ timeout: Override the client-level default timeout for this request, in seconds
72
+ """
73
+ return self._post(
74
+ "/mget",
75
+ body=maybe_transform(body, mget_retrieve_multiple_params.MgetRetrieveMultipleParams),
76
+ options=make_request_options(
77
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
78
+ ),
79
+ cast_to=object,
80
+ )
81
+
82
+ def retrieve_multiple_by_index(
83
+ self,
84
+ index_name: str,
85
+ *,
86
+ body: object,
87
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
88
+ # The extra values given here take precedence over values defined on the client or passed to this method.
89
+ extra_headers: Headers | None = None,
90
+ extra_query: Query | None = None,
91
+ extra_body: Body | None = None,
92
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
93
+ ) -> object:
94
+ """
95
+ To retrieve multiple documents by their IDs, the POST method must provide 1) a
96
+ request body containing an array of document IDs in the \\__mget format, 2) a
97
+ bearer token in the Authorization header supplied by HuBMAP. Results are limited
98
+ to those authorized by the bearer token. Uses the <strong>entities</strong>
99
+ index by default
100
+
101
+ Args:
102
+ extra_headers: Send extra headers
103
+
104
+ extra_query: Add additional query parameters to the request
105
+
106
+ extra_body: Add additional JSON properties to the request
107
+
108
+ timeout: Override the client-level default timeout for this request, in seconds
109
+ """
110
+ if not index_name:
111
+ raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}")
112
+ return self._post(
113
+ f"/{index_name}/mget",
114
+ body=maybe_transform(body, mget_retrieve_multiple_by_index_params.MgetRetrieveMultipleByIndexParams),
115
+ options=make_request_options(
116
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
117
+ ),
118
+ cast_to=object,
119
+ )
120
+
121
+
122
+ class AsyncMgetResource(AsyncAPIResource):
123
+ @cached_property
124
+ def with_raw_response(self) -> AsyncMgetResourceWithRawResponse:
125
+ """
126
+ This property can be used as a prefix for any HTTP method call to return
127
+ the raw response object instead of the parsed content.
128
+
129
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
130
+ """
131
+ return AsyncMgetResourceWithRawResponse(self)
132
+
133
+ @cached_property
134
+ def with_streaming_response(self) -> AsyncMgetResourceWithStreamingResponse:
135
+ """
136
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
137
+
138
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
139
+ """
140
+ return AsyncMgetResourceWithStreamingResponse(self)
141
+
142
+ async def retrieve_multiple(
143
+ self,
144
+ *,
145
+ body: object,
146
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
147
+ # The extra values given here take precedence over values defined on the client or passed to this method.
148
+ extra_headers: Headers | None = None,
149
+ extra_query: Query | None = None,
150
+ extra_body: Body | None = None,
151
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
152
+ ) -> object:
153
+ """
154
+ To retrieve multiple documents by their IDs, the POST method must provide 1) a
155
+ request body containing an array of document IDs in the \\__mget format, 2) a
156
+ bearer token in the Authorization header supplied by HuBMAP. Results are limited
157
+ to those authorized by the bearer token. Uses the <strong>entities</strong>
158
+ index by default
159
+
160
+ Args:
161
+ extra_headers: Send extra headers
162
+
163
+ extra_query: Add additional query parameters to the request
164
+
165
+ extra_body: Add additional JSON properties to the request
166
+
167
+ timeout: Override the client-level default timeout for this request, in seconds
168
+ """
169
+ return await self._post(
170
+ "/mget",
171
+ body=await async_maybe_transform(body, mget_retrieve_multiple_params.MgetRetrieveMultipleParams),
172
+ options=make_request_options(
173
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
174
+ ),
175
+ cast_to=object,
176
+ )
177
+
178
+ async def retrieve_multiple_by_index(
179
+ self,
180
+ index_name: str,
181
+ *,
182
+ body: object,
183
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
184
+ # The extra values given here take precedence over values defined on the client or passed to this method.
185
+ extra_headers: Headers | None = None,
186
+ extra_query: Query | None = None,
187
+ extra_body: Body | None = None,
188
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
189
+ ) -> object:
190
+ """
191
+ To retrieve multiple documents by their IDs, the POST method must provide 1) a
192
+ request body containing an array of document IDs in the \\__mget format, 2) a
193
+ bearer token in the Authorization header supplied by HuBMAP. Results are limited
194
+ to those authorized by the bearer token. Uses the <strong>entities</strong>
195
+ index by default
196
+
197
+ Args:
198
+ extra_headers: Send extra headers
199
+
200
+ extra_query: Add additional query parameters to the request
201
+
202
+ extra_body: Add additional JSON properties to the request
203
+
204
+ timeout: Override the client-level default timeout for this request, in seconds
205
+ """
206
+ if not index_name:
207
+ raise ValueError(f"Expected a non-empty value for `index_name` but received {index_name!r}")
208
+ return await self._post(
209
+ f"/{index_name}/mget",
210
+ body=await async_maybe_transform(
211
+ body, mget_retrieve_multiple_by_index_params.MgetRetrieveMultipleByIndexParams
212
+ ),
213
+ options=make_request_options(
214
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
215
+ ),
216
+ cast_to=object,
217
+ )
218
+
219
+
220
+ class MgetResourceWithRawResponse:
221
+ def __init__(self, mget: MgetResource) -> None:
222
+ self._mget = mget
223
+
224
+ self.retrieve_multiple = to_raw_response_wrapper(
225
+ mget.retrieve_multiple,
226
+ )
227
+ self.retrieve_multiple_by_index = to_raw_response_wrapper(
228
+ mget.retrieve_multiple_by_index,
229
+ )
230
+
231
+
232
+ class AsyncMgetResourceWithRawResponse:
233
+ def __init__(self, mget: AsyncMgetResource) -> None:
234
+ self._mget = mget
235
+
236
+ self.retrieve_multiple = async_to_raw_response_wrapper(
237
+ mget.retrieve_multiple,
238
+ )
239
+ self.retrieve_multiple_by_index = async_to_raw_response_wrapper(
240
+ mget.retrieve_multiple_by_index,
241
+ )
242
+
243
+
244
+ class MgetResourceWithStreamingResponse:
245
+ def __init__(self, mget: MgetResource) -> None:
246
+ self._mget = mget
247
+
248
+ self.retrieve_multiple = to_streamed_response_wrapper(
249
+ mget.retrieve_multiple,
250
+ )
251
+ self.retrieve_multiple_by_index = to_streamed_response_wrapper(
252
+ mget.retrieve_multiple_by_index,
253
+ )
254
+
255
+
256
+ class AsyncMgetResourceWithStreamingResponse:
257
+ def __init__(self, mget: AsyncMgetResource) -> None:
258
+ self._mget = mget
259
+
260
+ self.retrieve_multiple = async_to_streamed_response_wrapper(
261
+ mget.retrieve_multiple,
262
+ )
263
+ self.retrieve_multiple_by_index = async_to_streamed_response_wrapper(
264
+ mget.retrieve_multiple_by_index,
265
+ )
@@ -0,0 +1,197 @@
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 param_search_execute_params
8
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9
+ from .._utils import (
10
+ maybe_transform,
11
+ async_maybe_transform,
12
+ )
13
+ from .._compat import cached_property
14
+ from .._resource import SyncAPIResource, AsyncAPIResource
15
+ from .._response import (
16
+ to_raw_response_wrapper,
17
+ to_streamed_response_wrapper,
18
+ async_to_raw_response_wrapper,
19
+ async_to_streamed_response_wrapper,
20
+ )
21
+ from .._base_client import make_request_options
22
+
23
+ __all__ = ["ParamSearchResource", "AsyncParamSearchResource"]
24
+
25
+
26
+ class ParamSearchResource(SyncAPIResource):
27
+ @cached_property
28
+ def with_raw_response(self) -> ParamSearchResourceWithRawResponse:
29
+ """
30
+ This property can be used as a prefix for any HTTP method call to return
31
+ the raw response object instead of the parsed content.
32
+
33
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
34
+ """
35
+ return ParamSearchResourceWithRawResponse(self)
36
+
37
+ @cached_property
38
+ def with_streaming_response(self) -> ParamSearchResourceWithStreamingResponse:
39
+ """
40
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
41
+
42
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
43
+ """
44
+ return ParamSearchResourceWithStreamingResponse(self)
45
+
46
+ def execute(
47
+ self,
48
+ entity_type: str,
49
+ *,
50
+ produce_clt_manifest: str | NotGiven = NOT_GIVEN,
51
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52
+ # The extra values given here take precedence over values defined on the client or passed to this method.
53
+ extra_headers: Headers | None = None,
54
+ extra_query: Query | None = None,
55
+ extra_body: Body | None = None,
56
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57
+ ) -> object:
58
+ """
59
+ Searches datasets based on the given parameter entity-type ('donor', 'dataset',
60
+ 'sample', etc). GET method must provide a bearer token in the Authorization
61
+ header supplied by HuBMAP. Results are limited to those authorized by the bearer
62
+ token. For more detailed information on using this endpoint see
63
+ [Detailed Param Search Docs](https://docs.hubmapconsortium.org/param-search)
64
+
65
+ Args:
66
+ produce_clt_manifest: An optional parameter that, when set to "true", will make the endpoint return a
67
+ text representation of a manifest file that corresponds with the datasets
68
+ queried rather than the original response
69
+
70
+ extra_headers: Send extra headers
71
+
72
+ extra_query: Add additional query parameters to the request
73
+
74
+ extra_body: Add additional JSON properties to the request
75
+
76
+ timeout: Override the client-level default timeout for this request, in seconds
77
+ """
78
+ if not entity_type:
79
+ raise ValueError(f"Expected a non-empty value for `entity_type` but received {entity_type!r}")
80
+ return self._get(
81
+ f"/param-search/{entity_type}",
82
+ options=make_request_options(
83
+ extra_headers=extra_headers,
84
+ extra_query=extra_query,
85
+ extra_body=extra_body,
86
+ timeout=timeout,
87
+ query=maybe_transform(
88
+ {"produce_clt_manifest": produce_clt_manifest}, param_search_execute_params.ParamSearchExecuteParams
89
+ ),
90
+ ),
91
+ cast_to=object,
92
+ )
93
+
94
+
95
+ class AsyncParamSearchResource(AsyncAPIResource):
96
+ @cached_property
97
+ def with_raw_response(self) -> AsyncParamSearchResourceWithRawResponse:
98
+ """
99
+ This property can be used as a prefix for any HTTP method call to return
100
+ the raw response object instead of the parsed content.
101
+
102
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
103
+ """
104
+ return AsyncParamSearchResourceWithRawResponse(self)
105
+
106
+ @cached_property
107
+ def with_streaming_response(self) -> AsyncParamSearchResourceWithStreamingResponse:
108
+ """
109
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
110
+
111
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
112
+ """
113
+ return AsyncParamSearchResourceWithStreamingResponse(self)
114
+
115
+ async def execute(
116
+ self,
117
+ entity_type: str,
118
+ *,
119
+ produce_clt_manifest: str | NotGiven = NOT_GIVEN,
120
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
121
+ # The extra values given here take precedence over values defined on the client or passed to this method.
122
+ extra_headers: Headers | None = None,
123
+ extra_query: Query | None = None,
124
+ extra_body: Body | None = None,
125
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
126
+ ) -> object:
127
+ """
128
+ Searches datasets based on the given parameter entity-type ('donor', 'dataset',
129
+ 'sample', etc). GET method must provide a bearer token in the Authorization
130
+ header supplied by HuBMAP. Results are limited to those authorized by the bearer
131
+ token. For more detailed information on using this endpoint see
132
+ [Detailed Param Search Docs](https://docs.hubmapconsortium.org/param-search)
133
+
134
+ Args:
135
+ produce_clt_manifest: An optional parameter that, when set to "true", will make the endpoint return a
136
+ text representation of a manifest file that corresponds with the datasets
137
+ queried rather than the original response
138
+
139
+ extra_headers: Send extra headers
140
+
141
+ extra_query: Add additional query parameters to the request
142
+
143
+ extra_body: Add additional JSON properties to the request
144
+
145
+ timeout: Override the client-level default timeout for this request, in seconds
146
+ """
147
+ if not entity_type:
148
+ raise ValueError(f"Expected a non-empty value for `entity_type` but received {entity_type!r}")
149
+ return await self._get(
150
+ f"/param-search/{entity_type}",
151
+ options=make_request_options(
152
+ extra_headers=extra_headers,
153
+ extra_query=extra_query,
154
+ extra_body=extra_body,
155
+ timeout=timeout,
156
+ query=await async_maybe_transform(
157
+ {"produce_clt_manifest": produce_clt_manifest}, param_search_execute_params.ParamSearchExecuteParams
158
+ ),
159
+ ),
160
+ cast_to=object,
161
+ )
162
+
163
+
164
+ class ParamSearchResourceWithRawResponse:
165
+ def __init__(self, param_search: ParamSearchResource) -> None:
166
+ self._param_search = param_search
167
+
168
+ self.execute = to_raw_response_wrapper(
169
+ param_search.execute,
170
+ )
171
+
172
+
173
+ class AsyncParamSearchResourceWithRawResponse:
174
+ def __init__(self, param_search: AsyncParamSearchResource) -> None:
175
+ self._param_search = param_search
176
+
177
+ self.execute = async_to_raw_response_wrapper(
178
+ param_search.execute,
179
+ )
180
+
181
+
182
+ class ParamSearchResourceWithStreamingResponse:
183
+ def __init__(self, param_search: ParamSearchResource) -> None:
184
+ self._param_search = param_search
185
+
186
+ self.execute = to_streamed_response_wrapper(
187
+ param_search.execute,
188
+ )
189
+
190
+
191
+ class AsyncParamSearchResourceWithStreamingResponse:
192
+ def __init__(self, param_search: AsyncParamSearchResource) -> None:
193
+ self._param_search = param_search
194
+
195
+ self.execute = async_to_streamed_response_wrapper(
196
+ param_search.execute,
197
+ )
@@ -0,0 +1,164 @@
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__ = ["ReindexResource", "AsyncReindexResource"]
19
+
20
+
21
+ class ReindexResource(SyncAPIResource):
22
+ @cached_property
23
+ def with_raw_response(self) -> ReindexResourceWithRawResponse:
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 ReindexResourceWithRawResponse(self)
31
+
32
+ @cached_property
33
+ def with_streaming_response(self) -> ReindexResourceWithStreamingResponse:
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 ReindexResourceWithStreamingResponse(self)
40
+
41
+ def update(
42
+ self,
43
+ identifier: 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
+ Reindex for a given UUID of dataset
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 identifier:
65
+ raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
66
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
67
+ return self._put(
68
+ f"/reindex/{identifier}",
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
+
76
+ class AsyncReindexResource(AsyncAPIResource):
77
+ @cached_property
78
+ def with_raw_response(self) -> AsyncReindexResourceWithRawResponse:
79
+ """
80
+ This property can be used as a prefix for any HTTP method call to return
81
+ the raw response object instead of the parsed content.
82
+
83
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#accessing-raw-response-data-eg-headers
84
+ """
85
+ return AsyncReindexResourceWithRawResponse(self)
86
+
87
+ @cached_property
88
+ def with_streaming_response(self) -> AsyncReindexResourceWithStreamingResponse:
89
+ """
90
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
91
+
92
+ For more information, see https://www.github.com/hubmapconsortium/search-python-sdk#with_streaming_response
93
+ """
94
+ return AsyncReindexResourceWithStreamingResponse(self)
95
+
96
+ async def update(
97
+ self,
98
+ identifier: str,
99
+ *,
100
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
101
+ # The extra values given here take precedence over values defined on the client or passed to this method.
102
+ extra_headers: Headers | None = None,
103
+ extra_query: Query | None = None,
104
+ extra_body: Body | None = None,
105
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
106
+ ) -> None:
107
+ """
108
+ Reindex for a given UUID of dataset
109
+
110
+ Args:
111
+ extra_headers: Send extra headers
112
+
113
+ extra_query: Add additional query parameters to the request
114
+
115
+ extra_body: Add additional JSON properties to the request
116
+
117
+ timeout: Override the client-level default timeout for this request, in seconds
118
+ """
119
+ if not identifier:
120
+ raise ValueError(f"Expected a non-empty value for `identifier` but received {identifier!r}")
121
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
122
+ return await self._put(
123
+ f"/reindex/{identifier}",
124
+ options=make_request_options(
125
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
126
+ ),
127
+ cast_to=NoneType,
128
+ )
129
+
130
+
131
+ class ReindexResourceWithRawResponse:
132
+ def __init__(self, reindex: ReindexResource) -> None:
133
+ self._reindex = reindex
134
+
135
+ self.update = to_raw_response_wrapper(
136
+ reindex.update,
137
+ )
138
+
139
+
140
+ class AsyncReindexResourceWithRawResponse:
141
+ def __init__(self, reindex: AsyncReindexResource) -> None:
142
+ self._reindex = reindex
143
+
144
+ self.update = async_to_raw_response_wrapper(
145
+ reindex.update,
146
+ )
147
+
148
+
149
+ class ReindexResourceWithStreamingResponse:
150
+ def __init__(self, reindex: ReindexResource) -> None:
151
+ self._reindex = reindex
152
+
153
+ self.update = to_streamed_response_wrapper(
154
+ reindex.update,
155
+ )
156
+
157
+
158
+ class AsyncReindexResourceWithStreamingResponse:
159
+ def __init__(self, reindex: AsyncReindexResource) -> None:
160
+ self._reindex = reindex
161
+
162
+ self.update = async_to_streamed_response_wrapper(
163
+ reindex.update,
164
+ )