groundx 2.0.15__py3-none-any.whl → 2.7.7__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 (147) hide show
  1. groundx/__init__.py +73 -21
  2. groundx/buckets/__init__.py +2 -0
  3. groundx/buckets/client.py +55 -388
  4. groundx/buckets/raw_client.py +628 -0
  5. groundx/client.py +22 -21
  6. groundx/core/__init__.py +5 -0
  7. groundx/core/api_error.py +13 -5
  8. groundx/core/client_wrapper.py +4 -3
  9. groundx/core/force_multipart.py +16 -0
  10. groundx/core/http_client.py +76 -32
  11. groundx/core/http_response.py +55 -0
  12. groundx/core/jsonable_encoder.py +0 -1
  13. groundx/core/pydantic_utilities.py +71 -112
  14. groundx/core/serialization.py +7 -3
  15. groundx/csv_splitter.py +64 -0
  16. groundx/customer/__init__.py +2 -0
  17. groundx/customer/client.py +31 -43
  18. groundx/customer/raw_client.py +91 -0
  19. groundx/documents/__init__.py +1 -2
  20. groundx/documents/client.py +455 -953
  21. groundx/documents/raw_client.py +1450 -0
  22. groundx/errors/__init__.py +2 -0
  23. groundx/errors/bad_request_error.py +4 -3
  24. groundx/errors/unauthorized_error.py +4 -3
  25. groundx/extract/__init__.py +48 -0
  26. groundx/extract/agents/__init__.py +7 -0
  27. groundx/extract/agents/agent.py +202 -0
  28. groundx/extract/classes/__init__.py +24 -0
  29. groundx/extract/classes/agent.py +23 -0
  30. groundx/extract/classes/api.py +15 -0
  31. groundx/extract/classes/document.py +338 -0
  32. groundx/extract/classes/field.py +88 -0
  33. groundx/extract/classes/groundx.py +147 -0
  34. groundx/extract/classes/prompt.py +36 -0
  35. groundx/extract/classes/test_document.py +109 -0
  36. groundx/extract/classes/test_field.py +43 -0
  37. groundx/extract/classes/test_groundx.py +223 -0
  38. groundx/extract/classes/test_prompt.py +68 -0
  39. groundx/extract/post_process/__init__.py +7 -0
  40. groundx/extract/post_process/post_process.py +33 -0
  41. groundx/extract/services/.DS_Store +0 -0
  42. groundx/extract/services/__init__.py +14 -0
  43. groundx/extract/services/csv.py +76 -0
  44. groundx/extract/services/logger.py +126 -0
  45. groundx/extract/services/logging_cfg.py +53 -0
  46. groundx/extract/services/ratelimit.py +104 -0
  47. groundx/extract/services/sheets_client.py +160 -0
  48. groundx/extract/services/status.py +197 -0
  49. groundx/extract/services/upload.py +68 -0
  50. groundx/extract/services/upload_minio.py +122 -0
  51. groundx/extract/services/upload_s3.py +91 -0
  52. groundx/extract/services/utility.py +52 -0
  53. groundx/extract/settings/__init__.py +15 -0
  54. groundx/extract/settings/settings.py +212 -0
  55. groundx/extract/settings/test_settings.py +512 -0
  56. groundx/extract/tasks/__init__.py +6 -0
  57. groundx/extract/tasks/utility.py +27 -0
  58. groundx/extract/utility/__init__.py +15 -0
  59. groundx/extract/utility/classes.py +193 -0
  60. groundx/extract/utility/test_utility.py +81 -0
  61. groundx/groups/__init__.py +2 -0
  62. groundx/groups/client.py +63 -550
  63. groundx/groups/raw_client.py +901 -0
  64. groundx/health/__init__.py +2 -0
  65. groundx/health/client.py +35 -101
  66. groundx/health/raw_client.py +193 -0
  67. groundx/ingest.py +771 -0
  68. groundx/search/__init__.py +2 -0
  69. groundx/search/client.py +94 -227
  70. groundx/search/raw_client.py +442 -0
  71. groundx/search/types/__init__.py +2 -0
  72. groundx/types/__init__.py +68 -16
  73. groundx/types/bounding_box_detail.py +4 -4
  74. groundx/types/bucket_detail.py +5 -5
  75. groundx/types/bucket_list_response.py +17 -3
  76. groundx/types/bucket_response.py +3 -3
  77. groundx/types/bucket_update_detail.py +4 -4
  78. groundx/types/bucket_update_response.py +3 -3
  79. groundx/types/customer_detail.py +2 -2
  80. groundx/types/customer_response.py +3 -3
  81. groundx/types/document.py +54 -0
  82. groundx/types/document_detail.py +16 -4
  83. groundx/types/document_list_response.py +4 -4
  84. groundx/types/document_local_ingest_request.py +7 -0
  85. groundx/types/document_lookup_response.py +8 -3
  86. groundx/types/document_response.py +3 -3
  87. groundx/types/document_type.py +21 -1
  88. groundx/types/group_detail.py +4 -4
  89. groundx/types/group_list_response.py +17 -3
  90. groundx/types/group_response.py +3 -3
  91. groundx/types/health_response.py +3 -3
  92. groundx/types/health_response_health.py +3 -3
  93. groundx/types/health_service.py +5 -5
  94. groundx/types/ingest_local_document.py +25 -0
  95. groundx/types/ingest_local_document_metadata.py +51 -0
  96. groundx/types/ingest_remote_document.py +15 -6
  97. groundx/types/ingest_response.py +4 -4
  98. groundx/types/{process_status_response_ingest.py → ingest_status.py} +8 -7
  99. groundx/types/{ingest_response_ingest.py → ingest_status_light.py} +7 -5
  100. groundx/types/ingest_status_progress.py +26 -0
  101. groundx/types/{process_status_response_ingest_progress_errors.py → ingest_status_progress_cancelled.py} +4 -4
  102. groundx/types/{process_status_response_ingest_progress_complete.py → ingest_status_progress_complete.py} +4 -4
  103. groundx/types/{process_status_response_ingest_progress_cancelled.py → ingest_status_progress_errors.py} +4 -4
  104. groundx/types/{process_status_response_ingest_progress_processing.py → ingest_status_progress_processing.py} +4 -4
  105. groundx/types/message_response.py +2 -2
  106. groundx/types/meter_detail.py +2 -2
  107. groundx/types/process_level.py +5 -0
  108. groundx/types/{process_status_response.py → processes_status_response.py} +8 -5
  109. groundx/types/processing_status.py +3 -1
  110. groundx/types/search_response.py +3 -3
  111. groundx/types/search_response_search.py +3 -3
  112. groundx/types/search_result_item.py +7 -5
  113. groundx/types/search_result_item_pages_item.py +41 -0
  114. groundx/types/subscription_detail.py +3 -3
  115. groundx/types/subscription_detail_meters.py +5 -5
  116. groundx/{documents/types/website_crawl_request_websites_item.py → types/website_source.py} +7 -7
  117. groundx/types/workflow_apply_request.py +24 -0
  118. groundx/types/workflow_detail.py +59 -0
  119. groundx/types/workflow_detail_chunk_strategy.py +5 -0
  120. groundx/types/workflow_detail_relationships.py +36 -0
  121. groundx/types/workflow_engine.py +58 -0
  122. groundx/types/workflow_engine_reasoning_effort.py +5 -0
  123. groundx/types/workflow_engine_service.py +7 -0
  124. groundx/types/workflow_prompt.py +37 -0
  125. groundx/types/workflow_prompt_group.py +25 -0
  126. groundx/types/workflow_prompt_role.py +5 -0
  127. groundx/types/workflow_request.py +31 -0
  128. groundx/types/workflow_request_chunk_strategy.py +5 -0
  129. groundx/types/workflow_response.py +20 -0
  130. groundx/types/workflow_step.py +33 -0
  131. groundx/types/workflow_step_config.py +33 -0
  132. groundx/types/workflow_step_config_field.py +8 -0
  133. groundx/types/workflow_steps.py +38 -0
  134. groundx/types/workflows_response.py +20 -0
  135. groundx/workflows/__init__.py +7 -0
  136. groundx/workflows/client.py +736 -0
  137. groundx/workflows/raw_client.py +841 -0
  138. groundx/workflows/types/__init__.py +7 -0
  139. groundx/workflows/types/workflows_get_request_id.py +5 -0
  140. {groundx-2.0.15.dist-info → groundx-2.7.7.dist-info}/LICENSE +1 -1
  141. {groundx-2.0.15.dist-info → groundx-2.7.7.dist-info}/METADATA +39 -22
  142. groundx-2.7.7.dist-info/RECORD +155 -0
  143. groundx/documents/types/__init__.py +0 -6
  144. groundx/documents/types/documents_ingest_local_request_files_item.py +0 -43
  145. groundx/types/process_status_response_ingest_progress.py +0 -26
  146. groundx-2.0.15.dist-info/RECORD +0 -82
  147. {groundx-2.0.15.dist-info → groundx-2.7.7.dist-info}/WHEEL +0 -0
groundx/buckets/client.py CHANGED
@@ -1,19 +1,14 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
3
  import typing
4
- from ..core.client_wrapper import SyncClientWrapper
4
+
5
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
5
6
  from ..core.request_options import RequestOptions
6
7
  from ..types.bucket_list_response import BucketListResponse
7
- from ..core.pydantic_utilities import parse_obj_as
8
- from json.decoder import JSONDecodeError
9
- from ..core.api_error import ApiError
10
8
  from ..types.bucket_response import BucketResponse
11
- from ..errors.bad_request_error import BadRequestError
12
- from ..core.jsonable_encoder import jsonable_encoder
13
- from ..errors.unauthorized_error import UnauthorizedError
14
9
  from ..types.bucket_update_response import BucketUpdateResponse
15
10
  from ..types.message_response import MessageResponse
16
- from ..core.client_wrapper import AsyncClientWrapper
11
+ from .raw_client import AsyncRawBucketsClient, RawBucketsClient
17
12
 
18
13
  # this is used as the default value for optional parameters
19
14
  OMIT = typing.cast(typing.Any, ...)
@@ -21,7 +16,18 @@ OMIT = typing.cast(typing.Any, ...)
21
16
 
22
17
  class BucketsClient:
23
18
  def __init__(self, *, client_wrapper: SyncClientWrapper):
24
- self._client_wrapper = client_wrapper
19
+ self._raw_client = RawBucketsClient(client_wrapper=client_wrapper)
20
+
21
+ @property
22
+ def with_raw_response(self) -> RawBucketsClient:
23
+ """
24
+ Retrieves a raw implementation of this client that returns raw responses.
25
+
26
+ Returns
27
+ -------
28
+ RawBucketsClient
29
+ """
30
+ return self._raw_client
25
31
 
26
32
  def list(
27
33
  self,
@@ -33,8 +39,6 @@ class BucketsClient:
33
39
  """
34
40
  List all buckets within your GroundX account
35
41
 
36
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
37
-
38
42
  Parameters
39
43
  ----------
40
44
  n : typing.Optional[int]
@@ -58,37 +62,18 @@ class BucketsClient:
58
62
  client = GroundX(
59
63
  api_key="YOUR_API_KEY",
60
64
  )
61
- client.buckets.list()
62
- """
63
- _response = self._client_wrapper.httpx_client.request(
64
- "v1/bucket",
65
- method="GET",
66
- params={
67
- "n": n,
68
- "nextToken": next_token,
69
- },
70
- request_options=request_options,
65
+ client.buckets.list(
66
+ n=1,
67
+ next_token="nextToken",
71
68
  )
72
- try:
73
- if 200 <= _response.status_code < 300:
74
- return typing.cast(
75
- BucketListResponse,
76
- parse_obj_as(
77
- type_=BucketListResponse, # type: ignore
78
- object_=_response.json(),
79
- ),
80
- )
81
- _response_json = _response.json()
82
- except JSONDecodeError:
83
- raise ApiError(status_code=_response.status_code, body=_response.text)
84
- raise ApiError(status_code=_response.status_code, body=_response_json)
69
+ """
70
+ _response = self._raw_client.list(n=n, next_token=next_token, request_options=request_options)
71
+ return _response.data
85
72
 
86
73
  def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
87
74
  """
88
75
  Create a new bucket.
89
76
 
90
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
91
-
92
77
  Parameters
93
78
  ----------
94
79
  name : str
@@ -112,48 +97,13 @@ class BucketsClient:
112
97
  name="your_bucket_name",
113
98
  )
114
99
  """
115
- _response = self._client_wrapper.httpx_client.request(
116
- "v1/bucket",
117
- method="POST",
118
- json={
119
- "name": name,
120
- },
121
- headers={
122
- "content-type": "application/json",
123
- },
124
- request_options=request_options,
125
- omit=OMIT,
126
- )
127
- try:
128
- if 200 <= _response.status_code < 300:
129
- return typing.cast(
130
- BucketResponse,
131
- parse_obj_as(
132
- type_=BucketResponse, # type: ignore
133
- object_=_response.json(),
134
- ),
135
- )
136
- if _response.status_code == 400:
137
- raise BadRequestError(
138
- typing.cast(
139
- typing.Optional[typing.Any],
140
- parse_obj_as(
141
- type_=typing.Optional[typing.Any], # type: ignore
142
- object_=_response.json(),
143
- ),
144
- )
145
- )
146
- _response_json = _response.json()
147
- except JSONDecodeError:
148
- raise ApiError(status_code=_response.status_code, body=_response.text)
149
- raise ApiError(status_code=_response.status_code, body=_response_json)
100
+ _response = self._raw_client.create(name=name, request_options=request_options)
101
+ return _response.data
150
102
 
151
103
  def get(self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
152
104
  """
153
105
  Look up a specific bucket by its bucketId.
154
106
 
155
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
156
-
157
107
  Parameters
158
108
  ----------
159
109
  bucket_id : int
@@ -178,44 +128,8 @@ class BucketsClient:
178
128
  bucket_id=1,
179
129
  )
180
130
  """
181
- _response = self._client_wrapper.httpx_client.request(
182
- f"v1/bucket/{jsonable_encoder(bucket_id)}",
183
- method="GET",
184
- request_options=request_options,
185
- )
186
- try:
187
- if 200 <= _response.status_code < 300:
188
- return typing.cast(
189
- BucketResponse,
190
- parse_obj_as(
191
- type_=BucketResponse, # type: ignore
192
- object_=_response.json(),
193
- ),
194
- )
195
- if _response.status_code == 400:
196
- raise BadRequestError(
197
- typing.cast(
198
- typing.Optional[typing.Any],
199
- parse_obj_as(
200
- type_=typing.Optional[typing.Any], # type: ignore
201
- object_=_response.json(),
202
- ),
203
- )
204
- )
205
- if _response.status_code == 401:
206
- raise UnauthorizedError(
207
- typing.cast(
208
- typing.Optional[typing.Any],
209
- parse_obj_as(
210
- type_=typing.Optional[typing.Any], # type: ignore
211
- object_=_response.json(),
212
- ),
213
- )
214
- )
215
- _response_json = _response.json()
216
- except JSONDecodeError:
217
- raise ApiError(status_code=_response.status_code, body=_response.text)
218
- raise ApiError(status_code=_response.status_code, body=_response_json)
131
+ _response = self._raw_client.get(bucket_id, request_options=request_options)
132
+ return _response.data
219
133
 
220
134
  def update(
221
135
  self, bucket_id: int, *, new_name: str, request_options: typing.Optional[RequestOptions] = None
@@ -223,8 +137,6 @@ class BucketsClient:
223
137
  """
224
138
  Rename a bucket.
225
139
 
226
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
227
-
228
140
  Parameters
229
141
  ----------
230
142
  bucket_id : int
@@ -253,58 +165,13 @@ class BucketsClient:
253
165
  new_name="your_bucket_name",
254
166
  )
255
167
  """
256
- _response = self._client_wrapper.httpx_client.request(
257
- f"v1/bucket/{jsonable_encoder(bucket_id)}",
258
- method="PUT",
259
- json={
260
- "newName": new_name,
261
- },
262
- headers={
263
- "content-type": "application/json",
264
- },
265
- request_options=request_options,
266
- omit=OMIT,
267
- )
268
- try:
269
- if 200 <= _response.status_code < 300:
270
- return typing.cast(
271
- BucketUpdateResponse,
272
- parse_obj_as(
273
- type_=BucketUpdateResponse, # type: ignore
274
- object_=_response.json(),
275
- ),
276
- )
277
- if _response.status_code == 400:
278
- raise BadRequestError(
279
- typing.cast(
280
- typing.Optional[typing.Any],
281
- parse_obj_as(
282
- type_=typing.Optional[typing.Any], # type: ignore
283
- object_=_response.json(),
284
- ),
285
- )
286
- )
287
- if _response.status_code == 401:
288
- raise UnauthorizedError(
289
- typing.cast(
290
- typing.Optional[typing.Any],
291
- parse_obj_as(
292
- type_=typing.Optional[typing.Any], # type: ignore
293
- object_=_response.json(),
294
- ),
295
- )
296
- )
297
- _response_json = _response.json()
298
- except JSONDecodeError:
299
- raise ApiError(status_code=_response.status_code, body=_response.text)
300
- raise ApiError(status_code=_response.status_code, body=_response_json)
168
+ _response = self._raw_client.update(bucket_id, new_name=new_name, request_options=request_options)
169
+ return _response.data
301
170
 
302
171
  def delete(self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
303
172
  """
304
173
  Delete a bucket.
305
174
 
306
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
307
-
308
175
  Parameters
309
176
  ----------
310
177
  bucket_id : int
@@ -329,49 +196,24 @@ class BucketsClient:
329
196
  bucket_id=1,
330
197
  )
331
198
  """
332
- _response = self._client_wrapper.httpx_client.request(
333
- f"v1/bucket/{jsonable_encoder(bucket_id)}",
334
- method="DELETE",
335
- request_options=request_options,
336
- )
337
- try:
338
- if 200 <= _response.status_code < 300:
339
- return typing.cast(
340
- MessageResponse,
341
- parse_obj_as(
342
- type_=MessageResponse, # type: ignore
343
- object_=_response.json(),
344
- ),
345
- )
346
- if _response.status_code == 400:
347
- raise BadRequestError(
348
- typing.cast(
349
- typing.Optional[typing.Any],
350
- parse_obj_as(
351
- type_=typing.Optional[typing.Any], # type: ignore
352
- object_=_response.json(),
353
- ),
354
- )
355
- )
356
- if _response.status_code == 401:
357
- raise UnauthorizedError(
358
- typing.cast(
359
- typing.Optional[typing.Any],
360
- parse_obj_as(
361
- type_=typing.Optional[typing.Any], # type: ignore
362
- object_=_response.json(),
363
- ),
364
- )
365
- )
366
- _response_json = _response.json()
367
- except JSONDecodeError:
368
- raise ApiError(status_code=_response.status_code, body=_response.text)
369
- raise ApiError(status_code=_response.status_code, body=_response_json)
199
+ _response = self._raw_client.delete(bucket_id, request_options=request_options)
200
+ return _response.data
370
201
 
371
202
 
372
203
  class AsyncBucketsClient:
373
204
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
374
- self._client_wrapper = client_wrapper
205
+ self._raw_client = AsyncRawBucketsClient(client_wrapper=client_wrapper)
206
+
207
+ @property
208
+ def with_raw_response(self) -> AsyncRawBucketsClient:
209
+ """
210
+ Retrieves a raw implementation of this client that returns raw responses.
211
+
212
+ Returns
213
+ -------
214
+ AsyncRawBucketsClient
215
+ """
216
+ return self._raw_client
375
217
 
376
218
  async def list(
377
219
  self,
@@ -383,8 +225,6 @@ class AsyncBucketsClient:
383
225
  """
384
226
  List all buckets within your GroundX account
385
227
 
386
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
387
-
388
228
  Parameters
389
229
  ----------
390
230
  n : typing.Optional[int]
@@ -413,40 +253,21 @@ class AsyncBucketsClient:
413
253
 
414
254
 
415
255
  async def main() -> None:
416
- await client.buckets.list()
256
+ await client.buckets.list(
257
+ n=1,
258
+ next_token="nextToken",
259
+ )
417
260
 
418
261
 
419
262
  asyncio.run(main())
420
263
  """
421
- _response = await self._client_wrapper.httpx_client.request(
422
- "v1/bucket",
423
- method="GET",
424
- params={
425
- "n": n,
426
- "nextToken": next_token,
427
- },
428
- request_options=request_options,
429
- )
430
- try:
431
- if 200 <= _response.status_code < 300:
432
- return typing.cast(
433
- BucketListResponse,
434
- parse_obj_as(
435
- type_=BucketListResponse, # type: ignore
436
- object_=_response.json(),
437
- ),
438
- )
439
- _response_json = _response.json()
440
- except JSONDecodeError:
441
- raise ApiError(status_code=_response.status_code, body=_response.text)
442
- raise ApiError(status_code=_response.status_code, body=_response_json)
264
+ _response = await self._raw_client.list(n=n, next_token=next_token, request_options=request_options)
265
+ return _response.data
443
266
 
444
267
  async def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
445
268
  """
446
269
  Create a new bucket.
447
270
 
448
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
449
-
450
271
  Parameters
451
272
  ----------
452
273
  name : str
@@ -478,48 +299,13 @@ class AsyncBucketsClient:
478
299
 
479
300
  asyncio.run(main())
480
301
  """
481
- _response = await self._client_wrapper.httpx_client.request(
482
- "v1/bucket",
483
- method="POST",
484
- json={
485
- "name": name,
486
- },
487
- headers={
488
- "content-type": "application/json",
489
- },
490
- request_options=request_options,
491
- omit=OMIT,
492
- )
493
- try:
494
- if 200 <= _response.status_code < 300:
495
- return typing.cast(
496
- BucketResponse,
497
- parse_obj_as(
498
- type_=BucketResponse, # type: ignore
499
- object_=_response.json(),
500
- ),
501
- )
502
- if _response.status_code == 400:
503
- raise BadRequestError(
504
- typing.cast(
505
- typing.Optional[typing.Any],
506
- parse_obj_as(
507
- type_=typing.Optional[typing.Any], # type: ignore
508
- object_=_response.json(),
509
- ),
510
- )
511
- )
512
- _response_json = _response.json()
513
- except JSONDecodeError:
514
- raise ApiError(status_code=_response.status_code, body=_response.text)
515
- raise ApiError(status_code=_response.status_code, body=_response_json)
302
+ _response = await self._raw_client.create(name=name, request_options=request_options)
303
+ return _response.data
516
304
 
517
305
  async def get(self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
518
306
  """
519
307
  Look up a specific bucket by its bucketId.
520
308
 
521
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
522
-
523
309
  Parameters
524
310
  ----------
525
311
  bucket_id : int
@@ -552,44 +338,8 @@ class AsyncBucketsClient:
552
338
 
553
339
  asyncio.run(main())
554
340
  """
555
- _response = await self._client_wrapper.httpx_client.request(
556
- f"v1/bucket/{jsonable_encoder(bucket_id)}",
557
- method="GET",
558
- request_options=request_options,
559
- )
560
- try:
561
- if 200 <= _response.status_code < 300:
562
- return typing.cast(
563
- BucketResponse,
564
- parse_obj_as(
565
- type_=BucketResponse, # type: ignore
566
- object_=_response.json(),
567
- ),
568
- )
569
- if _response.status_code == 400:
570
- raise BadRequestError(
571
- typing.cast(
572
- typing.Optional[typing.Any],
573
- parse_obj_as(
574
- type_=typing.Optional[typing.Any], # type: ignore
575
- object_=_response.json(),
576
- ),
577
- )
578
- )
579
- if _response.status_code == 401:
580
- raise UnauthorizedError(
581
- typing.cast(
582
- typing.Optional[typing.Any],
583
- parse_obj_as(
584
- type_=typing.Optional[typing.Any], # type: ignore
585
- object_=_response.json(),
586
- ),
587
- )
588
- )
589
- _response_json = _response.json()
590
- except JSONDecodeError:
591
- raise ApiError(status_code=_response.status_code, body=_response.text)
592
- raise ApiError(status_code=_response.status_code, body=_response_json)
341
+ _response = await self._raw_client.get(bucket_id, request_options=request_options)
342
+ return _response.data
593
343
 
594
344
  async def update(
595
345
  self, bucket_id: int, *, new_name: str, request_options: typing.Optional[RequestOptions] = None
@@ -597,8 +347,6 @@ class AsyncBucketsClient:
597
347
  """
598
348
  Rename a bucket.
599
349
 
600
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
601
-
602
350
  Parameters
603
351
  ----------
604
352
  bucket_id : int
@@ -635,51 +383,8 @@ class AsyncBucketsClient:
635
383
 
636
384
  asyncio.run(main())
637
385
  """
638
- _response = await self._client_wrapper.httpx_client.request(
639
- f"v1/bucket/{jsonable_encoder(bucket_id)}",
640
- method="PUT",
641
- json={
642
- "newName": new_name,
643
- },
644
- headers={
645
- "content-type": "application/json",
646
- },
647
- request_options=request_options,
648
- omit=OMIT,
649
- )
650
- try:
651
- if 200 <= _response.status_code < 300:
652
- return typing.cast(
653
- BucketUpdateResponse,
654
- parse_obj_as(
655
- type_=BucketUpdateResponse, # type: ignore
656
- object_=_response.json(),
657
- ),
658
- )
659
- if _response.status_code == 400:
660
- raise BadRequestError(
661
- typing.cast(
662
- typing.Optional[typing.Any],
663
- parse_obj_as(
664
- type_=typing.Optional[typing.Any], # type: ignore
665
- object_=_response.json(),
666
- ),
667
- )
668
- )
669
- if _response.status_code == 401:
670
- raise UnauthorizedError(
671
- typing.cast(
672
- typing.Optional[typing.Any],
673
- parse_obj_as(
674
- type_=typing.Optional[typing.Any], # type: ignore
675
- object_=_response.json(),
676
- ),
677
- )
678
- )
679
- _response_json = _response.json()
680
- except JSONDecodeError:
681
- raise ApiError(status_code=_response.status_code, body=_response.text)
682
- raise ApiError(status_code=_response.status_code, body=_response_json)
386
+ _response = await self._raw_client.update(bucket_id, new_name=new_name, request_options=request_options)
387
+ return _response.data
683
388
 
684
389
  async def delete(
685
390
  self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None
@@ -687,8 +392,6 @@ class AsyncBucketsClient:
687
392
  """
688
393
  Delete a bucket.
689
394
 
690
- Interact with the "Request Body" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
691
-
692
395
  Parameters
693
396
  ----------
694
397
  bucket_id : int
@@ -721,41 +424,5 @@ class AsyncBucketsClient:
721
424
 
722
425
  asyncio.run(main())
723
426
  """
724
- _response = await self._client_wrapper.httpx_client.request(
725
- f"v1/bucket/{jsonable_encoder(bucket_id)}",
726
- method="DELETE",
727
- request_options=request_options,
728
- )
729
- try:
730
- if 200 <= _response.status_code < 300:
731
- return typing.cast(
732
- MessageResponse,
733
- parse_obj_as(
734
- type_=MessageResponse, # type: ignore
735
- object_=_response.json(),
736
- ),
737
- )
738
- if _response.status_code == 400:
739
- raise BadRequestError(
740
- typing.cast(
741
- typing.Optional[typing.Any],
742
- parse_obj_as(
743
- type_=typing.Optional[typing.Any], # type: ignore
744
- object_=_response.json(),
745
- ),
746
- )
747
- )
748
- if _response.status_code == 401:
749
- raise UnauthorizedError(
750
- typing.cast(
751
- typing.Optional[typing.Any],
752
- parse_obj_as(
753
- type_=typing.Optional[typing.Any], # type: ignore
754
- object_=_response.json(),
755
- ),
756
- )
757
- )
758
- _response_json = _response.json()
759
- except JSONDecodeError:
760
- raise ApiError(status_code=_response.status_code, body=_response.text)
761
- raise ApiError(status_code=_response.status_code, body=_response_json)
427
+ _response = await self._raw_client.delete(bucket_id, request_options=request_options)
428
+ return _response.data