groundx 2.3.3__py3-none-any.whl → 2.3.5__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.
- groundx/__init__.py +2 -0
- groundx/buckets/__init__.py +2 -0
- groundx/buckets/client.py +47 -366
- groundx/buckets/raw_client.py +628 -0
- groundx/client.py +15 -17
- groundx/core/__init__.py +5 -0
- groundx/core/api_error.py +13 -5
- groundx/core/client_wrapper.py +4 -3
- groundx/core/force_multipart.py +16 -0
- groundx/core/http_client.py +70 -26
- groundx/core/http_response.py +55 -0
- groundx/core/jsonable_encoder.py +0 -1
- groundx/core/pydantic_utilities.py +69 -110
- groundx/core/serialization.py +7 -3
- groundx/customer/__init__.py +2 -0
- groundx/customer/client.py +31 -43
- groundx/customer/raw_client.py +91 -0
- groundx/documents/__init__.py +2 -0
- groundx/documents/client.py +100 -780
- groundx/documents/raw_client.py +1404 -0
- groundx/errors/__init__.py +2 -0
- groundx/errors/bad_request_error.py +4 -3
- groundx/errors/unauthorized_error.py +4 -3
- groundx/groups/__init__.py +2 -0
- groundx/groups/client.py +55 -520
- groundx/groups/raw_client.py +901 -0
- groundx/health/__init__.py +2 -0
- groundx/health/client.py +35 -101
- groundx/health/raw_client.py +193 -0
- groundx/search/__init__.py +2 -0
- groundx/search/client.py +64 -213
- groundx/search/raw_client.py +442 -0
- groundx/search/types/__init__.py +2 -0
- groundx/types/__init__.py +2 -0
- groundx/types/bounding_box_detail.py +4 -4
- groundx/types/bucket_detail.py +5 -5
- groundx/types/bucket_list_response.py +3 -3
- groundx/types/bucket_response.py +3 -3
- groundx/types/bucket_update_detail.py +4 -4
- groundx/types/bucket_update_response.py +3 -3
- groundx/types/customer_detail.py +2 -2
- groundx/types/customer_response.py +3 -3
- groundx/types/document.py +4 -4
- groundx/types/document_detail.py +4 -4
- groundx/types/document_list_response.py +4 -4
- groundx/types/document_local_ingest_request.py +1 -0
- groundx/types/document_lookup_response.py +3 -3
- groundx/types/document_response.py +3 -3
- groundx/types/group_detail.py +4 -4
- groundx/types/group_list_response.py +3 -3
- groundx/types/group_response.py +3 -3
- groundx/types/health_response.py +3 -3
- groundx/types/health_response_health.py +3 -3
- groundx/types/health_service.py +5 -5
- groundx/types/ingest_local_document.py +3 -3
- groundx/types/ingest_local_document_metadata.py +4 -4
- groundx/types/ingest_remote_document.py +4 -4
- groundx/types/ingest_response.py +3 -3
- groundx/types/ingest_status.py +3 -3
- groundx/types/ingest_status_light.py +3 -3
- groundx/types/ingest_status_progress.py +3 -3
- groundx/types/ingest_status_progress_cancelled.py +3 -3
- groundx/types/ingest_status_progress_complete.py +3 -3
- groundx/types/ingest_status_progress_errors.py +3 -3
- groundx/types/ingest_status_progress_processing.py +3 -3
- groundx/types/message_response.py +2 -2
- groundx/types/meter_detail.py +2 -2
- groundx/types/processes_status_response.py +3 -3
- groundx/types/search_response.py +3 -3
- groundx/types/search_response_search.py +3 -3
- groundx/types/search_result_item.py +5 -5
- groundx/types/subscription_detail.py +3 -3
- groundx/types/subscription_detail_meters.py +5 -5
- groundx/types/website_source.py +4 -4
- {groundx-2.3.3.dist-info → groundx-2.3.5.dist-info}/METADATA +1 -1
- groundx-2.3.5.dist-info/RECORD +95 -0
- groundx-2.3.3.dist-info/RECORD +0 -87
- {groundx-2.3.3.dist-info → groundx-2.3.5.dist-info}/LICENSE +0 -0
- {groundx-2.3.3.dist-info → groundx-2.3.5.dist-info}/WHEEL +0 -0
groundx/health/__init__.py
CHANGED
groundx/health/client.py
CHANGED
@@ -1,20 +1,27 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from ..core.client_wrapper import SyncClientWrapper
|
4
3
|
import typing
|
4
|
+
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
5
6
|
from ..core.request_options import RequestOptions
|
6
7
|
from ..types.health_response import HealthResponse
|
7
|
-
from
|
8
|
-
from json.decoder import JSONDecodeError
|
9
|
-
from ..core.api_error import ApiError
|
10
|
-
from ..core.jsonable_encoder import jsonable_encoder
|
11
|
-
from ..errors.bad_request_error import BadRequestError
|
12
|
-
from ..core.client_wrapper import AsyncClientWrapper
|
8
|
+
from .raw_client import AsyncRawHealthClient, RawHealthClient
|
13
9
|
|
14
10
|
|
15
11
|
class HealthClient:
|
16
12
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
17
|
-
self.
|
13
|
+
self._raw_client = RawHealthClient(client_wrapper=client_wrapper)
|
14
|
+
|
15
|
+
@property
|
16
|
+
def with_raw_response(self) -> RawHealthClient:
|
17
|
+
"""
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
19
|
+
|
20
|
+
Returns
|
21
|
+
-------
|
22
|
+
RawHealthClient
|
23
|
+
"""
|
24
|
+
return self._raw_client
|
18
25
|
|
19
26
|
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
|
20
27
|
"""
|
@@ -39,24 +46,8 @@ class HealthClient:
|
|
39
46
|
)
|
40
47
|
client.health.list()
|
41
48
|
"""
|
42
|
-
_response = self.
|
43
|
-
|
44
|
-
method="GET",
|
45
|
-
request_options=request_options,
|
46
|
-
)
|
47
|
-
try:
|
48
|
-
if 200 <= _response.status_code < 300:
|
49
|
-
return typing.cast(
|
50
|
-
HealthResponse,
|
51
|
-
parse_obj_as(
|
52
|
-
type_=HealthResponse, # type: ignore
|
53
|
-
object_=_response.json(),
|
54
|
-
),
|
55
|
-
)
|
56
|
-
_response_json = _response.json()
|
57
|
-
except JSONDecodeError:
|
58
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
59
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
49
|
+
_response = self._raw_client.list(request_options=request_options)
|
50
|
+
return _response.data
|
60
51
|
|
61
52
|
def get(self, service: str, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
|
62
53
|
"""
|
@@ -86,39 +77,24 @@ class HealthClient:
|
|
86
77
|
service="search",
|
87
78
|
)
|
88
79
|
"""
|
89
|
-
_response = self.
|
90
|
-
|
91
|
-
method="GET",
|
92
|
-
request_options=request_options,
|
93
|
-
)
|
94
|
-
try:
|
95
|
-
if 200 <= _response.status_code < 300:
|
96
|
-
return typing.cast(
|
97
|
-
HealthResponse,
|
98
|
-
parse_obj_as(
|
99
|
-
type_=HealthResponse, # type: ignore
|
100
|
-
object_=_response.json(),
|
101
|
-
),
|
102
|
-
)
|
103
|
-
if _response.status_code == 400:
|
104
|
-
raise BadRequestError(
|
105
|
-
typing.cast(
|
106
|
-
typing.Optional[typing.Any],
|
107
|
-
parse_obj_as(
|
108
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
109
|
-
object_=_response.json(),
|
110
|
-
),
|
111
|
-
)
|
112
|
-
)
|
113
|
-
_response_json = _response.json()
|
114
|
-
except JSONDecodeError:
|
115
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
116
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
80
|
+
_response = self._raw_client.get(service, request_options=request_options)
|
81
|
+
return _response.data
|
117
82
|
|
118
83
|
|
119
84
|
class AsyncHealthClient:
|
120
85
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
121
|
-
self.
|
86
|
+
self._raw_client = AsyncRawHealthClient(client_wrapper=client_wrapper)
|
87
|
+
|
88
|
+
@property
|
89
|
+
def with_raw_response(self) -> AsyncRawHealthClient:
|
90
|
+
"""
|
91
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
92
|
+
|
93
|
+
Returns
|
94
|
+
-------
|
95
|
+
AsyncRawHealthClient
|
96
|
+
"""
|
97
|
+
return self._raw_client
|
122
98
|
|
123
99
|
async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
|
124
100
|
"""
|
@@ -151,24 +127,8 @@ class AsyncHealthClient:
|
|
151
127
|
|
152
128
|
asyncio.run(main())
|
153
129
|
"""
|
154
|
-
_response = await self.
|
155
|
-
|
156
|
-
method="GET",
|
157
|
-
request_options=request_options,
|
158
|
-
)
|
159
|
-
try:
|
160
|
-
if 200 <= _response.status_code < 300:
|
161
|
-
return typing.cast(
|
162
|
-
HealthResponse,
|
163
|
-
parse_obj_as(
|
164
|
-
type_=HealthResponse, # type: ignore
|
165
|
-
object_=_response.json(),
|
166
|
-
),
|
167
|
-
)
|
168
|
-
_response_json = _response.json()
|
169
|
-
except JSONDecodeError:
|
170
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
171
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
130
|
+
_response = await self._raw_client.list(request_options=request_options)
|
131
|
+
return _response.data
|
172
132
|
|
173
133
|
async def get(self, service: str, *, request_options: typing.Optional[RequestOptions] = None) -> HealthResponse:
|
174
134
|
"""
|
@@ -206,31 +166,5 @@ class AsyncHealthClient:
|
|
206
166
|
|
207
167
|
asyncio.run(main())
|
208
168
|
"""
|
209
|
-
_response = await self.
|
210
|
-
|
211
|
-
method="GET",
|
212
|
-
request_options=request_options,
|
213
|
-
)
|
214
|
-
try:
|
215
|
-
if 200 <= _response.status_code < 300:
|
216
|
-
return typing.cast(
|
217
|
-
HealthResponse,
|
218
|
-
parse_obj_as(
|
219
|
-
type_=HealthResponse, # type: ignore
|
220
|
-
object_=_response.json(),
|
221
|
-
),
|
222
|
-
)
|
223
|
-
if _response.status_code == 400:
|
224
|
-
raise BadRequestError(
|
225
|
-
typing.cast(
|
226
|
-
typing.Optional[typing.Any],
|
227
|
-
parse_obj_as(
|
228
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
229
|
-
object_=_response.json(),
|
230
|
-
),
|
231
|
-
)
|
232
|
-
)
|
233
|
-
_response_json = _response.json()
|
234
|
-
except JSONDecodeError:
|
235
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
236
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
169
|
+
_response = await self._raw_client.get(service, request_options=request_options)
|
170
|
+
return _response.data
|
@@ -0,0 +1,193 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
from json.decoder import JSONDecodeError
|
5
|
+
|
6
|
+
from ..core.api_error import ApiError
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
9
|
+
from ..core.jsonable_encoder import jsonable_encoder
|
10
|
+
from ..core.pydantic_utilities import parse_obj_as
|
11
|
+
from ..core.request_options import RequestOptions
|
12
|
+
from ..errors.bad_request_error import BadRequestError
|
13
|
+
from ..types.health_response import HealthResponse
|
14
|
+
|
15
|
+
|
16
|
+
class RawHealthClient:
|
17
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
18
|
+
self._client_wrapper = client_wrapper
|
19
|
+
|
20
|
+
def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[HealthResponse]:
|
21
|
+
"""
|
22
|
+
List the current health status of all services. Statuses update every 5 minutes.
|
23
|
+
|
24
|
+
Parameters
|
25
|
+
----------
|
26
|
+
request_options : typing.Optional[RequestOptions]
|
27
|
+
Request-specific configuration.
|
28
|
+
|
29
|
+
Returns
|
30
|
+
-------
|
31
|
+
HttpResponse[HealthResponse]
|
32
|
+
Look up success
|
33
|
+
"""
|
34
|
+
_response = self._client_wrapper.httpx_client.request(
|
35
|
+
"v1/health",
|
36
|
+
method="GET",
|
37
|
+
request_options=request_options,
|
38
|
+
)
|
39
|
+
try:
|
40
|
+
if 200 <= _response.status_code < 300:
|
41
|
+
_data = typing.cast(
|
42
|
+
HealthResponse,
|
43
|
+
parse_obj_as(
|
44
|
+
type_=HealthResponse, # type: ignore
|
45
|
+
object_=_response.json(),
|
46
|
+
),
|
47
|
+
)
|
48
|
+
return HttpResponse(response=_response, data=_data)
|
49
|
+
_response_json = _response.json()
|
50
|
+
except JSONDecodeError:
|
51
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
52
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
53
|
+
|
54
|
+
def get(
|
55
|
+
self, service: str, *, request_options: typing.Optional[RequestOptions] = None
|
56
|
+
) -> HttpResponse[HealthResponse]:
|
57
|
+
"""
|
58
|
+
Look up the current health status of a specific service. Statuses update every 5 minutes.
|
59
|
+
|
60
|
+
Parameters
|
61
|
+
----------
|
62
|
+
service : str
|
63
|
+
The name of the service to look up.
|
64
|
+
|
65
|
+
request_options : typing.Optional[RequestOptions]
|
66
|
+
Request-specific configuration.
|
67
|
+
|
68
|
+
Returns
|
69
|
+
-------
|
70
|
+
HttpResponse[HealthResponse]
|
71
|
+
Look up success
|
72
|
+
"""
|
73
|
+
_response = self._client_wrapper.httpx_client.request(
|
74
|
+
f"v1/health/{jsonable_encoder(service)}",
|
75
|
+
method="GET",
|
76
|
+
request_options=request_options,
|
77
|
+
)
|
78
|
+
try:
|
79
|
+
if 200 <= _response.status_code < 300:
|
80
|
+
_data = typing.cast(
|
81
|
+
HealthResponse,
|
82
|
+
parse_obj_as(
|
83
|
+
type_=HealthResponse, # type: ignore
|
84
|
+
object_=_response.json(),
|
85
|
+
),
|
86
|
+
)
|
87
|
+
return HttpResponse(response=_response, data=_data)
|
88
|
+
if _response.status_code == 400:
|
89
|
+
raise BadRequestError(
|
90
|
+
headers=dict(_response.headers),
|
91
|
+
body=typing.cast(
|
92
|
+
typing.Optional[typing.Any],
|
93
|
+
parse_obj_as(
|
94
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
95
|
+
object_=_response.json(),
|
96
|
+
),
|
97
|
+
),
|
98
|
+
)
|
99
|
+
_response_json = _response.json()
|
100
|
+
except JSONDecodeError:
|
101
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
102
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
103
|
+
|
104
|
+
|
105
|
+
class AsyncRawHealthClient:
|
106
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
107
|
+
self._client_wrapper = client_wrapper
|
108
|
+
|
109
|
+
async def list(
|
110
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
111
|
+
) -> AsyncHttpResponse[HealthResponse]:
|
112
|
+
"""
|
113
|
+
List the current health status of all services. Statuses update every 5 minutes.
|
114
|
+
|
115
|
+
Parameters
|
116
|
+
----------
|
117
|
+
request_options : typing.Optional[RequestOptions]
|
118
|
+
Request-specific configuration.
|
119
|
+
|
120
|
+
Returns
|
121
|
+
-------
|
122
|
+
AsyncHttpResponse[HealthResponse]
|
123
|
+
Look up success
|
124
|
+
"""
|
125
|
+
_response = await self._client_wrapper.httpx_client.request(
|
126
|
+
"v1/health",
|
127
|
+
method="GET",
|
128
|
+
request_options=request_options,
|
129
|
+
)
|
130
|
+
try:
|
131
|
+
if 200 <= _response.status_code < 300:
|
132
|
+
_data = typing.cast(
|
133
|
+
HealthResponse,
|
134
|
+
parse_obj_as(
|
135
|
+
type_=HealthResponse, # type: ignore
|
136
|
+
object_=_response.json(),
|
137
|
+
),
|
138
|
+
)
|
139
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
140
|
+
_response_json = _response.json()
|
141
|
+
except JSONDecodeError:
|
142
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
143
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
144
|
+
|
145
|
+
async def get(
|
146
|
+
self, service: str, *, request_options: typing.Optional[RequestOptions] = None
|
147
|
+
) -> AsyncHttpResponse[HealthResponse]:
|
148
|
+
"""
|
149
|
+
Look up the current health status of a specific service. Statuses update every 5 minutes.
|
150
|
+
|
151
|
+
Parameters
|
152
|
+
----------
|
153
|
+
service : str
|
154
|
+
The name of the service to look up.
|
155
|
+
|
156
|
+
request_options : typing.Optional[RequestOptions]
|
157
|
+
Request-specific configuration.
|
158
|
+
|
159
|
+
Returns
|
160
|
+
-------
|
161
|
+
AsyncHttpResponse[HealthResponse]
|
162
|
+
Look up success
|
163
|
+
"""
|
164
|
+
_response = await self._client_wrapper.httpx_client.request(
|
165
|
+
f"v1/health/{jsonable_encoder(service)}",
|
166
|
+
method="GET",
|
167
|
+
request_options=request_options,
|
168
|
+
)
|
169
|
+
try:
|
170
|
+
if 200 <= _response.status_code < 300:
|
171
|
+
_data = typing.cast(
|
172
|
+
HealthResponse,
|
173
|
+
parse_obj_as(
|
174
|
+
type_=HealthResponse, # type: ignore
|
175
|
+
object_=_response.json(),
|
176
|
+
),
|
177
|
+
)
|
178
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
179
|
+
if _response.status_code == 400:
|
180
|
+
raise BadRequestError(
|
181
|
+
headers=dict(_response.headers),
|
182
|
+
body=typing.cast(
|
183
|
+
typing.Optional[typing.Any],
|
184
|
+
parse_obj_as(
|
185
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
186
|
+
object_=_response.json(),
|
187
|
+
),
|
188
|
+
),
|
189
|
+
)
|
190
|
+
_response_json = _response.json()
|
191
|
+
except JSONDecodeError:
|
192
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
193
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|