groundx 2.3.0__tar.gz → 2.3.5__tar.gz
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-2.3.0 → groundx-2.3.5}/PKG-INFO +1 -1
- {groundx-2.3.0 → groundx-2.3.5}/pyproject.toml +24 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/__init__.py +16 -16
- {groundx-2.3.0/src/groundx/documents → groundx-2.3.5/src/groundx/buckets}/__init__.py +2 -0
- groundx-2.3.5/src/groundx/buckets/client.py +422 -0
- groundx-2.3.0/src/groundx/buckets/client.py → groundx-2.3.5/src/groundx/buckets/raw_client.py +122 -235
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/client.py +15 -17
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/__init__.py +5 -0
- groundx-2.3.5/src/groundx/core/api_error.py +23 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/client_wrapper.py +4 -3
- groundx-2.3.5/src/groundx/core/force_multipart.py +16 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/http_client.py +70 -26
- groundx-2.3.5/src/groundx/core/http_response.py +55 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/jsonable_encoder.py +0 -1
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/pydantic_utilities.py +69 -110
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/serialization.py +7 -3
- {groundx-2.3.0/src/groundx/buckets → groundx-2.3.5/src/groundx/customer}/__init__.py +2 -0
- groundx-2.3.5/src/groundx/customer/client.py +100 -0
- groundx-2.3.0/src/groundx/customer/client.py → groundx-2.3.5/src/groundx/customer/raw_client.py +22 -43
- {groundx-2.3.0/src/groundx/groups → groundx-2.3.5/src/groundx/documents}/__init__.py +2 -0
- groundx-2.3.5/src/groundx/documents/client.py +1007 -0
- groundx-2.3.0/src/groundx/documents/client.py → groundx-2.3.5/src/groundx/documents/raw_client.py +262 -532
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/errors/__init__.py +2 -0
- groundx-2.3.5/src/groundx/errors/bad_request_error.py +10 -0
- groundx-2.3.5/src/groundx/errors/unauthorized_error.py +10 -0
- {groundx-2.3.0/src/groundx/customer → groundx-2.3.5/src/groundx/groups}/__init__.py +2 -0
- groundx-2.3.5/src/groundx/groups/client.py +605 -0
- groundx-2.3.0/src/groundx/groups/client.py → groundx-2.3.5/src/groundx/groups/raw_client.py +166 -335
- groundx-2.3.5/src/groundx/health/__init__.py +4 -0
- groundx-2.3.5/src/groundx/health/client.py +170 -0
- groundx-2.3.0/src/groundx/health/client.py → groundx-2.3.5/src/groundx/health/raw_client.py +44 -87
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/ingest.py +2 -2
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/search/__init__.py +2 -0
- groundx-2.3.5/src/groundx/search/client.py +348 -0
- groundx-2.3.0/src/groundx/search/client.py → groundx-2.3.5/src/groundx/search/raw_client.py +80 -115
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/search/types/__init__.py +2 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/__init__.py +16 -16
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/bounding_box_detail.py +4 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/bucket_detail.py +5 -5
- groundx-2.3.5/src/groundx/types/bucket_list_response.py +34 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/bucket_response.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/bucket_update_detail.py +4 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/bucket_update_response.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/customer_detail.py +2 -2
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/customer_response.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/document.py +4 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/document_detail.py +9 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/document_list_response.py +4 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/document_local_ingest_request.py +1 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/document_lookup_response.py +8 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/document_response.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/group_detail.py +4 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/group_list_response.py +17 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/group_response.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/health_response.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/health_response_health.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/health_service.py +5 -5
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/ingest_local_document.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/ingest_local_document_metadata.py +9 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/ingest_remote_document.py +10 -5
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/ingest_response.py +4 -4
- groundx-2.3.0/src/groundx/types/process_status_response_ingest.py → groundx-2.3.5/src/groundx/types/ingest_status.py +8 -7
- groundx-2.3.0/src/groundx/types/ingest_response_ingest.py → groundx-2.3.5/src/groundx/types/ingest_status_light.py +7 -5
- groundx-2.3.5/src/groundx/types/ingest_status_progress.py +26 -0
- groundx-2.3.0/src/groundx/types/process_status_response_ingest_progress_errors.py → groundx-2.3.5/src/groundx/types/ingest_status_progress_cancelled.py +4 -4
- groundx-2.3.0/src/groundx/types/process_status_response_ingest_progress_complete.py → groundx-2.3.5/src/groundx/types/ingest_status_progress_complete.py +4 -4
- groundx-2.3.0/src/groundx/types/process_status_response_ingest_progress_cancelled.py → groundx-2.3.5/src/groundx/types/ingest_status_progress_errors.py +4 -4
- groundx-2.3.0/src/groundx/types/process_status_response_ingest_progress_processing.py → groundx-2.3.5/src/groundx/types/ingest_status_progress_processing.py +4 -4
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/message_response.py +2 -2
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/meter_detail.py +2 -2
- groundx-2.3.0/src/groundx/types/bucket_list_response.py → groundx-2.3.5/src/groundx/types/processes_status_response.py +8 -5
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/search_response.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/search_response_search.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/search_result_item.py +5 -5
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/subscription_detail.py +3 -3
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/subscription_detail_meters.py +5 -5
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/website_source.py +4 -4
- groundx-2.3.0/src/groundx/core/api_error.py +0 -15
- groundx-2.3.0/src/groundx/errors/bad_request_error.py +0 -9
- groundx-2.3.0/src/groundx/errors/unauthorized_error.py +0 -9
- groundx-2.3.0/src/groundx/health/__init__.py +0 -2
- groundx-2.3.0/src/groundx/types/process_status_response.py +0 -20
- groundx-2.3.0/src/groundx/types/process_status_response_ingest_progress.py +0 -26
- groundx-2.3.0/src/groundx/types/processes_status_response.py +0 -6
- {groundx-2.3.0 → groundx-2.3.5}/LICENSE +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/README.md +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/datetime_utils.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/file.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/query_encoder.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/remove_none_from_dict.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/core/request_options.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/csv_splitter.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/environment.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/py.typed +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/search/types/search_content_request_id.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/document_type.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/health_service_status.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/process_level.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/processing_status.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/sort.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/types/sort_order.py +0 -0
- {groundx-2.3.0 → groundx-2.3.5}/src/groundx/version.py +0 -0
@@ -3,7 +3,7 @@ name = "groundx"
|
|
3
3
|
|
4
4
|
[tool.poetry]
|
5
5
|
name = "groundx"
|
6
|
-
version = "2.3.
|
6
|
+
version = "2.3.5"
|
7
7
|
description = ""
|
8
8
|
readme = "README.md"
|
9
9
|
authors = []
|
@@ -45,13 +45,13 @@ tqdm = ">=4.60.0"
|
|
45
45
|
types-tqdm = ">=4.60.0"
|
46
46
|
typing_extensions = ">= 4.0.0"
|
47
47
|
|
48
|
-
[tool.poetry.dev
|
49
|
-
mypy = "1.0
|
48
|
+
[tool.poetry.group.dev.dependencies]
|
49
|
+
mypy = "==1.13.0"
|
50
50
|
pytest = "^7.4.0"
|
51
51
|
pytest-asyncio = "^0.23.5"
|
52
52
|
python-dateutil = "^2.9.0"
|
53
53
|
types-python-dateutil = "^2.9.0.20240316"
|
54
|
-
ruff = "
|
54
|
+
ruff = "==0.11.5"
|
55
55
|
types-requests = ">=2.0.0"
|
56
56
|
|
57
57
|
[tool.pytest.ini_options]
|
@@ -64,6 +64,26 @@ plugins = ["pydantic.mypy"]
|
|
64
64
|
[tool.ruff]
|
65
65
|
line-length = 120
|
66
66
|
|
67
|
+
[tool.ruff.lint]
|
68
|
+
select = [
|
69
|
+
"E", # pycodestyle errors
|
70
|
+
"F", # pyflakes
|
71
|
+
"I", # isort
|
72
|
+
]
|
73
|
+
ignore = [
|
74
|
+
"E402", # Module level import not at top of file
|
75
|
+
"E501", # Line too long
|
76
|
+
"E711", # Comparison to `None` should be `cond is not None`
|
77
|
+
"E712", # Avoid equality comparisons to `True`; use `if ...:` checks
|
78
|
+
"E721", # Use `is` and `is not` for type comparisons, or `isinstance()` for insinstance checks
|
79
|
+
"E722", # Do not use bare `except`
|
80
|
+
"E731", # Do not assign a `lambda` expression, use a `def`
|
81
|
+
"F821", # Undefined name
|
82
|
+
"F841" # Local variable ... is assigned to but never used
|
83
|
+
]
|
84
|
+
|
85
|
+
[tool.ruff.lint.isort]
|
86
|
+
section-order = ["future", "standard-library", "third-party", "first-party"]
|
67
87
|
|
68
88
|
[build-system]
|
69
89
|
requires = ["poetry-core"]
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
+
# isort: skip_file
|
4
|
+
|
3
5
|
from .types import (
|
4
6
|
BoundingBoxDetail,
|
5
7
|
BucketDetail,
|
@@ -27,17 +29,16 @@ from .types import (
|
|
27
29
|
IngestLocalDocumentMetadata,
|
28
30
|
IngestRemoteDocument,
|
29
31
|
IngestResponse,
|
30
|
-
|
32
|
+
IngestStatus,
|
33
|
+
IngestStatusLight,
|
34
|
+
IngestStatusProgress,
|
35
|
+
IngestStatusProgressCancelled,
|
36
|
+
IngestStatusProgressComplete,
|
37
|
+
IngestStatusProgressErrors,
|
38
|
+
IngestStatusProgressProcessing,
|
31
39
|
MessageResponse,
|
32
40
|
MeterDetail,
|
33
41
|
ProcessLevel,
|
34
|
-
ProcessStatusResponse,
|
35
|
-
ProcessStatusResponseIngest,
|
36
|
-
ProcessStatusResponseIngestProgress,
|
37
|
-
ProcessStatusResponseIngestProgressCancelled,
|
38
|
-
ProcessStatusResponseIngestProgressComplete,
|
39
|
-
ProcessStatusResponseIngestProgressErrors,
|
40
|
-
ProcessStatusResponseIngestProgressProcessing,
|
41
42
|
ProcessesStatusResponse,
|
42
43
|
ProcessingStatus,
|
43
44
|
SearchResponse,
|
@@ -87,17 +88,16 @@ __all__ = [
|
|
87
88
|
"IngestLocalDocumentMetadata",
|
88
89
|
"IngestRemoteDocument",
|
89
90
|
"IngestResponse",
|
90
|
-
"
|
91
|
+
"IngestStatus",
|
92
|
+
"IngestStatusLight",
|
93
|
+
"IngestStatusProgress",
|
94
|
+
"IngestStatusProgressCancelled",
|
95
|
+
"IngestStatusProgressComplete",
|
96
|
+
"IngestStatusProgressErrors",
|
97
|
+
"IngestStatusProgressProcessing",
|
91
98
|
"MessageResponse",
|
92
99
|
"MeterDetail",
|
93
100
|
"ProcessLevel",
|
94
|
-
"ProcessStatusResponse",
|
95
|
-
"ProcessStatusResponseIngest",
|
96
|
-
"ProcessStatusResponseIngestProgress",
|
97
|
-
"ProcessStatusResponseIngestProgressCancelled",
|
98
|
-
"ProcessStatusResponseIngestProgressComplete",
|
99
|
-
"ProcessStatusResponseIngestProgressErrors",
|
100
|
-
"ProcessStatusResponseIngestProgressProcessing",
|
101
101
|
"ProcessesStatusResponse",
|
102
102
|
"ProcessingStatus",
|
103
103
|
"SearchContentRequestId",
|
@@ -0,0 +1,422 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
import typing
|
4
|
+
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
6
|
+
from ..core.request_options import RequestOptions
|
7
|
+
from ..types.bucket_list_response import BucketListResponse
|
8
|
+
from ..types.bucket_response import BucketResponse
|
9
|
+
from ..types.bucket_update_response import BucketUpdateResponse
|
10
|
+
from ..types.message_response import MessageResponse
|
11
|
+
from .raw_client import AsyncRawBucketsClient, RawBucketsClient
|
12
|
+
|
13
|
+
# this is used as the default value for optional parameters
|
14
|
+
OMIT = typing.cast(typing.Any, ...)
|
15
|
+
|
16
|
+
|
17
|
+
class BucketsClient:
|
18
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
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
|
31
|
+
|
32
|
+
def list(
|
33
|
+
self,
|
34
|
+
*,
|
35
|
+
n: typing.Optional[int] = None,
|
36
|
+
next_token: typing.Optional[str] = None,
|
37
|
+
request_options: typing.Optional[RequestOptions] = None,
|
38
|
+
) -> BucketListResponse:
|
39
|
+
"""
|
40
|
+
List all buckets within your GroundX account
|
41
|
+
|
42
|
+
Parameters
|
43
|
+
----------
|
44
|
+
n : typing.Optional[int]
|
45
|
+
The maximum number of returned buckets. Accepts 1-100 with a default of 20.
|
46
|
+
|
47
|
+
next_token : typing.Optional[str]
|
48
|
+
A token for pagination. If the number of buckets for a given query is larger than n, the response will include a "nextToken" value. That token can be included in this field to retrieve the next batch of n buckets.
|
49
|
+
|
50
|
+
request_options : typing.Optional[RequestOptions]
|
51
|
+
Request-specific configuration.
|
52
|
+
|
53
|
+
Returns
|
54
|
+
-------
|
55
|
+
BucketListResponse
|
56
|
+
Look up success
|
57
|
+
|
58
|
+
Examples
|
59
|
+
--------
|
60
|
+
from groundx import GroundX
|
61
|
+
|
62
|
+
client = GroundX(
|
63
|
+
api_key="YOUR_API_KEY",
|
64
|
+
)
|
65
|
+
client.buckets.list()
|
66
|
+
"""
|
67
|
+
_response = self._raw_client.list(n=n, next_token=next_token, request_options=request_options)
|
68
|
+
return _response.data
|
69
|
+
|
70
|
+
def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
|
71
|
+
"""
|
72
|
+
Create a new bucket.
|
73
|
+
|
74
|
+
Parameters
|
75
|
+
----------
|
76
|
+
name : str
|
77
|
+
|
78
|
+
request_options : typing.Optional[RequestOptions]
|
79
|
+
Request-specific configuration.
|
80
|
+
|
81
|
+
Returns
|
82
|
+
-------
|
83
|
+
BucketResponse
|
84
|
+
Bucket successfully created
|
85
|
+
|
86
|
+
Examples
|
87
|
+
--------
|
88
|
+
from groundx import GroundX
|
89
|
+
|
90
|
+
client = GroundX(
|
91
|
+
api_key="YOUR_API_KEY",
|
92
|
+
)
|
93
|
+
client.buckets.create(
|
94
|
+
name="your_bucket_name",
|
95
|
+
)
|
96
|
+
"""
|
97
|
+
_response = self._raw_client.create(name=name, request_options=request_options)
|
98
|
+
return _response.data
|
99
|
+
|
100
|
+
def get(self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
|
101
|
+
"""
|
102
|
+
Look up a specific bucket by its bucketId.
|
103
|
+
|
104
|
+
Parameters
|
105
|
+
----------
|
106
|
+
bucket_id : int
|
107
|
+
The bucketId of the bucket to look up.
|
108
|
+
|
109
|
+
request_options : typing.Optional[RequestOptions]
|
110
|
+
Request-specific configuration.
|
111
|
+
|
112
|
+
Returns
|
113
|
+
-------
|
114
|
+
BucketResponse
|
115
|
+
Look up success
|
116
|
+
|
117
|
+
Examples
|
118
|
+
--------
|
119
|
+
from groundx import GroundX
|
120
|
+
|
121
|
+
client = GroundX(
|
122
|
+
api_key="YOUR_API_KEY",
|
123
|
+
)
|
124
|
+
client.buckets.get(
|
125
|
+
bucket_id=1,
|
126
|
+
)
|
127
|
+
"""
|
128
|
+
_response = self._raw_client.get(bucket_id, request_options=request_options)
|
129
|
+
return _response.data
|
130
|
+
|
131
|
+
def update(
|
132
|
+
self, bucket_id: int, *, new_name: str, request_options: typing.Optional[RequestOptions] = None
|
133
|
+
) -> BucketUpdateResponse:
|
134
|
+
"""
|
135
|
+
Rename a bucket.
|
136
|
+
|
137
|
+
Parameters
|
138
|
+
----------
|
139
|
+
bucket_id : int
|
140
|
+
The bucketId of the bucket being updated.
|
141
|
+
|
142
|
+
new_name : str
|
143
|
+
The new name of the bucket being renamed.
|
144
|
+
|
145
|
+
request_options : typing.Optional[RequestOptions]
|
146
|
+
Request-specific configuration.
|
147
|
+
|
148
|
+
Returns
|
149
|
+
-------
|
150
|
+
BucketUpdateResponse
|
151
|
+
Bucket successfully updated
|
152
|
+
|
153
|
+
Examples
|
154
|
+
--------
|
155
|
+
from groundx import GroundX
|
156
|
+
|
157
|
+
client = GroundX(
|
158
|
+
api_key="YOUR_API_KEY",
|
159
|
+
)
|
160
|
+
client.buckets.update(
|
161
|
+
bucket_id=1,
|
162
|
+
new_name="your_bucket_name",
|
163
|
+
)
|
164
|
+
"""
|
165
|
+
_response = self._raw_client.update(bucket_id, new_name=new_name, request_options=request_options)
|
166
|
+
return _response.data
|
167
|
+
|
168
|
+
def delete(self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> MessageResponse:
|
169
|
+
"""
|
170
|
+
Delete a bucket.
|
171
|
+
|
172
|
+
Parameters
|
173
|
+
----------
|
174
|
+
bucket_id : int
|
175
|
+
The bucketId of the bucket being deleted.
|
176
|
+
|
177
|
+
request_options : typing.Optional[RequestOptions]
|
178
|
+
Request-specific configuration.
|
179
|
+
|
180
|
+
Returns
|
181
|
+
-------
|
182
|
+
MessageResponse
|
183
|
+
Bucket successfully deleted
|
184
|
+
|
185
|
+
Examples
|
186
|
+
--------
|
187
|
+
from groundx import GroundX
|
188
|
+
|
189
|
+
client = GroundX(
|
190
|
+
api_key="YOUR_API_KEY",
|
191
|
+
)
|
192
|
+
client.buckets.delete(
|
193
|
+
bucket_id=1,
|
194
|
+
)
|
195
|
+
"""
|
196
|
+
_response = self._raw_client.delete(bucket_id, request_options=request_options)
|
197
|
+
return _response.data
|
198
|
+
|
199
|
+
|
200
|
+
class AsyncBucketsClient:
|
201
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
202
|
+
self._raw_client = AsyncRawBucketsClient(client_wrapper=client_wrapper)
|
203
|
+
|
204
|
+
@property
|
205
|
+
def with_raw_response(self) -> AsyncRawBucketsClient:
|
206
|
+
"""
|
207
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
208
|
+
|
209
|
+
Returns
|
210
|
+
-------
|
211
|
+
AsyncRawBucketsClient
|
212
|
+
"""
|
213
|
+
return self._raw_client
|
214
|
+
|
215
|
+
async def list(
|
216
|
+
self,
|
217
|
+
*,
|
218
|
+
n: typing.Optional[int] = None,
|
219
|
+
next_token: typing.Optional[str] = None,
|
220
|
+
request_options: typing.Optional[RequestOptions] = None,
|
221
|
+
) -> BucketListResponse:
|
222
|
+
"""
|
223
|
+
List all buckets within your GroundX account
|
224
|
+
|
225
|
+
Parameters
|
226
|
+
----------
|
227
|
+
n : typing.Optional[int]
|
228
|
+
The maximum number of returned buckets. Accepts 1-100 with a default of 20.
|
229
|
+
|
230
|
+
next_token : typing.Optional[str]
|
231
|
+
A token for pagination. If the number of buckets for a given query is larger than n, the response will include a "nextToken" value. That token can be included in this field to retrieve the next batch of n buckets.
|
232
|
+
|
233
|
+
request_options : typing.Optional[RequestOptions]
|
234
|
+
Request-specific configuration.
|
235
|
+
|
236
|
+
Returns
|
237
|
+
-------
|
238
|
+
BucketListResponse
|
239
|
+
Look up success
|
240
|
+
|
241
|
+
Examples
|
242
|
+
--------
|
243
|
+
import asyncio
|
244
|
+
|
245
|
+
from groundx import AsyncGroundX
|
246
|
+
|
247
|
+
client = AsyncGroundX(
|
248
|
+
api_key="YOUR_API_KEY",
|
249
|
+
)
|
250
|
+
|
251
|
+
|
252
|
+
async def main() -> None:
|
253
|
+
await client.buckets.list()
|
254
|
+
|
255
|
+
|
256
|
+
asyncio.run(main())
|
257
|
+
"""
|
258
|
+
_response = await self._raw_client.list(n=n, next_token=next_token, request_options=request_options)
|
259
|
+
return _response.data
|
260
|
+
|
261
|
+
async def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
|
262
|
+
"""
|
263
|
+
Create a new bucket.
|
264
|
+
|
265
|
+
Parameters
|
266
|
+
----------
|
267
|
+
name : str
|
268
|
+
|
269
|
+
request_options : typing.Optional[RequestOptions]
|
270
|
+
Request-specific configuration.
|
271
|
+
|
272
|
+
Returns
|
273
|
+
-------
|
274
|
+
BucketResponse
|
275
|
+
Bucket successfully created
|
276
|
+
|
277
|
+
Examples
|
278
|
+
--------
|
279
|
+
import asyncio
|
280
|
+
|
281
|
+
from groundx import AsyncGroundX
|
282
|
+
|
283
|
+
client = AsyncGroundX(
|
284
|
+
api_key="YOUR_API_KEY",
|
285
|
+
)
|
286
|
+
|
287
|
+
|
288
|
+
async def main() -> None:
|
289
|
+
await client.buckets.create(
|
290
|
+
name="your_bucket_name",
|
291
|
+
)
|
292
|
+
|
293
|
+
|
294
|
+
asyncio.run(main())
|
295
|
+
"""
|
296
|
+
_response = await self._raw_client.create(name=name, request_options=request_options)
|
297
|
+
return _response.data
|
298
|
+
|
299
|
+
async def get(self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None) -> BucketResponse:
|
300
|
+
"""
|
301
|
+
Look up a specific bucket by its bucketId.
|
302
|
+
|
303
|
+
Parameters
|
304
|
+
----------
|
305
|
+
bucket_id : int
|
306
|
+
The bucketId of the bucket to look up.
|
307
|
+
|
308
|
+
request_options : typing.Optional[RequestOptions]
|
309
|
+
Request-specific configuration.
|
310
|
+
|
311
|
+
Returns
|
312
|
+
-------
|
313
|
+
BucketResponse
|
314
|
+
Look up success
|
315
|
+
|
316
|
+
Examples
|
317
|
+
--------
|
318
|
+
import asyncio
|
319
|
+
|
320
|
+
from groundx import AsyncGroundX
|
321
|
+
|
322
|
+
client = AsyncGroundX(
|
323
|
+
api_key="YOUR_API_KEY",
|
324
|
+
)
|
325
|
+
|
326
|
+
|
327
|
+
async def main() -> None:
|
328
|
+
await client.buckets.get(
|
329
|
+
bucket_id=1,
|
330
|
+
)
|
331
|
+
|
332
|
+
|
333
|
+
asyncio.run(main())
|
334
|
+
"""
|
335
|
+
_response = await self._raw_client.get(bucket_id, request_options=request_options)
|
336
|
+
return _response.data
|
337
|
+
|
338
|
+
async def update(
|
339
|
+
self, bucket_id: int, *, new_name: str, request_options: typing.Optional[RequestOptions] = None
|
340
|
+
) -> BucketUpdateResponse:
|
341
|
+
"""
|
342
|
+
Rename a bucket.
|
343
|
+
|
344
|
+
Parameters
|
345
|
+
----------
|
346
|
+
bucket_id : int
|
347
|
+
The bucketId of the bucket being updated.
|
348
|
+
|
349
|
+
new_name : str
|
350
|
+
The new name of the bucket being renamed.
|
351
|
+
|
352
|
+
request_options : typing.Optional[RequestOptions]
|
353
|
+
Request-specific configuration.
|
354
|
+
|
355
|
+
Returns
|
356
|
+
-------
|
357
|
+
BucketUpdateResponse
|
358
|
+
Bucket successfully updated
|
359
|
+
|
360
|
+
Examples
|
361
|
+
--------
|
362
|
+
import asyncio
|
363
|
+
|
364
|
+
from groundx import AsyncGroundX
|
365
|
+
|
366
|
+
client = AsyncGroundX(
|
367
|
+
api_key="YOUR_API_KEY",
|
368
|
+
)
|
369
|
+
|
370
|
+
|
371
|
+
async def main() -> None:
|
372
|
+
await client.buckets.update(
|
373
|
+
bucket_id=1,
|
374
|
+
new_name="your_bucket_name",
|
375
|
+
)
|
376
|
+
|
377
|
+
|
378
|
+
asyncio.run(main())
|
379
|
+
"""
|
380
|
+
_response = await self._raw_client.update(bucket_id, new_name=new_name, request_options=request_options)
|
381
|
+
return _response.data
|
382
|
+
|
383
|
+
async def delete(
|
384
|
+
self, bucket_id: int, *, request_options: typing.Optional[RequestOptions] = None
|
385
|
+
) -> MessageResponse:
|
386
|
+
"""
|
387
|
+
Delete a bucket.
|
388
|
+
|
389
|
+
Parameters
|
390
|
+
----------
|
391
|
+
bucket_id : int
|
392
|
+
The bucketId of the bucket being deleted.
|
393
|
+
|
394
|
+
request_options : typing.Optional[RequestOptions]
|
395
|
+
Request-specific configuration.
|
396
|
+
|
397
|
+
Returns
|
398
|
+
-------
|
399
|
+
MessageResponse
|
400
|
+
Bucket successfully deleted
|
401
|
+
|
402
|
+
Examples
|
403
|
+
--------
|
404
|
+
import asyncio
|
405
|
+
|
406
|
+
from groundx import AsyncGroundX
|
407
|
+
|
408
|
+
client = AsyncGroundX(
|
409
|
+
api_key="YOUR_API_KEY",
|
410
|
+
)
|
411
|
+
|
412
|
+
|
413
|
+
async def main() -> None:
|
414
|
+
await client.buckets.delete(
|
415
|
+
bucket_id=1,
|
416
|
+
)
|
417
|
+
|
418
|
+
|
419
|
+
asyncio.run(main())
|
420
|
+
"""
|
421
|
+
_response = await self._raw_client.delete(bucket_id, request_options=request_options)
|
422
|
+
return _response.data
|