qubitclient 0.0.0.1__py3-none-any.whl → 0.0.3.0__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.
Potentially problematic release.
This version of qubitclient might be problematic. Click here for more details.
- qubitclient/__init__.py +6 -1
- qubitclient/nnscope/nnscope.py +51 -0
- qubitclient/{QubitSeg.py → nnscope/nnscope_api/QubitSeg.py} +7 -7
- qubitclient/nnscope/nnscope_api/curve/__init__.py +0 -0
- qubitclient/nnscope/nnscope_api/curve/curve_type.py +15 -0
- qubitclient/nnscope/task.py +130 -0
- qubitclient/nnscope/utils/data_convert.py +114 -0
- qubitclient/nnscope/utils/data_parser.py +41 -0
- qubitclient/nnscope/utils/request_tool.py +41 -0
- qubitclient/nnscope/utils/result_parser.py +55 -0
- qubitclient/scope/scope.py +51 -0
- qubitclient/scope/scope_api/__init__.py +8 -0
- qubitclient/scope/scope_api/api/__init__.py +1 -0
- qubitclient/scope/scope_api/api/defined_tasks/__init__.py +1 -0
- qubitclient/scope/scope_api/api/defined_tasks/get_task_result_api_v1_tasks_demo_pk_get.py +155 -0
- qubitclient/scope/scope_api/api/defined_tasks/get_task_result_api_v1_tasks_scope_pk_get.py +155 -0
- qubitclient/scope/scope_api/api/defined_tasks/optpipulse_api_v1_tasks_scope_optpipulse_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/rabi_api_v1_tasks_scope_rabi_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/rabicos_api_v1_tasks_scope_rabicospeak_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/s21peak_api_v1_tasks_scope_s21peak_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/s21vflux_api_v1_tasks_scope_s21vflux_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/singleshot_api_v1_tasks_scope_singleshot_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/spectrum2d_api_v1_tasks_scope_spectrum2d_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/spectrum_api_v1_tasks_scope_spectrum_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/t1fit_api_v1_tasks_scope_t1fit_post.py +218 -0
- qubitclient/scope/scope_api/api/defined_tasks/t1fit_api_v1_tasks_scope_t2fit_post.py +218 -0
- qubitclient/scope/scope_api/client.py +268 -0
- qubitclient/scope/scope_api/errors.py +16 -0
- qubitclient/scope/scope_api/models/__init__.py +29 -0
- qubitclient/scope/scope_api/models/body_optpipulse_api_v1_tasks_scope_optpipulse_post.py +83 -0
- qubitclient/scope/scope_api/models/body_rabi_api_v1_tasks_scope_rabi_post.py +83 -0
- qubitclient/scope/scope_api/models/body_rabicos_api_v1_tasks_scope_rabicospeak_post.py +83 -0
- qubitclient/scope/scope_api/models/body_s21_peak_api_v1_tasks_scope_s21_peak_post.py +83 -0
- qubitclient/scope/scope_api/models/body_s21_vflux_api_v1_tasks_scope_s21_vflux_post.py +83 -0
- qubitclient/scope/scope_api/models/body_singleshot_api_v1_tasks_scope_singleshot_post.py +83 -0
- qubitclient/scope/scope_api/models/body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post.py +83 -0
- qubitclient/scope/scope_api/models/body_spectrum_api_v1_tasks_scope_spectrum_post.py +83 -0
- qubitclient/scope/scope_api/models/body_t1_fit_api_v1_tasks_scope_t1_fit_post.py +83 -0
- qubitclient/scope/scope_api/models/body_t1_fit_api_v1_tasks_scope_t2_fit_post.py +83 -0
- qubitclient/scope/scope_api/models/http_validation_error.py +75 -0
- qubitclient/scope/scope_api/models/validation_error.py +88 -0
- qubitclient/scope/scope_api/types.py +54 -0
- qubitclient/scope/task.py +147 -0
- qubitclient/scope/utils/__init__.py +0 -0
- qubitclient/scope/utils/data_parser.py +20 -0
- qubitclient-0.0.3.0.dist-info/METADATA +112 -0
- qubitclient-0.0.3.0.dist-info/RECORD +51 -0
- qubitclient-0.0.0.1.dist-info/METADATA +0 -35
- qubitclient-0.0.0.1.dist-info/RECORD +0 -8
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/WHEEL +0 -0
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/licenses/LICENSE +0 -0
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/top_level.txt +0 -0
- {qubitclient-0.0.0.1.dist-info → qubitclient-0.0.3.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import ssl
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
from attrs import define, evolve, field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@define
|
|
9
|
+
class Client:
|
|
10
|
+
"""A class for keeping track of data related to the API
|
|
11
|
+
|
|
12
|
+
The following are accepted as keyword arguments and will be used to construct httpx Clients internally:
|
|
13
|
+
|
|
14
|
+
``base_url``: The base URL for the API, all requests are made to a relative path to this URL
|
|
15
|
+
|
|
16
|
+
``cookies``: A dictionary of cookies to be sent with every request
|
|
17
|
+
|
|
18
|
+
``headers``: A dictionary of headers to be sent with every request
|
|
19
|
+
|
|
20
|
+
``timeout``: The maximum amount of a time a request can take. API functions will raise
|
|
21
|
+
httpx.TimeoutException if this is exceeded.
|
|
22
|
+
|
|
23
|
+
``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
|
|
24
|
+
but can be set to False for testing purposes.
|
|
25
|
+
|
|
26
|
+
``follow_redirects``: Whether or not to follow redirects. Default value is False.
|
|
27
|
+
|
|
28
|
+
``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Attributes:
|
|
32
|
+
raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
|
|
33
|
+
status code that was not documented in the source OpenAPI document. Can also be provided as a keyword
|
|
34
|
+
argument to the constructor.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
raise_on_unexpected_status: bool = field(default=False, kw_only=True)
|
|
38
|
+
_base_url: str = field(alias="base_url")
|
|
39
|
+
_cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
|
|
40
|
+
_headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
|
|
41
|
+
_timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout")
|
|
42
|
+
_verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl")
|
|
43
|
+
_follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects")
|
|
44
|
+
_httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
|
|
45
|
+
_client: Optional[httpx.Client] = field(default=None, init=False)
|
|
46
|
+
_async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
|
|
47
|
+
|
|
48
|
+
def with_headers(self, headers: dict[str, str]) -> "Client":
|
|
49
|
+
"""Get a new client matching this one with additional headers"""
|
|
50
|
+
if self._client is not None:
|
|
51
|
+
self._client.headers.update(headers)
|
|
52
|
+
if self._async_client is not None:
|
|
53
|
+
self._async_client.headers.update(headers)
|
|
54
|
+
return evolve(self, headers={**self._headers, **headers})
|
|
55
|
+
|
|
56
|
+
def with_cookies(self, cookies: dict[str, str]) -> "Client":
|
|
57
|
+
"""Get a new client matching this one with additional cookies"""
|
|
58
|
+
if self._client is not None:
|
|
59
|
+
self._client.cookies.update(cookies)
|
|
60
|
+
if self._async_client is not None:
|
|
61
|
+
self._async_client.cookies.update(cookies)
|
|
62
|
+
return evolve(self, cookies={**self._cookies, **cookies})
|
|
63
|
+
|
|
64
|
+
def with_timeout(self, timeout: httpx.Timeout) -> "Client":
|
|
65
|
+
"""Get a new client matching this one with a new timeout (in seconds)"""
|
|
66
|
+
if self._client is not None:
|
|
67
|
+
self._client.timeout = timeout
|
|
68
|
+
if self._async_client is not None:
|
|
69
|
+
self._async_client.timeout = timeout
|
|
70
|
+
return evolve(self, timeout=timeout)
|
|
71
|
+
|
|
72
|
+
def set_httpx_client(self, client: httpx.Client) -> "Client":
|
|
73
|
+
"""Manually set the underlying httpx.Client
|
|
74
|
+
|
|
75
|
+
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
|
|
76
|
+
"""
|
|
77
|
+
self._client = client
|
|
78
|
+
return self
|
|
79
|
+
|
|
80
|
+
def get_httpx_client(self) -> httpx.Client:
|
|
81
|
+
"""Get the underlying httpx.Client, constructing a new one if not previously set"""
|
|
82
|
+
if self._client is None:
|
|
83
|
+
self._client = httpx.Client(
|
|
84
|
+
base_url=self._base_url,
|
|
85
|
+
cookies=self._cookies,
|
|
86
|
+
headers=self._headers,
|
|
87
|
+
timeout=self._timeout,
|
|
88
|
+
verify=self._verify_ssl,
|
|
89
|
+
follow_redirects=self._follow_redirects,
|
|
90
|
+
**self._httpx_args,
|
|
91
|
+
)
|
|
92
|
+
return self._client
|
|
93
|
+
|
|
94
|
+
def __enter__(self) -> "Client":
|
|
95
|
+
"""Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
|
|
96
|
+
self.get_httpx_client().__enter__()
|
|
97
|
+
return self
|
|
98
|
+
|
|
99
|
+
def __exit__(self, *args: Any, **kwargs: Any) -> None:
|
|
100
|
+
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
|
|
101
|
+
self.get_httpx_client().__exit__(*args, **kwargs)
|
|
102
|
+
|
|
103
|
+
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "Client":
|
|
104
|
+
"""Manually the underlying httpx.AsyncClient
|
|
105
|
+
|
|
106
|
+
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
|
|
107
|
+
"""
|
|
108
|
+
self._async_client = async_client
|
|
109
|
+
return self
|
|
110
|
+
|
|
111
|
+
def get_async_httpx_client(self) -> httpx.AsyncClient:
|
|
112
|
+
"""Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
|
|
113
|
+
if self._async_client is None:
|
|
114
|
+
self._async_client = httpx.AsyncClient(
|
|
115
|
+
base_url=self._base_url,
|
|
116
|
+
cookies=self._cookies,
|
|
117
|
+
headers=self._headers,
|
|
118
|
+
timeout=self._timeout,
|
|
119
|
+
verify=self._verify_ssl,
|
|
120
|
+
follow_redirects=self._follow_redirects,
|
|
121
|
+
**self._httpx_args,
|
|
122
|
+
)
|
|
123
|
+
return self._async_client
|
|
124
|
+
|
|
125
|
+
async def __aenter__(self) -> "Client":
|
|
126
|
+
"""Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
|
|
127
|
+
await self.get_async_httpx_client().__aenter__()
|
|
128
|
+
return self
|
|
129
|
+
|
|
130
|
+
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
|
|
131
|
+
"""Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
|
|
132
|
+
await self.get_async_httpx_client().__aexit__(*args, **kwargs)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
@define
|
|
136
|
+
class AuthenticatedClient:
|
|
137
|
+
"""A Client which has been authenticated for use on secured endpoints
|
|
138
|
+
|
|
139
|
+
The following are accepted as keyword arguments and will be used to construct httpx Clients internally:
|
|
140
|
+
|
|
141
|
+
``base_url``: The base URL for the API, all requests are made to a relative path to this URL
|
|
142
|
+
|
|
143
|
+
``cookies``: A dictionary of cookies to be sent with every request
|
|
144
|
+
|
|
145
|
+
``headers``: A dictionary of headers to be sent with every request
|
|
146
|
+
|
|
147
|
+
``timeout``: The maximum amount of a time a request can take. API functions will raise
|
|
148
|
+
httpx.TimeoutException if this is exceeded.
|
|
149
|
+
|
|
150
|
+
``verify_ssl``: Whether or not to verify the SSL certificate of the API server. This should be True in production,
|
|
151
|
+
but can be set to False for testing purposes.
|
|
152
|
+
|
|
153
|
+
``follow_redirects``: Whether or not to follow redirects. Default value is False.
|
|
154
|
+
|
|
155
|
+
``httpx_args``: A dictionary of additional arguments to be passed to the ``httpx.Client`` and ``httpx.AsyncClient`` constructor.
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
Attributes:
|
|
159
|
+
raise_on_unexpected_status: Whether or not to raise an errors.UnexpectedStatus if the API returns a
|
|
160
|
+
status code that was not documented in the source OpenAPI document. Can also be provided as a keyword
|
|
161
|
+
argument to the constructor.
|
|
162
|
+
token: The token to use for authentication
|
|
163
|
+
prefix: The prefix to use for the Authorization header
|
|
164
|
+
auth_header_name: The name of the Authorization header
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
raise_on_unexpected_status: bool = field(default=False, kw_only=True)
|
|
168
|
+
_base_url: str = field(alias="base_url")
|
|
169
|
+
_cookies: dict[str, str] = field(factory=dict, kw_only=True, alias="cookies")
|
|
170
|
+
_headers: dict[str, str] = field(factory=dict, kw_only=True, alias="headers")
|
|
171
|
+
_timeout: Optional[httpx.Timeout] = field(default=None, kw_only=True, alias="timeout")
|
|
172
|
+
_verify_ssl: Union[str, bool, ssl.SSLContext] = field(default=True, kw_only=True, alias="verify_ssl")
|
|
173
|
+
_follow_redirects: bool = field(default=False, kw_only=True, alias="follow_redirects")
|
|
174
|
+
_httpx_args: dict[str, Any] = field(factory=dict, kw_only=True, alias="httpx_args")
|
|
175
|
+
_client: Optional[httpx.Client] = field(default=None, init=False)
|
|
176
|
+
_async_client: Optional[httpx.AsyncClient] = field(default=None, init=False)
|
|
177
|
+
|
|
178
|
+
token: str
|
|
179
|
+
prefix: str = "Bearer"
|
|
180
|
+
auth_header_name: str = "Authorization"
|
|
181
|
+
|
|
182
|
+
def with_headers(self, headers: dict[str, str]) -> "AuthenticatedClient":
|
|
183
|
+
"""Get a new client matching this one with additional headers"""
|
|
184
|
+
if self._client is not None:
|
|
185
|
+
self._client.headers.update(headers)
|
|
186
|
+
if self._async_client is not None:
|
|
187
|
+
self._async_client.headers.update(headers)
|
|
188
|
+
return evolve(self, headers={**self._headers, **headers})
|
|
189
|
+
|
|
190
|
+
def with_cookies(self, cookies: dict[str, str]) -> "AuthenticatedClient":
|
|
191
|
+
"""Get a new client matching this one with additional cookies"""
|
|
192
|
+
if self._client is not None:
|
|
193
|
+
self._client.cookies.update(cookies)
|
|
194
|
+
if self._async_client is not None:
|
|
195
|
+
self._async_client.cookies.update(cookies)
|
|
196
|
+
return evolve(self, cookies={**self._cookies, **cookies})
|
|
197
|
+
|
|
198
|
+
def with_timeout(self, timeout: httpx.Timeout) -> "AuthenticatedClient":
|
|
199
|
+
"""Get a new client matching this one with a new timeout (in seconds)"""
|
|
200
|
+
if self._client is not None:
|
|
201
|
+
self._client.timeout = timeout
|
|
202
|
+
if self._async_client is not None:
|
|
203
|
+
self._async_client.timeout = timeout
|
|
204
|
+
return evolve(self, timeout=timeout)
|
|
205
|
+
|
|
206
|
+
def set_httpx_client(self, client: httpx.Client) -> "AuthenticatedClient":
|
|
207
|
+
"""Manually set the underlying httpx.Client
|
|
208
|
+
|
|
209
|
+
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
|
|
210
|
+
"""
|
|
211
|
+
self._client = client
|
|
212
|
+
return self
|
|
213
|
+
|
|
214
|
+
def get_httpx_client(self) -> httpx.Client:
|
|
215
|
+
"""Get the underlying httpx.Client, constructing a new one if not previously set"""
|
|
216
|
+
if self._client is None:
|
|
217
|
+
self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token
|
|
218
|
+
self._client = httpx.Client(
|
|
219
|
+
base_url=self._base_url,
|
|
220
|
+
cookies=self._cookies,
|
|
221
|
+
headers=self._headers,
|
|
222
|
+
timeout=self._timeout,
|
|
223
|
+
verify=self._verify_ssl,
|
|
224
|
+
follow_redirects=self._follow_redirects,
|
|
225
|
+
**self._httpx_args,
|
|
226
|
+
)
|
|
227
|
+
return self._client
|
|
228
|
+
|
|
229
|
+
def __enter__(self) -> "AuthenticatedClient":
|
|
230
|
+
"""Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""
|
|
231
|
+
self.get_httpx_client().__enter__()
|
|
232
|
+
return self
|
|
233
|
+
|
|
234
|
+
def __exit__(self, *args: Any, **kwargs: Any) -> None:
|
|
235
|
+
"""Exit a context manager for internal httpx.Client (see httpx docs)"""
|
|
236
|
+
self.get_httpx_client().__exit__(*args, **kwargs)
|
|
237
|
+
|
|
238
|
+
def set_async_httpx_client(self, async_client: httpx.AsyncClient) -> "AuthenticatedClient":
|
|
239
|
+
"""Manually the underlying httpx.AsyncClient
|
|
240
|
+
|
|
241
|
+
**NOTE**: This will override any other settings on the client, including cookies, headers, and timeout.
|
|
242
|
+
"""
|
|
243
|
+
self._async_client = async_client
|
|
244
|
+
return self
|
|
245
|
+
|
|
246
|
+
def get_async_httpx_client(self) -> httpx.AsyncClient:
|
|
247
|
+
"""Get the underlying httpx.AsyncClient, constructing a new one if not previously set"""
|
|
248
|
+
if self._async_client is None:
|
|
249
|
+
self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token
|
|
250
|
+
self._async_client = httpx.AsyncClient(
|
|
251
|
+
base_url=self._base_url,
|
|
252
|
+
cookies=self._cookies,
|
|
253
|
+
headers=self._headers,
|
|
254
|
+
timeout=self._timeout,
|
|
255
|
+
verify=self._verify_ssl,
|
|
256
|
+
follow_redirects=self._follow_redirects,
|
|
257
|
+
**self._httpx_args,
|
|
258
|
+
)
|
|
259
|
+
return self._async_client
|
|
260
|
+
|
|
261
|
+
async def __aenter__(self) -> "AuthenticatedClient":
|
|
262
|
+
"""Enter a context manager for underlying httpx.AsyncClient—you cannot enter twice (see httpx docs)"""
|
|
263
|
+
await self.get_async_httpx_client().__aenter__()
|
|
264
|
+
return self
|
|
265
|
+
|
|
266
|
+
async def __aexit__(self, *args: Any, **kwargs: Any) -> None:
|
|
267
|
+
"""Exit a context manager for underlying httpx.AsyncClient (see httpx docs)"""
|
|
268
|
+
await self.get_async_httpx_client().__aexit__(*args, **kwargs)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""Contains shared errors types that can be raised from API functions"""
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class UnexpectedStatus(Exception):
|
|
5
|
+
"""Raised by api functions when the response status an undocumented status and Client.raise_on_unexpected_status is True"""
|
|
6
|
+
|
|
7
|
+
def __init__(self, status_code: int, content: bytes):
|
|
8
|
+
self.status_code = status_code
|
|
9
|
+
self.content = content
|
|
10
|
+
|
|
11
|
+
super().__init__(
|
|
12
|
+
f"Unexpected status code: {status_code}\n\nResponse content:\n{content.decode(errors='ignore')}"
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
__all__ = ["UnexpectedStatus"]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Contains all the data models used in inputs/outputs"""
|
|
2
|
+
|
|
3
|
+
from .body_optpipulse_api_v1_tasks_scope_optpipulse_post import BodyOptpipulseApiV1TasksScopeOptpipulsePost
|
|
4
|
+
from .body_rabi_api_v1_tasks_scope_rabi_post import BodyRabiApiV1TasksScopeRabiPost
|
|
5
|
+
from .body_rabicos_api_v1_tasks_scope_rabicospeak_post import BodyRabicosApiV1TasksScopeRabicospeakPost
|
|
6
|
+
from .body_s21_peak_api_v1_tasks_scope_s21_peak_post import BodyS21PeakApiV1TasksScopeS21PeakPost
|
|
7
|
+
from .body_s21_vflux_api_v1_tasks_scope_s21_vflux_post import BodyS21VfluxApiV1TasksScopeS21VfluxPost
|
|
8
|
+
from .body_singleshot_api_v1_tasks_scope_singleshot_post import BodySingleshotApiV1TasksScopeSingleshotPost
|
|
9
|
+
from .body_spectrum_2d_api_v1_tasks_scope_spectrum_2d_post import BodySpectrum2DApiV1TasksScopeSpectrum2DPost
|
|
10
|
+
from .body_spectrum_api_v1_tasks_scope_spectrum_post import BodySpectrumApiV1TasksScopeSpectrumPost
|
|
11
|
+
from .body_t1_fit_api_v1_tasks_scope_t1_fit_post import BodyT1FitApiV1TasksScopeT1FitPost
|
|
12
|
+
from .body_t1_fit_api_v1_tasks_scope_t2_fit_post import BodyT1FitApiV1TasksScopeT2FitPost
|
|
13
|
+
from .http_validation_error import HTTPValidationError
|
|
14
|
+
from .validation_error import ValidationError
|
|
15
|
+
|
|
16
|
+
__all__ = (
|
|
17
|
+
"BodyOptpipulseApiV1TasksScopeOptpipulsePost",
|
|
18
|
+
"BodyRabiApiV1TasksScopeRabiPost",
|
|
19
|
+
"BodyRabicosApiV1TasksScopeRabicospeakPost",
|
|
20
|
+
"BodyS21PeakApiV1TasksScopeS21PeakPost",
|
|
21
|
+
"BodyS21VfluxApiV1TasksScopeS21VfluxPost",
|
|
22
|
+
"BodySingleshotApiV1TasksScopeSingleshotPost",
|
|
23
|
+
"BodySpectrum2DApiV1TasksScopeSpectrum2DPost",
|
|
24
|
+
"BodySpectrumApiV1TasksScopeSpectrumPost",
|
|
25
|
+
"BodyT1FitApiV1TasksScopeT1FitPost",
|
|
26
|
+
"BodyT1FitApiV1TasksScopeT2FitPost",
|
|
27
|
+
"HTTPValidationError",
|
|
28
|
+
"ValidationError",
|
|
29
|
+
)
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
from typing import Any, TypeVar
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
|
|
8
|
+
from .. import types
|
|
9
|
+
from ..types import File
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="BodyOptpipulseApiV1TasksScopeOptpipulsePost")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class BodyOptpipulseApiV1TasksScopeOptpipulsePost:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
files (list[File]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
files: list[File]
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
files = []
|
|
26
|
+
for files_item_data in self.files:
|
|
27
|
+
files_item = files_item_data.to_tuple()
|
|
28
|
+
|
|
29
|
+
files.append(files_item)
|
|
30
|
+
|
|
31
|
+
field_dict: dict[str, Any] = {}
|
|
32
|
+
field_dict.update(self.additional_properties)
|
|
33
|
+
field_dict.update(
|
|
34
|
+
{
|
|
35
|
+
"files": files,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return field_dict
|
|
40
|
+
|
|
41
|
+
def to_multipart(self) -> types.RequestFiles:
|
|
42
|
+
files: types.RequestFiles = []
|
|
43
|
+
|
|
44
|
+
for files_item_element in self.files:
|
|
45
|
+
files.append(("files", files_item_element.to_tuple()))
|
|
46
|
+
|
|
47
|
+
for prop_name, prop in self.additional_properties.items():
|
|
48
|
+
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
49
|
+
|
|
50
|
+
return files
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
54
|
+
d = dict(src_dict)
|
|
55
|
+
files = []
|
|
56
|
+
_files = d.pop("files")
|
|
57
|
+
for files_item_data in _files:
|
|
58
|
+
files_item = File(payload=BytesIO(files_item_data))
|
|
59
|
+
|
|
60
|
+
files.append(files_item)
|
|
61
|
+
|
|
62
|
+
body_optpipulse_api_v1_tasks_scope_optpipulse_post = cls(
|
|
63
|
+
files=files,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
body_optpipulse_api_v1_tasks_scope_optpipulse_post.additional_properties = d
|
|
67
|
+
return body_optpipulse_api_v1_tasks_scope_optpipulse_post
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def additional_keys(self) -> list[str]:
|
|
71
|
+
return list(self.additional_properties.keys())
|
|
72
|
+
|
|
73
|
+
def __getitem__(self, key: str) -> Any:
|
|
74
|
+
return self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
77
|
+
self.additional_properties[key] = value
|
|
78
|
+
|
|
79
|
+
def __delitem__(self, key: str) -> None:
|
|
80
|
+
del self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __contains__(self, key: str) -> bool:
|
|
83
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
from typing import Any, TypeVar
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
|
|
8
|
+
from .. import types
|
|
9
|
+
from ..types import File
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="BodyRabiApiV1TasksScopeRabiPost")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class BodyRabiApiV1TasksScopeRabiPost:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
files (list[File]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
files: list[File]
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
files = []
|
|
26
|
+
for files_item_data in self.files:
|
|
27
|
+
files_item = files_item_data.to_tuple()
|
|
28
|
+
|
|
29
|
+
files.append(files_item)
|
|
30
|
+
|
|
31
|
+
field_dict: dict[str, Any] = {}
|
|
32
|
+
field_dict.update(self.additional_properties)
|
|
33
|
+
field_dict.update(
|
|
34
|
+
{
|
|
35
|
+
"files": files,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return field_dict
|
|
40
|
+
|
|
41
|
+
def to_multipart(self) -> types.RequestFiles:
|
|
42
|
+
files: types.RequestFiles = []
|
|
43
|
+
|
|
44
|
+
for files_item_element in self.files:
|
|
45
|
+
files.append(("files", files_item_element.to_tuple()))
|
|
46
|
+
|
|
47
|
+
for prop_name, prop in self.additional_properties.items():
|
|
48
|
+
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
49
|
+
|
|
50
|
+
return files
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
54
|
+
d = dict(src_dict)
|
|
55
|
+
files = []
|
|
56
|
+
_files = d.pop("files")
|
|
57
|
+
for files_item_data in _files:
|
|
58
|
+
files_item = File(payload=BytesIO(files_item_data))
|
|
59
|
+
|
|
60
|
+
files.append(files_item)
|
|
61
|
+
|
|
62
|
+
body_rabi_api_v1_tasks_scope_rabi_post = cls(
|
|
63
|
+
files=files,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
body_rabi_api_v1_tasks_scope_rabi_post.additional_properties = d
|
|
67
|
+
return body_rabi_api_v1_tasks_scope_rabi_post
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def additional_keys(self) -> list[str]:
|
|
71
|
+
return list(self.additional_properties.keys())
|
|
72
|
+
|
|
73
|
+
def __getitem__(self, key: str) -> Any:
|
|
74
|
+
return self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
77
|
+
self.additional_properties[key] = value
|
|
78
|
+
|
|
79
|
+
def __delitem__(self, key: str) -> None:
|
|
80
|
+
del self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __contains__(self, key: str) -> bool:
|
|
83
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
from typing import Any, TypeVar
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
|
|
8
|
+
from .. import types
|
|
9
|
+
from ..types import File
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="BodyRabicosApiV1TasksScopeRabicospeakPost")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class BodyRabicosApiV1TasksScopeRabicospeakPost:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
files (list[File]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
files: list[File]
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
files = []
|
|
26
|
+
for files_item_data in self.files:
|
|
27
|
+
files_item = files_item_data.to_tuple()
|
|
28
|
+
|
|
29
|
+
files.append(files_item)
|
|
30
|
+
|
|
31
|
+
field_dict: dict[str, Any] = {}
|
|
32
|
+
field_dict.update(self.additional_properties)
|
|
33
|
+
field_dict.update(
|
|
34
|
+
{
|
|
35
|
+
"files": files,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return field_dict
|
|
40
|
+
|
|
41
|
+
def to_multipart(self) -> types.RequestFiles:
|
|
42
|
+
files: types.RequestFiles = []
|
|
43
|
+
|
|
44
|
+
for files_item_element in self.files:
|
|
45
|
+
files.append(("files", files_item_element.to_tuple()))
|
|
46
|
+
|
|
47
|
+
for prop_name, prop in self.additional_properties.items():
|
|
48
|
+
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
49
|
+
|
|
50
|
+
return files
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
54
|
+
d = dict(src_dict)
|
|
55
|
+
files = []
|
|
56
|
+
_files = d.pop("files")
|
|
57
|
+
for files_item_data in _files:
|
|
58
|
+
files_item = File(payload=BytesIO(files_item_data))
|
|
59
|
+
|
|
60
|
+
files.append(files_item)
|
|
61
|
+
|
|
62
|
+
body_rabicos_api_v1_tasks_scope_rabicospeak_post = cls(
|
|
63
|
+
files=files,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
body_rabicos_api_v1_tasks_scope_rabicospeak_post.additional_properties = d
|
|
67
|
+
return body_rabicos_api_v1_tasks_scope_rabicospeak_post
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def additional_keys(self) -> list[str]:
|
|
71
|
+
return list(self.additional_properties.keys())
|
|
72
|
+
|
|
73
|
+
def __getitem__(self, key: str) -> Any:
|
|
74
|
+
return self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
77
|
+
self.additional_properties[key] = value
|
|
78
|
+
|
|
79
|
+
def __delitem__(self, key: str) -> None:
|
|
80
|
+
del self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __contains__(self, key: str) -> bool:
|
|
83
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from io import BytesIO
|
|
3
|
+
from typing import Any, TypeVar
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from attrs import field as _attrs_field
|
|
7
|
+
|
|
8
|
+
from .. import types
|
|
9
|
+
from ..types import File
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="BodyS21PeakApiV1TasksScopeS21PeakPost")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class BodyS21PeakApiV1TasksScopeS21PeakPost:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
files (list[File]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
files: list[File]
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
files = []
|
|
26
|
+
for files_item_data in self.files:
|
|
27
|
+
files_item = files_item_data.to_tuple()
|
|
28
|
+
|
|
29
|
+
files.append(files_item)
|
|
30
|
+
|
|
31
|
+
field_dict: dict[str, Any] = {}
|
|
32
|
+
field_dict.update(self.additional_properties)
|
|
33
|
+
field_dict.update(
|
|
34
|
+
{
|
|
35
|
+
"files": files,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return field_dict
|
|
40
|
+
|
|
41
|
+
def to_multipart(self) -> types.RequestFiles:
|
|
42
|
+
files: types.RequestFiles = []
|
|
43
|
+
|
|
44
|
+
for files_item_element in self.files:
|
|
45
|
+
files.append(("files", files_item_element.to_tuple()))
|
|
46
|
+
|
|
47
|
+
for prop_name, prop in self.additional_properties.items():
|
|
48
|
+
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
49
|
+
|
|
50
|
+
return files
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
54
|
+
d = dict(src_dict)
|
|
55
|
+
files = []
|
|
56
|
+
_files = d.pop("files")
|
|
57
|
+
for files_item_data in _files:
|
|
58
|
+
files_item = File(payload=BytesIO(files_item_data))
|
|
59
|
+
|
|
60
|
+
files.append(files_item)
|
|
61
|
+
|
|
62
|
+
body_s21_peak_api_v1_tasks_scope_s21_peak_post = cls(
|
|
63
|
+
files=files,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
body_s21_peak_api_v1_tasks_scope_s21_peak_post.additional_properties = d
|
|
67
|
+
return body_s21_peak_api_v1_tasks_scope_s21_peak_post
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def additional_keys(self) -> list[str]:
|
|
71
|
+
return list(self.additional_properties.keys())
|
|
72
|
+
|
|
73
|
+
def __getitem__(self, key: str) -> Any:
|
|
74
|
+
return self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
77
|
+
self.additional_properties[key] = value
|
|
78
|
+
|
|
79
|
+
def __delitem__(self, key: str) -> None:
|
|
80
|
+
del self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __contains__(self, key: str) -> bool:
|
|
83
|
+
return key in self.additional_properties
|