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/groups/client.py CHANGED
@@ -1,18 +1,13 @@
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.group_list_response import GroupListResponse
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.group_response import GroupResponse
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.message_response import MessageResponse
15
- from ..core.client_wrapper import AsyncClientWrapper
10
+ from .raw_client import AsyncRawGroupsClient, RawGroupsClient
16
11
 
17
12
  # this is used as the default value for optional parameters
18
13
  OMIT = typing.cast(typing.Any, ...)
@@ -20,7 +15,18 @@ OMIT = typing.cast(typing.Any, ...)
20
15
 
21
16
  class GroupsClient:
22
17
  def __init__(self, *, client_wrapper: SyncClientWrapper):
23
- self._client_wrapper = client_wrapper
18
+ self._raw_client = RawGroupsClient(client_wrapper=client_wrapper)
19
+
20
+ @property
21
+ def with_raw_response(self) -> RawGroupsClient:
22
+ """
23
+ Retrieves a raw implementation of this client that returns raw responses.
24
+
25
+ Returns
26
+ -------
27
+ RawGroupsClient
28
+ """
29
+ return self._raw_client
24
30
 
25
31
  def list(
26
32
  self,
@@ -32,8 +38,6 @@ class GroupsClient:
32
38
  """
33
39
  list all groups within your GroundX account.
34
40
 
35
- 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.
36
-
37
41
  Parameters
38
42
  ----------
39
43
  n : typing.Optional[int]
@@ -57,30 +61,13 @@ class GroupsClient:
57
61
  client = GroundX(
58
62
  api_key="YOUR_API_KEY",
59
63
  )
60
- client.groups.list()
61
- """
62
- _response = self._client_wrapper.httpx_client.request(
63
- "v1/group",
64
- method="GET",
65
- params={
66
- "n": n,
67
- "nextToken": next_token,
68
- },
69
- request_options=request_options,
64
+ client.groups.list(
65
+ n=1,
66
+ next_token="nextToken",
70
67
  )
71
- try:
72
- if 200 <= _response.status_code < 300:
73
- return typing.cast(
74
- GroupListResponse,
75
- parse_obj_as(
76
- type_=GroupListResponse, # type: ignore
77
- object_=_response.json(),
78
- ),
79
- )
80
- _response_json = _response.json()
81
- except JSONDecodeError:
82
- raise ApiError(status_code=_response.status_code, body=_response.text)
83
- raise ApiError(status_code=_response.status_code, body=_response_json)
68
+ """
69
+ _response = self._raw_client.list(n=n, next_token=next_token, request_options=request_options)
70
+ return _response.data
84
71
 
85
72
  def create(
86
73
  self,
@@ -92,8 +79,6 @@ class GroupsClient:
92
79
  """
93
80
  create a new group, a group being a collection of buckets which can be searched.
94
81
 
95
- 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.
96
-
97
82
  Parameters
98
83
  ----------
99
84
  name : str
@@ -121,49 +106,13 @@ class GroupsClient:
121
106
  name="your_group_name",
122
107
  )
123
108
  """
124
- _response = self._client_wrapper.httpx_client.request(
125
- "v1/group",
126
- method="POST",
127
- json={
128
- "name": name,
129
- "bucketName": bucket_name,
130
- },
131
- headers={
132
- "content-type": "application/json",
133
- },
134
- request_options=request_options,
135
- omit=OMIT,
136
- )
137
- try:
138
- if 200 <= _response.status_code < 300:
139
- return typing.cast(
140
- GroupResponse,
141
- parse_obj_as(
142
- type_=GroupResponse, # type: ignore
143
- object_=_response.json(),
144
- ),
145
- )
146
- if _response.status_code == 400:
147
- raise BadRequestError(
148
- typing.cast(
149
- typing.Optional[typing.Any],
150
- parse_obj_as(
151
- type_=typing.Optional[typing.Any], # type: ignore
152
- object_=_response.json(),
153
- ),
154
- )
155
- )
156
- _response_json = _response.json()
157
- except JSONDecodeError:
158
- raise ApiError(status_code=_response.status_code, body=_response.text)
159
- raise ApiError(status_code=_response.status_code, body=_response_json)
109
+ _response = self._raw_client.create(name=name, bucket_name=bucket_name, request_options=request_options)
110
+ return _response.data
160
111
 
161
112
  def get(self, group_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> GroupResponse:
162
113
  """
163
114
  look up a specific group by its groupId.
164
115
 
165
- 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.
166
-
167
116
  Parameters
168
117
  ----------
169
118
  group_id : int
@@ -188,44 +137,8 @@ class GroupsClient:
188
137
  group_id=1,
189
138
  )
190
139
  """
191
- _response = self._client_wrapper.httpx_client.request(
192
- f"v1/group/{jsonable_encoder(group_id)}",
193
- method="GET",
194
- request_options=request_options,
195
- )
196
- try:
197
- if 200 <= _response.status_code < 300:
198
- return typing.cast(
199
- GroupResponse,
200
- parse_obj_as(
201
- type_=GroupResponse, # type: ignore
202
- object_=_response.json(),
203
- ),
204
- )
205
- if _response.status_code == 400:
206
- raise BadRequestError(
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
- if _response.status_code == 401:
216
- raise UnauthorizedError(
217
- typing.cast(
218
- typing.Optional[typing.Any],
219
- parse_obj_as(
220
- type_=typing.Optional[typing.Any], # type: ignore
221
- object_=_response.json(),
222
- ),
223
- )
224
- )
225
- _response_json = _response.json()
226
- except JSONDecodeError:
227
- raise ApiError(status_code=_response.status_code, body=_response.text)
228
- raise ApiError(status_code=_response.status_code, body=_response_json)
140
+ _response = self._raw_client.get(group_id, request_options=request_options)
141
+ return _response.data
229
142
 
230
143
  def update(
231
144
  self, group_id: int, *, new_name: str, request_options: typing.Optional[RequestOptions] = None
@@ -233,8 +146,6 @@ class GroupsClient:
233
146
  """
234
147
  Rename a group
235
148
 
236
- 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.
237
-
238
149
  Parameters
239
150
  ----------
240
151
  group_id : int
@@ -263,58 +174,13 @@ class GroupsClient:
263
174
  new_name="your_group_name",
264
175
  )
265
176
  """
266
- _response = self._client_wrapper.httpx_client.request(
267
- f"v1/group/{jsonable_encoder(group_id)}",
268
- method="PUT",
269
- json={
270
- "newName": new_name,
271
- },
272
- headers={
273
- "content-type": "application/json",
274
- },
275
- request_options=request_options,
276
- omit=OMIT,
277
- )
278
- try:
279
- if 200 <= _response.status_code < 300:
280
- return typing.cast(
281
- GroupResponse,
282
- parse_obj_as(
283
- type_=GroupResponse, # type: ignore
284
- object_=_response.json(),
285
- ),
286
- )
287
- if _response.status_code == 400:
288
- raise BadRequestError(
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
- if _response.status_code == 401:
298
- raise UnauthorizedError(
299
- typing.cast(
300
- typing.Optional[typing.Any],
301
- parse_obj_as(
302
- type_=typing.Optional[typing.Any], # type: ignore
303
- object_=_response.json(),
304
- ),
305
- )
306
- )
307
- _response_json = _response.json()
308
- except JSONDecodeError:
309
- raise ApiError(status_code=_response.status_code, body=_response.text)
310
- raise ApiError(status_code=_response.status_code, body=_response_json)
177
+ _response = self._raw_client.update(group_id, new_name=new_name, request_options=request_options)
178
+ return _response.data
311
179
 
312
180
  def delete(self, group_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
313
181
  """
314
182
  Delete a group.
315
183
 
316
- 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.
317
-
318
184
  Parameters
319
185
  ----------
320
186
  group_id : int
@@ -339,44 +205,8 @@ class GroupsClient:
339
205
  group_id=1,
340
206
  )
341
207
  """
342
- _response = self._client_wrapper.httpx_client.request(
343
- f"v1/group/{jsonable_encoder(group_id)}",
344
- method="DELETE",
345
- request_options=request_options,
346
- )
347
- try:
348
- if 200 <= _response.status_code < 300:
349
- return typing.cast(
350
- MessageResponse,
351
- parse_obj_as(
352
- type_=MessageResponse, # type: ignore
353
- object_=_response.json(),
354
- ),
355
- )
356
- if _response.status_code == 400:
357
- raise BadRequestError(
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
- if _response.status_code == 401:
367
- raise UnauthorizedError(
368
- typing.cast(
369
- typing.Optional[typing.Any],
370
- parse_obj_as(
371
- type_=typing.Optional[typing.Any], # type: ignore
372
- object_=_response.json(),
373
- ),
374
- )
375
- )
376
- _response_json = _response.json()
377
- except JSONDecodeError:
378
- raise ApiError(status_code=_response.status_code, body=_response.text)
379
- raise ApiError(status_code=_response.status_code, body=_response_json)
208
+ _response = self._raw_client.delete(group_id, request_options=request_options)
209
+ return _response.data
380
210
 
381
211
  def add_bucket(
382
212
  self, group_id: int, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None
@@ -384,8 +214,6 @@ class GroupsClient:
384
214
  """
385
215
  Add an existing bucket to an existing group. Buckets and groups can be associated many to many.
386
216
 
387
- 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.
388
-
389
217
  Parameters
390
218
  ----------
391
219
  group_id : int
@@ -414,44 +242,8 @@ class GroupsClient:
414
242
  bucket_id=1,
415
243
  )
416
244
  """
417
- _response = self._client_wrapper.httpx_client.request(
418
- f"v1/group/{jsonable_encoder(group_id)}/bucket/{jsonable_encoder(bucket_id)}",
419
- method="POST",
420
- request_options=request_options,
421
- )
422
- try:
423
- if 200 <= _response.status_code < 300:
424
- return typing.cast(
425
- MessageResponse,
426
- parse_obj_as(
427
- type_=MessageResponse, # type: ignore
428
- object_=_response.json(),
429
- ),
430
- )
431
- if _response.status_code == 400:
432
- raise BadRequestError(
433
- typing.cast(
434
- typing.Optional[typing.Any],
435
- parse_obj_as(
436
- type_=typing.Optional[typing.Any], # type: ignore
437
- object_=_response.json(),
438
- ),
439
- )
440
- )
441
- if _response.status_code == 401:
442
- raise UnauthorizedError(
443
- typing.cast(
444
- typing.Optional[typing.Any],
445
- parse_obj_as(
446
- type_=typing.Optional[typing.Any], # type: ignore
447
- object_=_response.json(),
448
- ),
449
- )
450
- )
451
- _response_json = _response.json()
452
- except JSONDecodeError:
453
- raise ApiError(status_code=_response.status_code, body=_response.text)
454
- raise ApiError(status_code=_response.status_code, body=_response_json)
245
+ _response = self._raw_client.add_bucket(group_id, bucket_id, request_options=request_options)
246
+ return _response.data
455
247
 
456
248
  def remove_bucket(
457
249
  self, group_id: int, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None
@@ -459,8 +251,6 @@ class GroupsClient:
459
251
  """
460
252
  remove a bucket from a group. Buckets and groups can be associated many to many, this removes one bucket to group association without disturbing others.
461
253
 
462
- 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.
463
-
464
254
  Parameters
465
255
  ----------
466
256
  group_id : int
@@ -489,49 +279,24 @@ class GroupsClient:
489
279
  bucket_id=1,
490
280
  )
491
281
  """
492
- _response = self._client_wrapper.httpx_client.request(
493
- f"v1/group/{jsonable_encoder(group_id)}/bucket/{jsonable_encoder(bucket_id)}",
494
- method="DELETE",
495
- request_options=request_options,
496
- )
497
- try:
498
- if 200 <= _response.status_code < 300:
499
- return typing.cast(
500
- MessageResponse,
501
- parse_obj_as(
502
- type_=MessageResponse, # type: ignore
503
- object_=_response.json(),
504
- ),
505
- )
506
- if _response.status_code == 400:
507
- raise BadRequestError(
508
- typing.cast(
509
- typing.Optional[typing.Any],
510
- parse_obj_as(
511
- type_=typing.Optional[typing.Any], # type: ignore
512
- object_=_response.json(),
513
- ),
514
- )
515
- )
516
- if _response.status_code == 401:
517
- raise UnauthorizedError(
518
- typing.cast(
519
- typing.Optional[typing.Any],
520
- parse_obj_as(
521
- type_=typing.Optional[typing.Any], # type: ignore
522
- object_=_response.json(),
523
- ),
524
- )
525
- )
526
- _response_json = _response.json()
527
- except JSONDecodeError:
528
- raise ApiError(status_code=_response.status_code, body=_response.text)
529
- raise ApiError(status_code=_response.status_code, body=_response_json)
282
+ _response = self._raw_client.remove_bucket(group_id, bucket_id, request_options=request_options)
283
+ return _response.data
530
284
 
531
285
 
532
286
  class AsyncGroupsClient:
533
287
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
534
- self._client_wrapper = client_wrapper
288
+ self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper)
289
+
290
+ @property
291
+ def with_raw_response(self) -> AsyncRawGroupsClient:
292
+ """
293
+ Retrieves a raw implementation of this client that returns raw responses.
294
+
295
+ Returns
296
+ -------
297
+ AsyncRawGroupsClient
298
+ """
299
+ return self._raw_client
535
300
 
536
301
  async def list(
537
302
  self,
@@ -543,8 +308,6 @@ class AsyncGroupsClient:
543
308
  """
544
309
  list all groups within your GroundX account.
545
310
 
546
- 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.
547
-
548
311
  Parameters
549
312
  ----------
550
313
  n : typing.Optional[int]
@@ -573,33 +336,16 @@ class AsyncGroupsClient:
573
336
 
574
337
 
575
338
  async def main() -> None:
576
- await client.groups.list()
339
+ await client.groups.list(
340
+ n=1,
341
+ next_token="nextToken",
342
+ )
577
343
 
578
344
 
579
345
  asyncio.run(main())
580
346
  """
581
- _response = await self._client_wrapper.httpx_client.request(
582
- "v1/group",
583
- method="GET",
584
- params={
585
- "n": n,
586
- "nextToken": next_token,
587
- },
588
- request_options=request_options,
589
- )
590
- try:
591
- if 200 <= _response.status_code < 300:
592
- return typing.cast(
593
- GroupListResponse,
594
- parse_obj_as(
595
- type_=GroupListResponse, # type: ignore
596
- object_=_response.json(),
597
- ),
598
- )
599
- _response_json = _response.json()
600
- except JSONDecodeError:
601
- raise ApiError(status_code=_response.status_code, body=_response.text)
602
- raise ApiError(status_code=_response.status_code, body=_response_json)
347
+ _response = await self._raw_client.list(n=n, next_token=next_token, request_options=request_options)
348
+ return _response.data
603
349
 
604
350
  async def create(
605
351
  self,
@@ -611,8 +357,6 @@ class AsyncGroupsClient:
611
357
  """
612
358
  create a new group, a group being a collection of buckets which can be searched.
613
359
 
614
- 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.
615
-
616
360
  Parameters
617
361
  ----------
618
362
  name : str
@@ -648,49 +392,13 @@ class AsyncGroupsClient:
648
392
 
649
393
  asyncio.run(main())
650
394
  """
651
- _response = await self._client_wrapper.httpx_client.request(
652
- "v1/group",
653
- method="POST",
654
- json={
655
- "name": name,
656
- "bucketName": bucket_name,
657
- },
658
- headers={
659
- "content-type": "application/json",
660
- },
661
- request_options=request_options,
662
- omit=OMIT,
663
- )
664
- try:
665
- if 200 <= _response.status_code < 300:
666
- return typing.cast(
667
- GroupResponse,
668
- parse_obj_as(
669
- type_=GroupResponse, # type: ignore
670
- object_=_response.json(),
671
- ),
672
- )
673
- if _response.status_code == 400:
674
- raise BadRequestError(
675
- typing.cast(
676
- typing.Optional[typing.Any],
677
- parse_obj_as(
678
- type_=typing.Optional[typing.Any], # type: ignore
679
- object_=_response.json(),
680
- ),
681
- )
682
- )
683
- _response_json = _response.json()
684
- except JSONDecodeError:
685
- raise ApiError(status_code=_response.status_code, body=_response.text)
686
- raise ApiError(status_code=_response.status_code, body=_response_json)
395
+ _response = await self._raw_client.create(name=name, bucket_name=bucket_name, request_options=request_options)
396
+ return _response.data
687
397
 
688
398
  async def get(self, group_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> GroupResponse:
689
399
  """
690
400
  look up a specific group by its groupId.
691
401
 
692
- 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.
693
-
694
402
  Parameters
695
403
  ----------
696
404
  group_id : int
@@ -723,44 +431,8 @@ class AsyncGroupsClient:
723
431
 
724
432
  asyncio.run(main())
725
433
  """
726
- _response = await self._client_wrapper.httpx_client.request(
727
- f"v1/group/{jsonable_encoder(group_id)}",
728
- method="GET",
729
- request_options=request_options,
730
- )
731
- try:
732
- if 200 <= _response.status_code < 300:
733
- return typing.cast(
734
- GroupResponse,
735
- parse_obj_as(
736
- type_=GroupResponse, # type: ignore
737
- object_=_response.json(),
738
- ),
739
- )
740
- if _response.status_code == 400:
741
- raise BadRequestError(
742
- typing.cast(
743
- typing.Optional[typing.Any],
744
- parse_obj_as(
745
- type_=typing.Optional[typing.Any], # type: ignore
746
- object_=_response.json(),
747
- ),
748
- )
749
- )
750
- if _response.status_code == 401:
751
- raise UnauthorizedError(
752
- typing.cast(
753
- typing.Optional[typing.Any],
754
- parse_obj_as(
755
- type_=typing.Optional[typing.Any], # type: ignore
756
- object_=_response.json(),
757
- ),
758
- )
759
- )
760
- _response_json = _response.json()
761
- except JSONDecodeError:
762
- raise ApiError(status_code=_response.status_code, body=_response.text)
763
- raise ApiError(status_code=_response.status_code, body=_response_json)
434
+ _response = await self._raw_client.get(group_id, request_options=request_options)
435
+ return _response.data
764
436
 
765
437
  async def update(
766
438
  self, group_id: int, *, new_name: str, request_options: typing.Optional[RequestOptions] = None
@@ -768,8 +440,6 @@ class AsyncGroupsClient:
768
440
  """
769
441
  Rename a group
770
442
 
771
- 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.
772
-
773
443
  Parameters
774
444
  ----------
775
445
  group_id : int
@@ -806,51 +476,8 @@ class AsyncGroupsClient:
806
476
 
807
477
  asyncio.run(main())
808
478
  """
809
- _response = await self._client_wrapper.httpx_client.request(
810
- f"v1/group/{jsonable_encoder(group_id)}",
811
- method="PUT",
812
- json={
813
- "newName": new_name,
814
- },
815
- headers={
816
- "content-type": "application/json",
817
- },
818
- request_options=request_options,
819
- omit=OMIT,
820
- )
821
- try:
822
- if 200 <= _response.status_code < 300:
823
- return typing.cast(
824
- GroupResponse,
825
- parse_obj_as(
826
- type_=GroupResponse, # type: ignore
827
- object_=_response.json(),
828
- ),
829
- )
830
- if _response.status_code == 400:
831
- raise BadRequestError(
832
- typing.cast(
833
- typing.Optional[typing.Any],
834
- parse_obj_as(
835
- type_=typing.Optional[typing.Any], # type: ignore
836
- object_=_response.json(),
837
- ),
838
- )
839
- )
840
- if _response.status_code == 401:
841
- raise UnauthorizedError(
842
- typing.cast(
843
- typing.Optional[typing.Any],
844
- parse_obj_as(
845
- type_=typing.Optional[typing.Any], # type: ignore
846
- object_=_response.json(),
847
- ),
848
- )
849
- )
850
- _response_json = _response.json()
851
- except JSONDecodeError:
852
- raise ApiError(status_code=_response.status_code, body=_response.text)
853
- raise ApiError(status_code=_response.status_code, body=_response_json)
479
+ _response = await self._raw_client.update(group_id, new_name=new_name, request_options=request_options)
480
+ return _response.data
854
481
 
855
482
  async def delete(
856
483
  self, group_id: int, *, request_options: typing.Optional[RequestOptions] = None
@@ -858,8 +485,6 @@ class AsyncGroupsClient:
858
485
  """
859
486
  Delete a group.
860
487
 
861
- 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.
862
-
863
488
  Parameters
864
489
  ----------
865
490
  group_id : int
@@ -892,44 +517,8 @@ class AsyncGroupsClient:
892
517
 
893
518
  asyncio.run(main())
894
519
  """
895
- _response = await self._client_wrapper.httpx_client.request(
896
- f"v1/group/{jsonable_encoder(group_id)}",
897
- method="DELETE",
898
- request_options=request_options,
899
- )
900
- try:
901
- if 200 <= _response.status_code < 300:
902
- return typing.cast(
903
- MessageResponse,
904
- parse_obj_as(
905
- type_=MessageResponse, # type: ignore
906
- object_=_response.json(),
907
- ),
908
- )
909
- if _response.status_code == 400:
910
- raise BadRequestError(
911
- typing.cast(
912
- typing.Optional[typing.Any],
913
- parse_obj_as(
914
- type_=typing.Optional[typing.Any], # type: ignore
915
- object_=_response.json(),
916
- ),
917
- )
918
- )
919
- if _response.status_code == 401:
920
- raise UnauthorizedError(
921
- typing.cast(
922
- typing.Optional[typing.Any],
923
- parse_obj_as(
924
- type_=typing.Optional[typing.Any], # type: ignore
925
- object_=_response.json(),
926
- ),
927
- )
928
- )
929
- _response_json = _response.json()
930
- except JSONDecodeError:
931
- raise ApiError(status_code=_response.status_code, body=_response.text)
932
- raise ApiError(status_code=_response.status_code, body=_response_json)
520
+ _response = await self._raw_client.delete(group_id, request_options=request_options)
521
+ return _response.data
933
522
 
934
523
  async def add_bucket(
935
524
  self, group_id: int, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None
@@ -937,8 +526,6 @@ class AsyncGroupsClient:
937
526
  """
938
527
  Add an existing bucket to an existing group. Buckets and groups can be associated many to many.
939
528
 
940
- 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.
941
-
942
529
  Parameters
943
530
  ----------
944
531
  group_id : int
@@ -975,44 +562,8 @@ class AsyncGroupsClient:
975
562
 
976
563
  asyncio.run(main())
977
564
  """
978
- _response = await self._client_wrapper.httpx_client.request(
979
- f"v1/group/{jsonable_encoder(group_id)}/bucket/{jsonable_encoder(bucket_id)}",
980
- method="POST",
981
- request_options=request_options,
982
- )
983
- try:
984
- if 200 <= _response.status_code < 300:
985
- return typing.cast(
986
- MessageResponse,
987
- parse_obj_as(
988
- type_=MessageResponse, # type: ignore
989
- object_=_response.json(),
990
- ),
991
- )
992
- if _response.status_code == 400:
993
- raise BadRequestError(
994
- typing.cast(
995
- typing.Optional[typing.Any],
996
- parse_obj_as(
997
- type_=typing.Optional[typing.Any], # type: ignore
998
- object_=_response.json(),
999
- ),
1000
- )
1001
- )
1002
- if _response.status_code == 401:
1003
- raise UnauthorizedError(
1004
- typing.cast(
1005
- typing.Optional[typing.Any],
1006
- parse_obj_as(
1007
- type_=typing.Optional[typing.Any], # type: ignore
1008
- object_=_response.json(),
1009
- ),
1010
- )
1011
- )
1012
- _response_json = _response.json()
1013
- except JSONDecodeError:
1014
- raise ApiError(status_code=_response.status_code, body=_response.text)
1015
- raise ApiError(status_code=_response.status_code, body=_response_json)
565
+ _response = await self._raw_client.add_bucket(group_id, bucket_id, request_options=request_options)
566
+ return _response.data
1016
567
 
1017
568
  async def remove_bucket(
1018
569
  self, group_id: int, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None
@@ -1020,8 +571,6 @@ class AsyncGroupsClient:
1020
571
  """
1021
572
  remove a bucket from a group. Buckets and groups can be associated many to many, this removes one bucket to group association without disturbing others.
1022
573
 
1023
- 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.
1024
-
1025
574
  Parameters
1026
575
  ----------
1027
576
  group_id : int
@@ -1058,41 +607,5 @@ class AsyncGroupsClient:
1058
607
 
1059
608
  asyncio.run(main())
1060
609
  """
1061
- _response = await self._client_wrapper.httpx_client.request(
1062
- f"v1/group/{jsonable_encoder(group_id)}/bucket/{jsonable_encoder(bucket_id)}",
1063
- method="DELETE",
1064
- request_options=request_options,
1065
- )
1066
- try:
1067
- if 200 <= _response.status_code < 300:
1068
- return typing.cast(
1069
- MessageResponse,
1070
- parse_obj_as(
1071
- type_=MessageResponse, # type: ignore
1072
- object_=_response.json(),
1073
- ),
1074
- )
1075
- if _response.status_code == 400:
1076
- raise BadRequestError(
1077
- typing.cast(
1078
- typing.Optional[typing.Any],
1079
- parse_obj_as(
1080
- type_=typing.Optional[typing.Any], # type: ignore
1081
- object_=_response.json(),
1082
- ),
1083
- )
1084
- )
1085
- if _response.status_code == 401:
1086
- raise UnauthorizedError(
1087
- typing.cast(
1088
- typing.Optional[typing.Any],
1089
- parse_obj_as(
1090
- type_=typing.Optional[typing.Any], # type: ignore
1091
- object_=_response.json(),
1092
- ),
1093
- )
1094
- )
1095
- _response_json = _response.json()
1096
- except JSONDecodeError:
1097
- raise ApiError(status_code=_response.status_code, body=_response.text)
1098
- raise ApiError(status_code=_response.status_code, body=_response_json)
610
+ _response = await self._raw_client.remove_bucket(group_id, bucket_id, request_options=request_options)
611
+ return _response.data