@planqk/planqk-api-sdk 1.0.0
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.
- package/.devcontainer/devcontainer.json +32 -0
- package/.devcontainer/post-create.sh +7 -0
- package/.env.template +2 -0
- package/.gitlab-ci.yml +71 -0
- package/.python-version +1 -0
- package/.releaserc.json +45 -0
- package/LICENSE +201 -0
- package/README-node.md +18 -0
- package/README-python.md +21 -0
- package/README.md +56 -0
- package/dist/Client.d.ts +32 -0
- package/dist/Client.js +60 -0
- package/dist/api/errors/BadRequestError.d.ts +8 -0
- package/dist/api/errors/BadRequestError.js +52 -0
- package/dist/api/errors/ForbiddenError.d.ts +8 -0
- package/dist/api/errors/ForbiddenError.js +52 -0
- package/dist/api/errors/InternalServerError.d.ts +8 -0
- package/dist/api/errors/InternalServerError.js +52 -0
- package/dist/api/errors/NotFoundError.d.ts +8 -0
- package/dist/api/errors/NotFoundError.js +52 -0
- package/dist/api/errors/UnauthorizedError.d.ts +8 -0
- package/dist/api/errors/UnauthorizedError.js +52 -0
- package/dist/api/errors/index.d.ts +5 -0
- package/dist/api/errors/index.js +21 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/dataPools/client/Client.d.ts +177 -0
- package/dist/api/resources/dataPools/client/Client.js +676 -0
- package/dist/api/resources/dataPools/client/index.d.ts +2 -0
- package/dist/api/resources/dataPools/client/index.js +17 -0
- package/dist/api/resources/dataPools/client/requests/AddDataPoolFileRequest.d.ts +14 -0
- package/dist/api/resources/dataPools/client/requests/AddDataPoolFileRequest.js +5 -0
- package/dist/api/resources/dataPools/client/requests/CreateDataPoolRequest.d.ts +10 -0
- package/dist/api/resources/dataPools/client/requests/CreateDataPoolRequest.js +5 -0
- package/dist/api/resources/dataPools/client/requests/UpdateDataPoolRequest.d.ts +12 -0
- package/dist/api/resources/dataPools/client/requests/UpdateDataPoolRequest.js +5 -0
- package/dist/api/resources/dataPools/client/requests/index.d.ts +3 -0
- package/dist/api/resources/dataPools/client/requests/index.js +2 -0
- package/dist/api/resources/dataPools/index.d.ts +1 -0
- package/dist/api/resources/dataPools/index.js +17 -0
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.js +41 -0
- package/dist/api/types/DataPoolDto.d.ts +23 -0
- package/dist/api/types/DataPoolDto.js +14 -0
- package/dist/api/types/DataPoolFileDto.d.ts +12 -0
- package/dist/api/types/DataPoolFileDto.js +5 -0
- package/dist/api/types/OauthScope.d.ts +9 -0
- package/dist/api/types/OauthScope.js +9 -0
- package/dist/api/types/index.d.ts +3 -0
- package/dist/api/types/index.js +19 -0
- package/dist/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +20 -0
- package/dist/core/fetcher/BinaryResponse.js +17 -0
- package/dist/core/fetcher/Fetcher.d.ts +40 -0
- package/dist/core/fetcher/Fetcher.js +105 -0
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +85 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +94 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/ResponseWithBody.d.ts +4 -0
- package/dist/core/fetcher/ResponseWithBody.js +6 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +13 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +8 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getErrorResponseBody.js +32 -0
- package/dist/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/core/fetcher/getFetchFn.js +6 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +11 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +12 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +44 -0
- package/dist/core/fetcher/index.d.ts +9 -0
- package/dist/core/fetcher/index.js +15 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +33 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +29 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/file.d.ts +1 -0
- package/dist/core/file.js +2 -0
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +16 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +166 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/core/form-data-utils/index.d.ts +2 -0
- package/dist/core/form-data-utils/index.js +20 -0
- package/dist/core/headers.d.ts +3 -0
- package/dist/core/headers.js +29 -0
- package/dist/core/index.d.ts +5 -0
- package/dist/core/index.js +44 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +101 -0
- package/dist/core/url/index.d.ts +2 -0
- package/dist/core/url/index.js +7 -0
- package/dist/core/url/join.d.ts +1 -0
- package/dist/core/url/join.js +49 -0
- package/dist/core/url/qs.d.ts +6 -0
- package/dist/core/url/qs.js +67 -0
- package/dist/environments.d.ts +7 -0
- package/dist/environments.js +9 -0
- package/dist/errors/PlanqkApiError.d.ts +15 -0
- package/dist/errors/PlanqkApiError.js +33 -0
- package/dist/errors/PlanqkApiTimeoutError.d.ts +6 -0
- package/dist/errors/PlanqkApiTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +44 -0
- package/eslint.config.mjs +11 -0
- package/fern/fern.config.json +4 -0
- package/fern/generators.yml +25 -0
- package/fern/openapi/openapi.json +610 -0
- package/notebooks/python-sdk.ipynb +218 -0
- package/package.json +48 -0
- package/planqk/__init__.py +0 -0
- package/planqk/api/__init__.py +1 -0
- package/planqk/api/_version.py +1 -0
- package/planqk/api/client.py +19 -0
- package/planqk/api/credentials.py +103 -0
- package/planqk/api/sdk/__init__.py +25 -0
- package/planqk/api/sdk/client.py +153 -0
- package/planqk/api/sdk/core/__init__.py +52 -0
- package/planqk/api/sdk/core/api_error.py +23 -0
- package/planqk/api/sdk/core/client_wrapper.py +76 -0
- package/planqk/api/sdk/core/datetime_utils.py +28 -0
- package/planqk/api/sdk/core/file.py +67 -0
- package/planqk/api/sdk/core/force_multipart.py +16 -0
- package/planqk/api/sdk/core/http_client.py +543 -0
- package/planqk/api/sdk/core/http_response.py +55 -0
- package/planqk/api/sdk/core/jsonable_encoder.py +100 -0
- package/planqk/api/sdk/core/pydantic_utilities.py +255 -0
- package/planqk/api/sdk/core/query_encoder.py +58 -0
- package/planqk/api/sdk/core/remove_none_from_dict.py +11 -0
- package/planqk/api/sdk/core/request_options.py +35 -0
- package/planqk/api/sdk/core/serialization.py +276 -0
- package/planqk/api/sdk/data_pools/__init__.py +4 -0
- package/planqk/api/sdk/data_pools/client.py +700 -0
- package/planqk/api/sdk/data_pools/raw_client.py +1650 -0
- package/planqk/api/sdk/environment.py +7 -0
- package/planqk/api/sdk/errors/__init__.py +11 -0
- package/planqk/api/sdk/errors/bad_request_error.py +10 -0
- package/planqk/api/sdk/errors/forbidden_error.py +10 -0
- package/planqk/api/sdk/errors/internal_server_error.py +10 -0
- package/planqk/api/sdk/errors/not_found_error.py +10 -0
- package/planqk/api/sdk/errors/unauthorized_error.py +10 -0
- package/planqk/api/sdk/types/__init__.py +10 -0
- package/planqk/api/sdk/types/data_pool_dto.py +33 -0
- package/planqk/api/sdk/types/data_pool_dto_current_user_permission.py +5 -0
- package/planqk/api/sdk/types/data_pool_file_dto.py +27 -0
- package/planqk/api/sdk/types/oauth_scope.py +5 -0
- package/pyproject.toml +51 -0
- package/scripts/update-version.sh +6 -0
- package/src/Client.ts +53 -0
- package/src/api/errors/BadRequestError.ts +18 -0
- package/src/api/errors/ForbiddenError.ts +18 -0
- package/src/api/errors/InternalServerError.ts +18 -0
- package/src/api/errors/NotFoundError.ts +18 -0
- package/src/api/errors/UnauthorizedError.ts +18 -0
- package/src/api/errors/index.ts +5 -0
- package/src/api/index.ts +3 -0
- package/src/api/resources/dataPools/client/Client.ts +825 -0
- package/src/api/resources/dataPools/client/index.ts +2 -0
- package/src/api/resources/dataPools/client/requests/AddDataPoolFileRequest.ts +17 -0
- package/src/api/resources/dataPools/client/requests/CreateDataPoolRequest.ts +11 -0
- package/src/api/resources/dataPools/client/requests/UpdateDataPoolRequest.ts +13 -0
- package/src/api/resources/dataPools/client/requests/index.ts +3 -0
- package/src/api/resources/dataPools/index.ts +1 -0
- package/src/api/resources/index.ts +2 -0
- package/src/api/types/DataPoolDto.ts +25 -0
- package/src/api/types/DataPoolFileDto.ts +13 -0
- package/src/api/types/OauthScope.ts +10 -0
- package/src/api/types/index.ts +3 -0
- package/src/core/fetcher/APIResponse.ts +23 -0
- package/src/core/fetcher/BinaryResponse.ts +36 -0
- package/src/core/fetcher/Fetcher.ts +163 -0
- package/src/core/fetcher/Headers.ts +93 -0
- package/src/core/fetcher/HttpResponsePromise.ts +116 -0
- package/src/core/fetcher/RawResponse.ts +61 -0
- package/src/core/fetcher/ResponseWithBody.ts +7 -0
- package/src/core/fetcher/Supplier.ts +11 -0
- package/src/core/fetcher/createRequestUrl.ts +6 -0
- package/src/core/fetcher/getErrorResponseBody.ts +32 -0
- package/src/core/fetcher/getFetchFn.ts +3 -0
- package/src/core/fetcher/getHeader.ts +8 -0
- package/src/core/fetcher/getRequestBody.ts +16 -0
- package/src/core/fetcher/getResponseBody.ts +43 -0
- package/src/core/fetcher/index.ts +9 -0
- package/src/core/fetcher/makeRequest.ts +44 -0
- package/src/core/fetcher/requestWithRetries.ts +33 -0
- package/src/core/fetcher/signals.ts +38 -0
- package/src/core/file.ts +11 -0
- package/src/core/form-data-utils/FormDataWrapper.ts +176 -0
- package/src/core/form-data-utils/encodeAsFormParameter.ts +12 -0
- package/src/core/form-data-utils/index.ts +2 -0
- package/src/core/headers.ts +35 -0
- package/src/core/index.ts +5 -0
- package/src/core/json.ts +27 -0
- package/src/core/runtime/index.ts +1 -0
- package/src/core/runtime/runtime.ts +133 -0
- package/src/core/url/index.ts +2 -0
- package/src/core/url/join.ts +55 -0
- package/src/core/url/qs.ts +74 -0
- package/src/environments.ts +9 -0
- package/src/errors/PlanqkApiError.ts +55 -0
- package/src/errors/PlanqkApiTimeoutError.ts +10 -0
- package/src/errors/index.ts +2 -0
- package/src/index.test.ts +17 -0
- package/src/index.ts +4 -0
- package/tsconfig.json +18 -0
- package/uv.lock +1102 -0
|
@@ -0,0 +1,700 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from .. import core
|
|
6
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
7
|
+
from ..core.request_options import RequestOptions
|
|
8
|
+
from ..types.data_pool_dto import DataPoolDto
|
|
9
|
+
from ..types.data_pool_file_dto import DataPoolFileDto
|
|
10
|
+
from .raw_client import AsyncRawDataPoolsClient, RawDataPoolsClient
|
|
11
|
+
|
|
12
|
+
# this is used as the default value for optional parameters
|
|
13
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class DataPoolsClient:
|
|
17
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
18
|
+
self._raw_client = RawDataPoolsClient(client_wrapper=client_wrapper)
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def with_raw_response(self) -> RawDataPoolsClient:
|
|
22
|
+
"""
|
|
23
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
24
|
+
|
|
25
|
+
Returns
|
|
26
|
+
-------
|
|
27
|
+
RawDataPoolsClient
|
|
28
|
+
"""
|
|
29
|
+
return self._raw_client
|
|
30
|
+
|
|
31
|
+
def get_data_pool(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DataPoolDto:
|
|
32
|
+
"""
|
|
33
|
+
Get a specific data pool (identified by its ID).
|
|
34
|
+
|
|
35
|
+
Parameters
|
|
36
|
+
----------
|
|
37
|
+
id : str
|
|
38
|
+
|
|
39
|
+
request_options : typing.Optional[RequestOptions]
|
|
40
|
+
Request-specific configuration.
|
|
41
|
+
|
|
42
|
+
Returns
|
|
43
|
+
-------
|
|
44
|
+
DataPoolDto
|
|
45
|
+
A data pool
|
|
46
|
+
|
|
47
|
+
Examples
|
|
48
|
+
--------
|
|
49
|
+
from planqk import PlanqkApi
|
|
50
|
+
|
|
51
|
+
client = PlanqkApi(
|
|
52
|
+
api_key="YOUR_API_KEY",
|
|
53
|
+
)
|
|
54
|
+
client.data_pools.get_data_pool(
|
|
55
|
+
id="id",
|
|
56
|
+
)
|
|
57
|
+
"""
|
|
58
|
+
_response = self._raw_client.get_data_pool(id, request_options=request_options)
|
|
59
|
+
return _response.data
|
|
60
|
+
|
|
61
|
+
def update_data_pool(
|
|
62
|
+
self,
|
|
63
|
+
id: str,
|
|
64
|
+
*,
|
|
65
|
+
name: typing.Optional[str] = OMIT,
|
|
66
|
+
short_description: typing.Optional[str] = OMIT,
|
|
67
|
+
description: typing.Optional[str] = OMIT,
|
|
68
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
69
|
+
) -> DataPoolDto:
|
|
70
|
+
"""
|
|
71
|
+
Update an existing data pool (identified by its ID).
|
|
72
|
+
|
|
73
|
+
Parameters
|
|
74
|
+
----------
|
|
75
|
+
id : str
|
|
76
|
+
|
|
77
|
+
name : typing.Optional[str]
|
|
78
|
+
|
|
79
|
+
short_description : typing.Optional[str]
|
|
80
|
+
|
|
81
|
+
description : typing.Optional[str]
|
|
82
|
+
|
|
83
|
+
request_options : typing.Optional[RequestOptions]
|
|
84
|
+
Request-specific configuration.
|
|
85
|
+
|
|
86
|
+
Returns
|
|
87
|
+
-------
|
|
88
|
+
DataPoolDto
|
|
89
|
+
Data pool is saved
|
|
90
|
+
|
|
91
|
+
Examples
|
|
92
|
+
--------
|
|
93
|
+
from planqk import PlanqkApi
|
|
94
|
+
|
|
95
|
+
client = PlanqkApi(
|
|
96
|
+
api_key="YOUR_API_KEY",
|
|
97
|
+
)
|
|
98
|
+
client.data_pools.update_data_pool(
|
|
99
|
+
id="id",
|
|
100
|
+
)
|
|
101
|
+
"""
|
|
102
|
+
_response = self._raw_client.update_data_pool(
|
|
103
|
+
id, name=name, short_description=short_description, description=description, request_options=request_options
|
|
104
|
+
)
|
|
105
|
+
return _response.data
|
|
106
|
+
|
|
107
|
+
def delete_data_pool(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
108
|
+
"""
|
|
109
|
+
Delete a specific data pool (identified by its ID).
|
|
110
|
+
|
|
111
|
+
Parameters
|
|
112
|
+
----------
|
|
113
|
+
id : str
|
|
114
|
+
|
|
115
|
+
request_options : typing.Optional[RequestOptions]
|
|
116
|
+
Request-specific configuration.
|
|
117
|
+
|
|
118
|
+
Returns
|
|
119
|
+
-------
|
|
120
|
+
None
|
|
121
|
+
|
|
122
|
+
Examples
|
|
123
|
+
--------
|
|
124
|
+
from planqk import PlanqkApi
|
|
125
|
+
|
|
126
|
+
client = PlanqkApi(
|
|
127
|
+
api_key="YOUR_API_KEY",
|
|
128
|
+
)
|
|
129
|
+
client.data_pools.delete_data_pool(
|
|
130
|
+
id="id",
|
|
131
|
+
)
|
|
132
|
+
"""
|
|
133
|
+
_response = self._raw_client.delete_data_pool(id, request_options=request_options)
|
|
134
|
+
return _response.data
|
|
135
|
+
|
|
136
|
+
def get_data_pools(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[DataPoolDto]:
|
|
137
|
+
"""
|
|
138
|
+
Get a list of all data pools for the current user.
|
|
139
|
+
|
|
140
|
+
Parameters
|
|
141
|
+
----------
|
|
142
|
+
request_options : typing.Optional[RequestOptions]
|
|
143
|
+
Request-specific configuration.
|
|
144
|
+
|
|
145
|
+
Returns
|
|
146
|
+
-------
|
|
147
|
+
typing.List[DataPoolDto]
|
|
148
|
+
List of data pools
|
|
149
|
+
|
|
150
|
+
Examples
|
|
151
|
+
--------
|
|
152
|
+
from planqk import PlanqkApi
|
|
153
|
+
|
|
154
|
+
client = PlanqkApi(
|
|
155
|
+
api_key="YOUR_API_KEY",
|
|
156
|
+
)
|
|
157
|
+
client.data_pools.get_data_pools()
|
|
158
|
+
"""
|
|
159
|
+
_response = self._raw_client.get_data_pools(request_options=request_options)
|
|
160
|
+
return _response.data
|
|
161
|
+
|
|
162
|
+
def create_data_pool(
|
|
163
|
+
self, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None
|
|
164
|
+
) -> DataPoolDto:
|
|
165
|
+
"""
|
|
166
|
+
Create a new data pool.
|
|
167
|
+
|
|
168
|
+
Parameters
|
|
169
|
+
----------
|
|
170
|
+
name : typing.Optional[str]
|
|
171
|
+
|
|
172
|
+
request_options : typing.Optional[RequestOptions]
|
|
173
|
+
Request-specific configuration.
|
|
174
|
+
|
|
175
|
+
Returns
|
|
176
|
+
-------
|
|
177
|
+
DataPoolDto
|
|
178
|
+
Data pool is created
|
|
179
|
+
|
|
180
|
+
Examples
|
|
181
|
+
--------
|
|
182
|
+
from planqk import PlanqkApi
|
|
183
|
+
|
|
184
|
+
client = PlanqkApi(
|
|
185
|
+
api_key="YOUR_API_KEY",
|
|
186
|
+
)
|
|
187
|
+
client.data_pools.create_data_pool()
|
|
188
|
+
"""
|
|
189
|
+
_response = self._raw_client.create_data_pool(name=name, request_options=request_options)
|
|
190
|
+
return _response.data
|
|
191
|
+
|
|
192
|
+
def get_data_pool_files(
|
|
193
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
194
|
+
) -> typing.List[DataPoolFileDto]:
|
|
195
|
+
"""
|
|
196
|
+
Get all files associated with a specific data pool (identified by its ID).
|
|
197
|
+
|
|
198
|
+
Parameters
|
|
199
|
+
----------
|
|
200
|
+
id : str
|
|
201
|
+
|
|
202
|
+
request_options : typing.Optional[RequestOptions]
|
|
203
|
+
Request-specific configuration.
|
|
204
|
+
|
|
205
|
+
Returns
|
|
206
|
+
-------
|
|
207
|
+
typing.List[DataPoolFileDto]
|
|
208
|
+
List of files in the data pool
|
|
209
|
+
|
|
210
|
+
Examples
|
|
211
|
+
--------
|
|
212
|
+
from planqk import PlanqkApi
|
|
213
|
+
|
|
214
|
+
client = PlanqkApi(
|
|
215
|
+
api_key="YOUR_API_KEY",
|
|
216
|
+
)
|
|
217
|
+
client.data_pools.get_data_pool_files(
|
|
218
|
+
id="id",
|
|
219
|
+
)
|
|
220
|
+
"""
|
|
221
|
+
_response = self._raw_client.get_data_pool_files(id, request_options=request_options)
|
|
222
|
+
return _response.data
|
|
223
|
+
|
|
224
|
+
def add_data_pool_file(
|
|
225
|
+
self,
|
|
226
|
+
id: str,
|
|
227
|
+
*,
|
|
228
|
+
file: core.File,
|
|
229
|
+
filename: typing.Optional[str] = None,
|
|
230
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
231
|
+
) -> DataPoolFileDto:
|
|
232
|
+
"""
|
|
233
|
+
Add a new file to a specific data pool (identified by its ID).
|
|
234
|
+
|
|
235
|
+
Parameters
|
|
236
|
+
----------
|
|
237
|
+
id : str
|
|
238
|
+
|
|
239
|
+
file : core.File
|
|
240
|
+
See core.File for more documentation
|
|
241
|
+
|
|
242
|
+
filename : typing.Optional[str]
|
|
243
|
+
|
|
244
|
+
request_options : typing.Optional[RequestOptions]
|
|
245
|
+
Request-specific configuration.
|
|
246
|
+
|
|
247
|
+
Returns
|
|
248
|
+
-------
|
|
249
|
+
DataPoolFileDto
|
|
250
|
+
File is added to the data pool
|
|
251
|
+
|
|
252
|
+
Examples
|
|
253
|
+
--------
|
|
254
|
+
from planqk import PlanqkApi
|
|
255
|
+
|
|
256
|
+
client = PlanqkApi(
|
|
257
|
+
api_key="YOUR_API_KEY",
|
|
258
|
+
)
|
|
259
|
+
client.data_pools.add_data_pool_file(
|
|
260
|
+
id="id",
|
|
261
|
+
)
|
|
262
|
+
"""
|
|
263
|
+
_response = self._raw_client.add_data_pool_file(
|
|
264
|
+
id, file=file, filename=filename, request_options=request_options
|
|
265
|
+
)
|
|
266
|
+
return _response.data
|
|
267
|
+
|
|
268
|
+
def get_data_pool_file(
|
|
269
|
+
self, id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
270
|
+
) -> typing.Iterator[bytes]:
|
|
271
|
+
"""
|
|
272
|
+
Get the content of a specific file from a data pool (both file and data pool identified by their ID).
|
|
273
|
+
|
|
274
|
+
Parameters
|
|
275
|
+
----------
|
|
276
|
+
id : str
|
|
277
|
+
|
|
278
|
+
file_id : str
|
|
279
|
+
|
|
280
|
+
request_options : typing.Optional[RequestOptions]
|
|
281
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
282
|
+
|
|
283
|
+
Returns
|
|
284
|
+
-------
|
|
285
|
+
typing.Iterator[bytes]
|
|
286
|
+
The file content
|
|
287
|
+
"""
|
|
288
|
+
with self._raw_client.get_data_pool_file(id, file_id, request_options=request_options) as r:
|
|
289
|
+
yield from r.data
|
|
290
|
+
|
|
291
|
+
def delete_data_pool_file(
|
|
292
|
+
self, id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
293
|
+
) -> None:
|
|
294
|
+
"""
|
|
295
|
+
Delete a specific file from a data pool (both file and data pool identified by their IDs).
|
|
296
|
+
|
|
297
|
+
Parameters
|
|
298
|
+
----------
|
|
299
|
+
id : str
|
|
300
|
+
|
|
301
|
+
file_id : str
|
|
302
|
+
|
|
303
|
+
request_options : typing.Optional[RequestOptions]
|
|
304
|
+
Request-specific configuration.
|
|
305
|
+
|
|
306
|
+
Returns
|
|
307
|
+
-------
|
|
308
|
+
None
|
|
309
|
+
|
|
310
|
+
Examples
|
|
311
|
+
--------
|
|
312
|
+
from planqk import PlanqkApi
|
|
313
|
+
|
|
314
|
+
client = PlanqkApi(
|
|
315
|
+
api_key="YOUR_API_KEY",
|
|
316
|
+
)
|
|
317
|
+
client.data_pools.delete_data_pool_file(
|
|
318
|
+
id="id",
|
|
319
|
+
file_id="fileId",
|
|
320
|
+
)
|
|
321
|
+
"""
|
|
322
|
+
_response = self._raw_client.delete_data_pool_file(id, file_id, request_options=request_options)
|
|
323
|
+
return _response.data
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
class AsyncDataPoolsClient:
|
|
327
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
328
|
+
self._raw_client = AsyncRawDataPoolsClient(client_wrapper=client_wrapper)
|
|
329
|
+
|
|
330
|
+
@property
|
|
331
|
+
def with_raw_response(self) -> AsyncRawDataPoolsClient:
|
|
332
|
+
"""
|
|
333
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
334
|
+
|
|
335
|
+
Returns
|
|
336
|
+
-------
|
|
337
|
+
AsyncRawDataPoolsClient
|
|
338
|
+
"""
|
|
339
|
+
return self._raw_client
|
|
340
|
+
|
|
341
|
+
async def get_data_pool(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> DataPoolDto:
|
|
342
|
+
"""
|
|
343
|
+
Get a specific data pool (identified by its ID).
|
|
344
|
+
|
|
345
|
+
Parameters
|
|
346
|
+
----------
|
|
347
|
+
id : str
|
|
348
|
+
|
|
349
|
+
request_options : typing.Optional[RequestOptions]
|
|
350
|
+
Request-specific configuration.
|
|
351
|
+
|
|
352
|
+
Returns
|
|
353
|
+
-------
|
|
354
|
+
DataPoolDto
|
|
355
|
+
A data pool
|
|
356
|
+
|
|
357
|
+
Examples
|
|
358
|
+
--------
|
|
359
|
+
import asyncio
|
|
360
|
+
|
|
361
|
+
from planqk import AsyncPlanqkApi
|
|
362
|
+
|
|
363
|
+
client = AsyncPlanqkApi(
|
|
364
|
+
api_key="YOUR_API_KEY",
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
async def main() -> None:
|
|
369
|
+
await client.data_pools.get_data_pool(
|
|
370
|
+
id="id",
|
|
371
|
+
)
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
asyncio.run(main())
|
|
375
|
+
"""
|
|
376
|
+
_response = await self._raw_client.get_data_pool(id, request_options=request_options)
|
|
377
|
+
return _response.data
|
|
378
|
+
|
|
379
|
+
async def update_data_pool(
|
|
380
|
+
self,
|
|
381
|
+
id: str,
|
|
382
|
+
*,
|
|
383
|
+
name: typing.Optional[str] = OMIT,
|
|
384
|
+
short_description: typing.Optional[str] = OMIT,
|
|
385
|
+
description: typing.Optional[str] = OMIT,
|
|
386
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
387
|
+
) -> DataPoolDto:
|
|
388
|
+
"""
|
|
389
|
+
Update an existing data pool (identified by its ID).
|
|
390
|
+
|
|
391
|
+
Parameters
|
|
392
|
+
----------
|
|
393
|
+
id : str
|
|
394
|
+
|
|
395
|
+
name : typing.Optional[str]
|
|
396
|
+
|
|
397
|
+
short_description : typing.Optional[str]
|
|
398
|
+
|
|
399
|
+
description : typing.Optional[str]
|
|
400
|
+
|
|
401
|
+
request_options : typing.Optional[RequestOptions]
|
|
402
|
+
Request-specific configuration.
|
|
403
|
+
|
|
404
|
+
Returns
|
|
405
|
+
-------
|
|
406
|
+
DataPoolDto
|
|
407
|
+
Data pool is saved
|
|
408
|
+
|
|
409
|
+
Examples
|
|
410
|
+
--------
|
|
411
|
+
import asyncio
|
|
412
|
+
|
|
413
|
+
from planqk import AsyncPlanqkApi
|
|
414
|
+
|
|
415
|
+
client = AsyncPlanqkApi(
|
|
416
|
+
api_key="YOUR_API_KEY",
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
async def main() -> None:
|
|
421
|
+
await client.data_pools.update_data_pool(
|
|
422
|
+
id="id",
|
|
423
|
+
)
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
asyncio.run(main())
|
|
427
|
+
"""
|
|
428
|
+
_response = await self._raw_client.update_data_pool(
|
|
429
|
+
id, name=name, short_description=short_description, description=description, request_options=request_options
|
|
430
|
+
)
|
|
431
|
+
return _response.data
|
|
432
|
+
|
|
433
|
+
async def delete_data_pool(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
|
|
434
|
+
"""
|
|
435
|
+
Delete a specific data pool (identified by its ID).
|
|
436
|
+
|
|
437
|
+
Parameters
|
|
438
|
+
----------
|
|
439
|
+
id : str
|
|
440
|
+
|
|
441
|
+
request_options : typing.Optional[RequestOptions]
|
|
442
|
+
Request-specific configuration.
|
|
443
|
+
|
|
444
|
+
Returns
|
|
445
|
+
-------
|
|
446
|
+
None
|
|
447
|
+
|
|
448
|
+
Examples
|
|
449
|
+
--------
|
|
450
|
+
import asyncio
|
|
451
|
+
|
|
452
|
+
from planqk import AsyncPlanqkApi
|
|
453
|
+
|
|
454
|
+
client = AsyncPlanqkApi(
|
|
455
|
+
api_key="YOUR_API_KEY",
|
|
456
|
+
)
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
async def main() -> None:
|
|
460
|
+
await client.data_pools.delete_data_pool(
|
|
461
|
+
id="id",
|
|
462
|
+
)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
asyncio.run(main())
|
|
466
|
+
"""
|
|
467
|
+
_response = await self._raw_client.delete_data_pool(id, request_options=request_options)
|
|
468
|
+
return _response.data
|
|
469
|
+
|
|
470
|
+
async def get_data_pools(
|
|
471
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
472
|
+
) -> typing.List[DataPoolDto]:
|
|
473
|
+
"""
|
|
474
|
+
Get a list of all data pools for the current user.
|
|
475
|
+
|
|
476
|
+
Parameters
|
|
477
|
+
----------
|
|
478
|
+
request_options : typing.Optional[RequestOptions]
|
|
479
|
+
Request-specific configuration.
|
|
480
|
+
|
|
481
|
+
Returns
|
|
482
|
+
-------
|
|
483
|
+
typing.List[DataPoolDto]
|
|
484
|
+
List of data pools
|
|
485
|
+
|
|
486
|
+
Examples
|
|
487
|
+
--------
|
|
488
|
+
import asyncio
|
|
489
|
+
|
|
490
|
+
from planqk import AsyncPlanqkApi
|
|
491
|
+
|
|
492
|
+
client = AsyncPlanqkApi(
|
|
493
|
+
api_key="YOUR_API_KEY",
|
|
494
|
+
)
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
async def main() -> None:
|
|
498
|
+
await client.data_pools.get_data_pools()
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
asyncio.run(main())
|
|
502
|
+
"""
|
|
503
|
+
_response = await self._raw_client.get_data_pools(request_options=request_options)
|
|
504
|
+
return _response.data
|
|
505
|
+
|
|
506
|
+
async def create_data_pool(
|
|
507
|
+
self, *, name: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None
|
|
508
|
+
) -> DataPoolDto:
|
|
509
|
+
"""
|
|
510
|
+
Create a new data pool.
|
|
511
|
+
|
|
512
|
+
Parameters
|
|
513
|
+
----------
|
|
514
|
+
name : typing.Optional[str]
|
|
515
|
+
|
|
516
|
+
request_options : typing.Optional[RequestOptions]
|
|
517
|
+
Request-specific configuration.
|
|
518
|
+
|
|
519
|
+
Returns
|
|
520
|
+
-------
|
|
521
|
+
DataPoolDto
|
|
522
|
+
Data pool is created
|
|
523
|
+
|
|
524
|
+
Examples
|
|
525
|
+
--------
|
|
526
|
+
import asyncio
|
|
527
|
+
|
|
528
|
+
from planqk import AsyncPlanqkApi
|
|
529
|
+
|
|
530
|
+
client = AsyncPlanqkApi(
|
|
531
|
+
api_key="YOUR_API_KEY",
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
async def main() -> None:
|
|
536
|
+
await client.data_pools.create_data_pool()
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
asyncio.run(main())
|
|
540
|
+
"""
|
|
541
|
+
_response = await self._raw_client.create_data_pool(name=name, request_options=request_options)
|
|
542
|
+
return _response.data
|
|
543
|
+
|
|
544
|
+
async def get_data_pool_files(
|
|
545
|
+
self, id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
546
|
+
) -> typing.List[DataPoolFileDto]:
|
|
547
|
+
"""
|
|
548
|
+
Get all files associated with a specific data pool (identified by its ID).
|
|
549
|
+
|
|
550
|
+
Parameters
|
|
551
|
+
----------
|
|
552
|
+
id : str
|
|
553
|
+
|
|
554
|
+
request_options : typing.Optional[RequestOptions]
|
|
555
|
+
Request-specific configuration.
|
|
556
|
+
|
|
557
|
+
Returns
|
|
558
|
+
-------
|
|
559
|
+
typing.List[DataPoolFileDto]
|
|
560
|
+
List of files in the data pool
|
|
561
|
+
|
|
562
|
+
Examples
|
|
563
|
+
--------
|
|
564
|
+
import asyncio
|
|
565
|
+
|
|
566
|
+
from planqk import AsyncPlanqkApi
|
|
567
|
+
|
|
568
|
+
client = AsyncPlanqkApi(
|
|
569
|
+
api_key="YOUR_API_KEY",
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
async def main() -> None:
|
|
574
|
+
await client.data_pools.get_data_pool_files(
|
|
575
|
+
id="id",
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
asyncio.run(main())
|
|
580
|
+
"""
|
|
581
|
+
_response = await self._raw_client.get_data_pool_files(id, request_options=request_options)
|
|
582
|
+
return _response.data
|
|
583
|
+
|
|
584
|
+
async def add_data_pool_file(
|
|
585
|
+
self,
|
|
586
|
+
id: str,
|
|
587
|
+
*,
|
|
588
|
+
file: core.File,
|
|
589
|
+
filename: typing.Optional[str] = None,
|
|
590
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
591
|
+
) -> DataPoolFileDto:
|
|
592
|
+
"""
|
|
593
|
+
Add a new file to a specific data pool (identified by its ID).
|
|
594
|
+
|
|
595
|
+
Parameters
|
|
596
|
+
----------
|
|
597
|
+
id : str
|
|
598
|
+
|
|
599
|
+
file : core.File
|
|
600
|
+
See core.File for more documentation
|
|
601
|
+
|
|
602
|
+
filename : typing.Optional[str]
|
|
603
|
+
|
|
604
|
+
request_options : typing.Optional[RequestOptions]
|
|
605
|
+
Request-specific configuration.
|
|
606
|
+
|
|
607
|
+
Returns
|
|
608
|
+
-------
|
|
609
|
+
DataPoolFileDto
|
|
610
|
+
File is added to the data pool
|
|
611
|
+
|
|
612
|
+
Examples
|
|
613
|
+
--------
|
|
614
|
+
import asyncio
|
|
615
|
+
|
|
616
|
+
from planqk import AsyncPlanqkApi
|
|
617
|
+
|
|
618
|
+
client = AsyncPlanqkApi(
|
|
619
|
+
api_key="YOUR_API_KEY",
|
|
620
|
+
)
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
async def main() -> None:
|
|
624
|
+
await client.data_pools.add_data_pool_file(
|
|
625
|
+
id="id",
|
|
626
|
+
)
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
asyncio.run(main())
|
|
630
|
+
"""
|
|
631
|
+
_response = await self._raw_client.add_data_pool_file(
|
|
632
|
+
id, file=file, filename=filename, request_options=request_options
|
|
633
|
+
)
|
|
634
|
+
return _response.data
|
|
635
|
+
|
|
636
|
+
async def get_data_pool_file(
|
|
637
|
+
self, id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
638
|
+
) -> typing.AsyncIterator[bytes]:
|
|
639
|
+
"""
|
|
640
|
+
Get the content of a specific file from a data pool (both file and data pool identified by their ID).
|
|
641
|
+
|
|
642
|
+
Parameters
|
|
643
|
+
----------
|
|
644
|
+
id : str
|
|
645
|
+
|
|
646
|
+
file_id : str
|
|
647
|
+
|
|
648
|
+
request_options : typing.Optional[RequestOptions]
|
|
649
|
+
Request-specific configuration. You can pass in configuration such as `chunk_size`, and more to customize the request and response.
|
|
650
|
+
|
|
651
|
+
Returns
|
|
652
|
+
-------
|
|
653
|
+
typing.AsyncIterator[bytes]
|
|
654
|
+
The file content
|
|
655
|
+
"""
|
|
656
|
+
async with self._raw_client.get_data_pool_file(id, file_id, request_options=request_options) as r:
|
|
657
|
+
async for _chunk in r.data:
|
|
658
|
+
yield _chunk
|
|
659
|
+
|
|
660
|
+
async def delete_data_pool_file(
|
|
661
|
+
self, id: str, file_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
662
|
+
) -> None:
|
|
663
|
+
"""
|
|
664
|
+
Delete a specific file from a data pool (both file and data pool identified by their IDs).
|
|
665
|
+
|
|
666
|
+
Parameters
|
|
667
|
+
----------
|
|
668
|
+
id : str
|
|
669
|
+
|
|
670
|
+
file_id : str
|
|
671
|
+
|
|
672
|
+
request_options : typing.Optional[RequestOptions]
|
|
673
|
+
Request-specific configuration.
|
|
674
|
+
|
|
675
|
+
Returns
|
|
676
|
+
-------
|
|
677
|
+
None
|
|
678
|
+
|
|
679
|
+
Examples
|
|
680
|
+
--------
|
|
681
|
+
import asyncio
|
|
682
|
+
|
|
683
|
+
from planqk import AsyncPlanqkApi
|
|
684
|
+
|
|
685
|
+
client = AsyncPlanqkApi(
|
|
686
|
+
api_key="YOUR_API_KEY",
|
|
687
|
+
)
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
async def main() -> None:
|
|
691
|
+
await client.data_pools.delete_data_pool_file(
|
|
692
|
+
id="id",
|
|
693
|
+
file_id="fileId",
|
|
694
|
+
)
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
asyncio.run(main())
|
|
698
|
+
"""
|
|
699
|
+
_response = await self._raw_client.delete_data_pool_file(id, file_id, request_options=request_options)
|
|
700
|
+
return _response.data
|