bitwarden-sdk 2.0.0__cp39-abi3-macosx_11_0_arm64.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.
- LICENSE +295 -0
- bitwarden_py/__init__.py +5 -0
- bitwarden_py/bitwarden_py.abi3.so +0 -0
- bitwarden_sdk/__init__.py +13 -0
- bitwarden_sdk/bitwarden_client.py +343 -0
- bitwarden_sdk/schemas.py +2047 -0
- bitwarden_sdk-2.0.0.dist-info/METADATA +88 -0
- bitwarden_sdk-2.0.0.dist-info/RECORD +10 -0
- bitwarden_sdk-2.0.0.dist-info/WHEEL +4 -0
- bitwarden_sdk-2.0.0.dist-info/licenses/LICENSE +295 -0
bitwarden_sdk/schemas.py
ADDED
|
@@ -0,0 +1,2047 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
from typing import Optional, Any, List, TypeVar, Type, cast, Callable
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
from datetime import datetime
|
|
6
|
+
import dateutil.parser
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T")
|
|
10
|
+
EnumT = TypeVar("EnumT", bound=Enum)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def from_str(x: Any) -> str:
|
|
14
|
+
assert isinstance(x, str)
|
|
15
|
+
return x
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def from_none(x: Any) -> Any:
|
|
19
|
+
assert x is None
|
|
20
|
+
return x
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def from_union(fs, x):
|
|
24
|
+
for f in fs:
|
|
25
|
+
try:
|
|
26
|
+
return f(x)
|
|
27
|
+
except:
|
|
28
|
+
pass
|
|
29
|
+
assert False
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def to_enum(c: Type[EnumT], x: Any) -> EnumT:
|
|
33
|
+
assert isinstance(x, c)
|
|
34
|
+
return x.value
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def from_int(x: Any) -> int:
|
|
38
|
+
assert isinstance(x, int) and not isinstance(x, bool)
|
|
39
|
+
return x
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_class(c: Type[T], x: Any) -> dict:
|
|
43
|
+
assert isinstance(x, c)
|
|
44
|
+
return cast(Any, x).to_dict()
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def from_bool(x: Any) -> bool:
|
|
48
|
+
assert isinstance(x, bool)
|
|
49
|
+
return x
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def from_list(f: Callable[[Any], T], x: Any) -> List[T]:
|
|
53
|
+
assert isinstance(x, list)
|
|
54
|
+
return [f(y) for y in x]
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def from_datetime(x: Any) -> datetime:
|
|
58
|
+
return dateutil.parser.parse(x)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class DeviceType(Enum):
|
|
62
|
+
"""Device type to send to Bitwarden. Defaults to SDK"""
|
|
63
|
+
|
|
64
|
+
ANDROID = "Android"
|
|
65
|
+
ANDROID_AMAZON = "AndroidAmazon"
|
|
66
|
+
CHROME_BROWSER = "ChromeBrowser"
|
|
67
|
+
CHROME_EXTENSION = "ChromeExtension"
|
|
68
|
+
DUCK_DUCK_GO_BROWSER = "DuckDuckGoBrowser"
|
|
69
|
+
EDGE_BROWSER = "EdgeBrowser"
|
|
70
|
+
EDGE_EXTENSION = "EdgeExtension"
|
|
71
|
+
FIREFOX_BROWSER = "FirefoxBrowser"
|
|
72
|
+
FIREFOX_EXTENSION = "FirefoxExtension"
|
|
73
|
+
IE_BROWSER = "IEBrowser"
|
|
74
|
+
I_OS = "iOS"
|
|
75
|
+
LINUX_CLI = "LinuxCLI"
|
|
76
|
+
LINUX_DESKTOP = "LinuxDesktop"
|
|
77
|
+
MAC_OS_CLI = "MacOsCLI"
|
|
78
|
+
MAC_OS_DESKTOP = "MacOsDesktop"
|
|
79
|
+
OPERA_BROWSER = "OperaBrowser"
|
|
80
|
+
OPERA_EXTENSION = "OperaExtension"
|
|
81
|
+
SAFARI_BROWSER = "SafariBrowser"
|
|
82
|
+
SAFARI_EXTENSION = "SafariExtension"
|
|
83
|
+
SDK = "SDK"
|
|
84
|
+
SERVER = "Server"
|
|
85
|
+
UNKNOWN_BROWSER = "UnknownBrowser"
|
|
86
|
+
UWP = "UWP"
|
|
87
|
+
VIVALDI_BROWSER = "VivaldiBrowser"
|
|
88
|
+
VIVALDI_EXTENSION = "VivaldiExtension"
|
|
89
|
+
WINDOWS_CLI = "WindowsCLI"
|
|
90
|
+
WINDOWS_DESKTOP = "WindowsDesktop"
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
@dataclass
|
|
94
|
+
class ClientSettings:
|
|
95
|
+
"""Basic client behavior settings. These settings specify the various targets and behavior
|
|
96
|
+
of the
|
|
97
|
+
Bitwarden Client. They are optional and uneditable once the client is initialized.
|
|
98
|
+
|
|
99
|
+
Defaults to
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
# use bitwarden_core::{ClientSettings, DeviceType};
|
|
103
|
+
let settings = ClientSettings {
|
|
104
|
+
identity_url: "https://identity.bitwarden.com".to_string(),
|
|
105
|
+
api_url: "https://api.bitwarden.com".to_string(),
|
|
106
|
+
user_agent: "Bitwarden Rust-SDK".to_string(),
|
|
107
|
+
device_type: DeviceType::SDK,
|
|
108
|
+
bitwarden_client_version: None,
|
|
109
|
+
bitwarden_package_type: None,
|
|
110
|
+
device_identifier: None,
|
|
111
|
+
};
|
|
112
|
+
let default = ClientSettings::default();
|
|
113
|
+
```
|
|
114
|
+
"""
|
|
115
|
+
api_url: Optional[str] = None
|
|
116
|
+
"""The api url of the targeted Bitwarden instance. Defaults to `https://api.bitwarden.com`"""
|
|
117
|
+
|
|
118
|
+
bitwarden_client_version: Optional[str] = None
|
|
119
|
+
"""Bitwarden Client Version to send to Bitwarden. Optional for now in transition period."""
|
|
120
|
+
|
|
121
|
+
bitwarden_package_type: Optional[str] = None
|
|
122
|
+
"""Bitwarden Package Type to send to Bitwarden. We should evaluate this field to see if it
|
|
123
|
+
should be optional later.
|
|
124
|
+
"""
|
|
125
|
+
device_identifier: Optional[str] = None
|
|
126
|
+
"""Device identifier to send to Bitwarden. Optional for now in transition period."""
|
|
127
|
+
|
|
128
|
+
device_type: Optional[DeviceType] = None
|
|
129
|
+
"""Device type to send to Bitwarden. Defaults to SDK"""
|
|
130
|
+
|
|
131
|
+
identity_url: Optional[str] = None
|
|
132
|
+
"""The identity url of the targeted Bitwarden instance. Defaults to
|
|
133
|
+
`https://identity.bitwarden.com`
|
|
134
|
+
"""
|
|
135
|
+
user_agent: Optional[str] = None
|
|
136
|
+
"""The user_agent to sent to Bitwarden. Defaults to `Bitwarden Rust-SDK`"""
|
|
137
|
+
|
|
138
|
+
@staticmethod
|
|
139
|
+
def from_dict(obj: Any) -> 'ClientSettings':
|
|
140
|
+
assert isinstance(obj, dict)
|
|
141
|
+
api_url = from_union([from_str, from_none], obj.get("apiUrl"))
|
|
142
|
+
bitwarden_client_version = from_union([from_none, from_str], obj.get("bitwardenClientVersion"))
|
|
143
|
+
bitwarden_package_type = from_union([from_none, from_str], obj.get("bitwardenPackageType"))
|
|
144
|
+
device_identifier = from_union([from_none, from_str], obj.get("deviceIdentifier"))
|
|
145
|
+
device_type = from_union([DeviceType, from_none], obj.get("deviceType"))
|
|
146
|
+
identity_url = from_union([from_str, from_none], obj.get("identityUrl"))
|
|
147
|
+
user_agent = from_union([from_str, from_none], obj.get("userAgent"))
|
|
148
|
+
return ClientSettings(api_url, bitwarden_client_version, bitwarden_package_type, device_identifier, device_type, identity_url, user_agent)
|
|
149
|
+
|
|
150
|
+
def to_dict(self) -> dict:
|
|
151
|
+
result: dict = {}
|
|
152
|
+
if self.api_url is not None:
|
|
153
|
+
result["apiUrl"] = from_union([from_str, from_none], self.api_url)
|
|
154
|
+
if self.bitwarden_client_version is not None:
|
|
155
|
+
result["bitwardenClientVersion"] = from_union([from_none, from_str], self.bitwarden_client_version)
|
|
156
|
+
if self.bitwarden_package_type is not None:
|
|
157
|
+
result["bitwardenPackageType"] = from_union([from_none, from_str], self.bitwarden_package_type)
|
|
158
|
+
if self.device_identifier is not None:
|
|
159
|
+
result["deviceIdentifier"] = from_union([from_none, from_str], self.device_identifier)
|
|
160
|
+
if self.device_type is not None:
|
|
161
|
+
result["deviceType"] = from_union([lambda x: to_enum(DeviceType, x), from_none], self.device_type)
|
|
162
|
+
if self.identity_url is not None:
|
|
163
|
+
result["identityUrl"] = from_union([from_str, from_none], self.identity_url)
|
|
164
|
+
if self.user_agent is not None:
|
|
165
|
+
result["userAgent"] = from_union([from_str, from_none], self.user_agent)
|
|
166
|
+
return result
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
@dataclass
|
|
170
|
+
class CancellationTest:
|
|
171
|
+
duration_millis: int
|
|
172
|
+
|
|
173
|
+
@staticmethod
|
|
174
|
+
def from_dict(obj: Any) -> 'CancellationTest':
|
|
175
|
+
assert isinstance(obj, dict)
|
|
176
|
+
duration_millis = from_int(obj.get("duration_millis"))
|
|
177
|
+
return CancellationTest(duration_millis)
|
|
178
|
+
|
|
179
|
+
def to_dict(self) -> dict:
|
|
180
|
+
result: dict = {}
|
|
181
|
+
result["duration_millis"] = from_int(self.duration_millis)
|
|
182
|
+
return result
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
@dataclass
|
|
186
|
+
class ErrorTest:
|
|
187
|
+
pass
|
|
188
|
+
|
|
189
|
+
@staticmethod
|
|
190
|
+
def from_dict(obj: Any) -> 'ErrorTest':
|
|
191
|
+
assert isinstance(obj, dict)
|
|
192
|
+
return ErrorTest()
|
|
193
|
+
|
|
194
|
+
def to_dict(self) -> dict:
|
|
195
|
+
result: dict = {}
|
|
196
|
+
return result
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
@dataclass
|
|
200
|
+
class DebugCommand:
|
|
201
|
+
cancellation_test: Optional[CancellationTest] = None
|
|
202
|
+
error_test: Optional[ErrorTest] = None
|
|
203
|
+
|
|
204
|
+
@staticmethod
|
|
205
|
+
def from_dict(obj: Any) -> 'DebugCommand':
|
|
206
|
+
assert isinstance(obj, dict)
|
|
207
|
+
cancellation_test = from_union([CancellationTest.from_dict, from_none], obj.get("cancellationTest"))
|
|
208
|
+
error_test = from_union([ErrorTest.from_dict, from_none], obj.get("errorTest"))
|
|
209
|
+
return DebugCommand(cancellation_test, error_test)
|
|
210
|
+
|
|
211
|
+
def to_dict(self) -> dict:
|
|
212
|
+
result: dict = {}
|
|
213
|
+
if self.cancellation_test is not None:
|
|
214
|
+
result["cancellationTest"] = from_union([lambda x: to_class(CancellationTest, x), from_none], self.cancellation_test)
|
|
215
|
+
if self.error_test is not None:
|
|
216
|
+
result["errorTest"] = from_union([lambda x: to_class(ErrorTest, x), from_none], self.error_test)
|
|
217
|
+
return result
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
@dataclass
|
|
221
|
+
class PasswordGeneratorRequest:
|
|
222
|
+
"""Password generator request options."""
|
|
223
|
+
|
|
224
|
+
avoid_ambiguous: bool
|
|
225
|
+
"""When set to true, the generated password will not contain ambiguous characters.
|
|
226
|
+
The ambiguous characters are: I, O, l, 0, 1
|
|
227
|
+
"""
|
|
228
|
+
length: int
|
|
229
|
+
"""The length of the generated password.
|
|
230
|
+
Note that the password length must be greater than the sum of all the minimums.
|
|
231
|
+
"""
|
|
232
|
+
lowercase: bool
|
|
233
|
+
"""Include lowercase characters (a-z)."""
|
|
234
|
+
|
|
235
|
+
numbers: bool
|
|
236
|
+
"""Include numbers (0-9)."""
|
|
237
|
+
|
|
238
|
+
special: bool
|
|
239
|
+
"""Include special characters: ! @ # $ % ^ & *"""
|
|
240
|
+
|
|
241
|
+
uppercase: bool
|
|
242
|
+
"""Include uppercase characters (A-Z)."""
|
|
243
|
+
|
|
244
|
+
min_lowercase: Optional[int] = None
|
|
245
|
+
"""The minimum number of lowercase characters in the generated password.
|
|
246
|
+
When set, the value must be between 1 and 9. This value is ignored if lowercase is false.
|
|
247
|
+
"""
|
|
248
|
+
min_number: Optional[int] = None
|
|
249
|
+
"""The minimum number of numbers in the generated password.
|
|
250
|
+
When set, the value must be between 1 and 9. This value is ignored if numbers is false.
|
|
251
|
+
"""
|
|
252
|
+
min_special: Optional[int] = None
|
|
253
|
+
"""The minimum number of special characters in the generated password.
|
|
254
|
+
When set, the value must be between 1 and 9. This value is ignored if special is false.
|
|
255
|
+
"""
|
|
256
|
+
min_uppercase: Optional[int] = None
|
|
257
|
+
"""The minimum number of uppercase characters in the generated password.
|
|
258
|
+
When set, the value must be between 1 and 9. This value is ignored if uppercase is false.
|
|
259
|
+
"""
|
|
260
|
+
|
|
261
|
+
@staticmethod
|
|
262
|
+
def from_dict(obj: Any) -> 'PasswordGeneratorRequest':
|
|
263
|
+
assert isinstance(obj, dict)
|
|
264
|
+
avoid_ambiguous = from_bool(obj.get("avoidAmbiguous"))
|
|
265
|
+
length = from_int(obj.get("length"))
|
|
266
|
+
lowercase = from_bool(obj.get("lowercase"))
|
|
267
|
+
numbers = from_bool(obj.get("numbers"))
|
|
268
|
+
special = from_bool(obj.get("special"))
|
|
269
|
+
uppercase = from_bool(obj.get("uppercase"))
|
|
270
|
+
min_lowercase = from_union([from_none, from_int], obj.get("minLowercase"))
|
|
271
|
+
min_number = from_union([from_none, from_int], obj.get("minNumber"))
|
|
272
|
+
min_special = from_union([from_none, from_int], obj.get("minSpecial"))
|
|
273
|
+
min_uppercase = from_union([from_none, from_int], obj.get("minUppercase"))
|
|
274
|
+
return PasswordGeneratorRequest(avoid_ambiguous, length, lowercase, numbers, special, uppercase, min_lowercase, min_number, min_special, min_uppercase)
|
|
275
|
+
|
|
276
|
+
def to_dict(self) -> dict:
|
|
277
|
+
result: dict = {}
|
|
278
|
+
result["avoidAmbiguous"] = from_bool(self.avoid_ambiguous)
|
|
279
|
+
result["length"] = from_int(self.length)
|
|
280
|
+
result["lowercase"] = from_bool(self.lowercase)
|
|
281
|
+
result["numbers"] = from_bool(self.numbers)
|
|
282
|
+
result["special"] = from_bool(self.special)
|
|
283
|
+
result["uppercase"] = from_bool(self.uppercase)
|
|
284
|
+
if self.min_lowercase is not None:
|
|
285
|
+
result["minLowercase"] = from_union([from_none, from_int], self.min_lowercase)
|
|
286
|
+
if self.min_number is not None:
|
|
287
|
+
result["minNumber"] = from_union([from_none, from_int], self.min_number)
|
|
288
|
+
if self.min_special is not None:
|
|
289
|
+
result["minSpecial"] = from_union([from_none, from_int], self.min_special)
|
|
290
|
+
if self.min_uppercase is not None:
|
|
291
|
+
result["minUppercase"] = from_union([from_none, from_int], self.min_uppercase)
|
|
292
|
+
return result
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
@dataclass
|
|
296
|
+
class GeneratorsCommand:
|
|
297
|
+
"""Generate a password
|
|
298
|
+
|
|
299
|
+
Returns: [String]
|
|
300
|
+
"""
|
|
301
|
+
generate_password: PasswordGeneratorRequest
|
|
302
|
+
|
|
303
|
+
@staticmethod
|
|
304
|
+
def from_dict(obj: Any) -> 'GeneratorsCommand':
|
|
305
|
+
assert isinstance(obj, dict)
|
|
306
|
+
generate_password = PasswordGeneratorRequest.from_dict(obj.get("generatePassword"))
|
|
307
|
+
return GeneratorsCommand(generate_password)
|
|
308
|
+
|
|
309
|
+
def to_dict(self) -> dict:
|
|
310
|
+
result: dict = {}
|
|
311
|
+
result["generatePassword"] = to_class(PasswordGeneratorRequest, self.generate_password)
|
|
312
|
+
return result
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
@dataclass
|
|
316
|
+
class AccessTokenLoginRequest:
|
|
317
|
+
"""Login to Bitwarden with access token"""
|
|
318
|
+
|
|
319
|
+
access_token: str
|
|
320
|
+
"""Bitwarden service API access token"""
|
|
321
|
+
|
|
322
|
+
state_file: Optional[str] = None
|
|
323
|
+
"""Path to the state file"""
|
|
324
|
+
|
|
325
|
+
@staticmethod
|
|
326
|
+
def from_dict(obj: Any) -> 'AccessTokenLoginRequest':
|
|
327
|
+
assert isinstance(obj, dict)
|
|
328
|
+
access_token = from_str(obj.get("accessToken"))
|
|
329
|
+
state_file = from_union([from_none, from_str], obj.get("stateFile"))
|
|
330
|
+
return AccessTokenLoginRequest(access_token, state_file)
|
|
331
|
+
|
|
332
|
+
def to_dict(self) -> dict:
|
|
333
|
+
result: dict = {}
|
|
334
|
+
result["accessToken"] = from_str(self.access_token)
|
|
335
|
+
if self.state_file is not None:
|
|
336
|
+
result["stateFile"] = from_union([from_none, from_str], self.state_file)
|
|
337
|
+
return result
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
@dataclass
|
|
341
|
+
class ProjectCreateRequest:
|
|
342
|
+
name: str
|
|
343
|
+
organization_id: UUID
|
|
344
|
+
"""Organization where the project will be created"""
|
|
345
|
+
|
|
346
|
+
@staticmethod
|
|
347
|
+
def from_dict(obj: Any) -> 'ProjectCreateRequest':
|
|
348
|
+
assert isinstance(obj, dict)
|
|
349
|
+
name = from_str(obj.get("name"))
|
|
350
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
351
|
+
return ProjectCreateRequest(name, organization_id)
|
|
352
|
+
|
|
353
|
+
def to_dict(self) -> dict:
|
|
354
|
+
result: dict = {}
|
|
355
|
+
result["name"] = from_str(self.name)
|
|
356
|
+
result["organizationId"] = str(self.organization_id)
|
|
357
|
+
return result
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
@dataclass
|
|
361
|
+
class ProjectsDeleteRequest:
|
|
362
|
+
ids: List[UUID]
|
|
363
|
+
"""IDs of the projects to delete"""
|
|
364
|
+
|
|
365
|
+
@staticmethod
|
|
366
|
+
def from_dict(obj: Any) -> 'ProjectsDeleteRequest':
|
|
367
|
+
assert isinstance(obj, dict)
|
|
368
|
+
ids = from_list(lambda x: UUID(x), obj.get("ids"))
|
|
369
|
+
return ProjectsDeleteRequest(ids)
|
|
370
|
+
|
|
371
|
+
def to_dict(self) -> dict:
|
|
372
|
+
result: dict = {}
|
|
373
|
+
result["ids"] = from_list(lambda x: str(x), self.ids)
|
|
374
|
+
return result
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
@dataclass
|
|
378
|
+
class ProjectGetRequest:
|
|
379
|
+
id: UUID
|
|
380
|
+
"""ID of the project to retrieve"""
|
|
381
|
+
|
|
382
|
+
@staticmethod
|
|
383
|
+
def from_dict(obj: Any) -> 'ProjectGetRequest':
|
|
384
|
+
assert isinstance(obj, dict)
|
|
385
|
+
id = UUID(obj.get("id"))
|
|
386
|
+
return ProjectGetRequest(id)
|
|
387
|
+
|
|
388
|
+
def to_dict(self) -> dict:
|
|
389
|
+
result: dict = {}
|
|
390
|
+
result["id"] = str(self.id)
|
|
391
|
+
return result
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
@dataclass
|
|
395
|
+
class ProjectsListRequest:
|
|
396
|
+
organization_id: UUID
|
|
397
|
+
"""Organization to retrieve all the projects from"""
|
|
398
|
+
|
|
399
|
+
@staticmethod
|
|
400
|
+
def from_dict(obj: Any) -> 'ProjectsListRequest':
|
|
401
|
+
assert isinstance(obj, dict)
|
|
402
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
403
|
+
return ProjectsListRequest(organization_id)
|
|
404
|
+
|
|
405
|
+
def to_dict(self) -> dict:
|
|
406
|
+
result: dict = {}
|
|
407
|
+
result["organizationId"] = str(self.organization_id)
|
|
408
|
+
return result
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
@dataclass
|
|
412
|
+
class ProjectPutRequest:
|
|
413
|
+
id: UUID
|
|
414
|
+
"""ID of the project to modify"""
|
|
415
|
+
|
|
416
|
+
name: str
|
|
417
|
+
organization_id: UUID
|
|
418
|
+
"""Organization ID of the project to modify"""
|
|
419
|
+
|
|
420
|
+
@staticmethod
|
|
421
|
+
def from_dict(obj: Any) -> 'ProjectPutRequest':
|
|
422
|
+
assert isinstance(obj, dict)
|
|
423
|
+
id = UUID(obj.get("id"))
|
|
424
|
+
name = from_str(obj.get("name"))
|
|
425
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
426
|
+
return ProjectPutRequest(id, name, organization_id)
|
|
427
|
+
|
|
428
|
+
def to_dict(self) -> dict:
|
|
429
|
+
result: dict = {}
|
|
430
|
+
result["id"] = str(self.id)
|
|
431
|
+
result["name"] = from_str(self.name)
|
|
432
|
+
result["organizationId"] = str(self.organization_id)
|
|
433
|
+
return result
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
@dataclass
|
|
437
|
+
class ProjectsCommand:
|
|
438
|
+
"""* Requires Authentication
|
|
439
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
440
|
+
|
|
441
|
+
Retrieve a project by the provided identifier
|
|
442
|
+
|
|
443
|
+
Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse)
|
|
444
|
+
|
|
445
|
+
* Requires Authentication
|
|
446
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
447
|
+
|
|
448
|
+
Creates a new project in the provided organization using the given data
|
|
449
|
+
|
|
450
|
+
Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse)
|
|
451
|
+
|
|
452
|
+
* Requires Authentication
|
|
453
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
454
|
+
|
|
455
|
+
Lists all projects of the given organization
|
|
456
|
+
|
|
457
|
+
Returns: [ProjectsResponse](bitwarden::secrets_manager::projects::ProjectsResponse)
|
|
458
|
+
|
|
459
|
+
* Requires Authentication
|
|
460
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
461
|
+
|
|
462
|
+
Updates an existing project with the provided ID using the given data
|
|
463
|
+
|
|
464
|
+
Returns: [ProjectResponse](bitwarden::secrets_manager::projects::ProjectResponse)
|
|
465
|
+
|
|
466
|
+
* Requires Authentication
|
|
467
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
468
|
+
|
|
469
|
+
Deletes all the projects whose IDs match the provided ones
|
|
470
|
+
|
|
471
|
+
Returns:
|
|
472
|
+
[ProjectsDeleteResponse](bitwarden::secrets_manager::projects::ProjectsDeleteResponse)
|
|
473
|
+
"""
|
|
474
|
+
get: Optional[ProjectGetRequest] = None
|
|
475
|
+
create: Optional[ProjectCreateRequest] = None
|
|
476
|
+
list: Optional[ProjectsListRequest] = None
|
|
477
|
+
update: Optional[ProjectPutRequest] = None
|
|
478
|
+
delete: Optional[ProjectsDeleteRequest] = None
|
|
479
|
+
|
|
480
|
+
@staticmethod
|
|
481
|
+
def from_dict(obj: Any) -> 'ProjectsCommand':
|
|
482
|
+
assert isinstance(obj, dict)
|
|
483
|
+
get = from_union([ProjectGetRequest.from_dict, from_none], obj.get("get"))
|
|
484
|
+
create = from_union([ProjectCreateRequest.from_dict, from_none], obj.get("create"))
|
|
485
|
+
list = from_union([ProjectsListRequest.from_dict, from_none], obj.get("list"))
|
|
486
|
+
update = from_union([ProjectPutRequest.from_dict, from_none], obj.get("update"))
|
|
487
|
+
delete = from_union([ProjectsDeleteRequest.from_dict, from_none], obj.get("delete"))
|
|
488
|
+
return ProjectsCommand(get, create, list, update, delete)
|
|
489
|
+
|
|
490
|
+
def to_dict(self) -> dict:
|
|
491
|
+
result: dict = {}
|
|
492
|
+
if self.get is not None:
|
|
493
|
+
result["get"] = from_union([lambda x: to_class(ProjectGetRequest, x), from_none], self.get)
|
|
494
|
+
if self.create is not None:
|
|
495
|
+
result["create"] = from_union([lambda x: to_class(ProjectCreateRequest, x), from_none], self.create)
|
|
496
|
+
if self.list is not None:
|
|
497
|
+
result["list"] = from_union([lambda x: to_class(ProjectsListRequest, x), from_none], self.list)
|
|
498
|
+
if self.update is not None:
|
|
499
|
+
result["update"] = from_union([lambda x: to_class(ProjectPutRequest, x), from_none], self.update)
|
|
500
|
+
if self.delete is not None:
|
|
501
|
+
result["delete"] = from_union([lambda x: to_class(ProjectsDeleteRequest, x), from_none], self.delete)
|
|
502
|
+
return result
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
@dataclass
|
|
506
|
+
class SecretCreateRequest:
|
|
507
|
+
key: str
|
|
508
|
+
note: str
|
|
509
|
+
organization_id: UUID
|
|
510
|
+
"""Organization where the secret will be created"""
|
|
511
|
+
|
|
512
|
+
value: str
|
|
513
|
+
project_ids: Optional[List[UUID]] = None
|
|
514
|
+
"""IDs of the projects that this secret will belong to"""
|
|
515
|
+
|
|
516
|
+
@staticmethod
|
|
517
|
+
def from_dict(obj: Any) -> 'SecretCreateRequest':
|
|
518
|
+
assert isinstance(obj, dict)
|
|
519
|
+
key = from_str(obj.get("key"))
|
|
520
|
+
note = from_str(obj.get("note"))
|
|
521
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
522
|
+
value = from_str(obj.get("value"))
|
|
523
|
+
project_ids = from_union([from_none, lambda x: from_list(lambda x: UUID(x), x)], obj.get("projectIds"))
|
|
524
|
+
return SecretCreateRequest(key, note, organization_id, value, project_ids)
|
|
525
|
+
|
|
526
|
+
def to_dict(self) -> dict:
|
|
527
|
+
result: dict = {}
|
|
528
|
+
result["key"] = from_str(self.key)
|
|
529
|
+
result["note"] = from_str(self.note)
|
|
530
|
+
result["organizationId"] = str(self.organization_id)
|
|
531
|
+
result["value"] = from_str(self.value)
|
|
532
|
+
if self.project_ids is not None:
|
|
533
|
+
result["projectIds"] = from_union([from_none, lambda x: from_list(lambda x: str(x), x)], self.project_ids)
|
|
534
|
+
return result
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
@dataclass
|
|
538
|
+
class SecretsDeleteRequest:
|
|
539
|
+
ids: List[UUID]
|
|
540
|
+
"""IDs of the secrets to delete"""
|
|
541
|
+
|
|
542
|
+
@staticmethod
|
|
543
|
+
def from_dict(obj: Any) -> 'SecretsDeleteRequest':
|
|
544
|
+
assert isinstance(obj, dict)
|
|
545
|
+
ids = from_list(lambda x: UUID(x), obj.get("ids"))
|
|
546
|
+
return SecretsDeleteRequest(ids)
|
|
547
|
+
|
|
548
|
+
def to_dict(self) -> dict:
|
|
549
|
+
result: dict = {}
|
|
550
|
+
result["ids"] = from_list(lambda x: str(x), self.ids)
|
|
551
|
+
return result
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
@dataclass
|
|
555
|
+
class SecretGetRequest:
|
|
556
|
+
id: UUID
|
|
557
|
+
"""ID of the secret to retrieve"""
|
|
558
|
+
|
|
559
|
+
@staticmethod
|
|
560
|
+
def from_dict(obj: Any) -> 'SecretGetRequest':
|
|
561
|
+
assert isinstance(obj, dict)
|
|
562
|
+
id = UUID(obj.get("id"))
|
|
563
|
+
return SecretGetRequest(id)
|
|
564
|
+
|
|
565
|
+
def to_dict(self) -> dict:
|
|
566
|
+
result: dict = {}
|
|
567
|
+
result["id"] = str(self.id)
|
|
568
|
+
return result
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
@dataclass
|
|
572
|
+
class SecretsGetRequest:
|
|
573
|
+
ids: List[UUID]
|
|
574
|
+
"""IDs of the secrets to retrieve"""
|
|
575
|
+
|
|
576
|
+
@staticmethod
|
|
577
|
+
def from_dict(obj: Any) -> 'SecretsGetRequest':
|
|
578
|
+
assert isinstance(obj, dict)
|
|
579
|
+
ids = from_list(lambda x: UUID(x), obj.get("ids"))
|
|
580
|
+
return SecretsGetRequest(ids)
|
|
581
|
+
|
|
582
|
+
def to_dict(self) -> dict:
|
|
583
|
+
result: dict = {}
|
|
584
|
+
result["ids"] = from_list(lambda x: str(x), self.ids)
|
|
585
|
+
return result
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
@dataclass
|
|
589
|
+
class SecretIdentifiersRequest:
|
|
590
|
+
organization_id: UUID
|
|
591
|
+
"""Organization to retrieve all the secrets from"""
|
|
592
|
+
|
|
593
|
+
@staticmethod
|
|
594
|
+
def from_dict(obj: Any) -> 'SecretIdentifiersRequest':
|
|
595
|
+
assert isinstance(obj, dict)
|
|
596
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
597
|
+
return SecretIdentifiersRequest(organization_id)
|
|
598
|
+
|
|
599
|
+
def to_dict(self) -> dict:
|
|
600
|
+
result: dict = {}
|
|
601
|
+
result["organizationId"] = str(self.organization_id)
|
|
602
|
+
return result
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
@dataclass
|
|
606
|
+
class SecretsSyncRequest:
|
|
607
|
+
organization_id: UUID
|
|
608
|
+
"""Organization to sync secrets from"""
|
|
609
|
+
|
|
610
|
+
last_synced_date: Optional[datetime] = None
|
|
611
|
+
"""Optional date time a sync last occurred"""
|
|
612
|
+
|
|
613
|
+
@staticmethod
|
|
614
|
+
def from_dict(obj: Any) -> 'SecretsSyncRequest':
|
|
615
|
+
assert isinstance(obj, dict)
|
|
616
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
617
|
+
last_synced_date = from_union([from_none, from_datetime], obj.get("lastSyncedDate"))
|
|
618
|
+
return SecretsSyncRequest(organization_id, last_synced_date)
|
|
619
|
+
|
|
620
|
+
def to_dict(self) -> dict:
|
|
621
|
+
result: dict = {}
|
|
622
|
+
result["organizationId"] = str(self.organization_id)
|
|
623
|
+
if self.last_synced_date is not None:
|
|
624
|
+
result["lastSyncedDate"] = from_union([from_none, lambda x: x.isoformat()], self.last_synced_date)
|
|
625
|
+
return result
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
@dataclass
|
|
629
|
+
class SecretPutRequest:
|
|
630
|
+
id: UUID
|
|
631
|
+
"""ID of the secret to modify"""
|
|
632
|
+
|
|
633
|
+
key: str
|
|
634
|
+
note: str
|
|
635
|
+
organization_id: UUID
|
|
636
|
+
"""Organization ID of the secret to modify"""
|
|
637
|
+
|
|
638
|
+
value: str
|
|
639
|
+
project_ids: Optional[List[UUID]] = None
|
|
640
|
+
|
|
641
|
+
@staticmethod
|
|
642
|
+
def from_dict(obj: Any) -> 'SecretPutRequest':
|
|
643
|
+
assert isinstance(obj, dict)
|
|
644
|
+
id = UUID(obj.get("id"))
|
|
645
|
+
key = from_str(obj.get("key"))
|
|
646
|
+
note = from_str(obj.get("note"))
|
|
647
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
648
|
+
value = from_str(obj.get("value"))
|
|
649
|
+
project_ids = from_union([from_none, lambda x: from_list(lambda x: UUID(x), x)], obj.get("projectIds"))
|
|
650
|
+
return SecretPutRequest(id, key, note, organization_id, value, project_ids)
|
|
651
|
+
|
|
652
|
+
def to_dict(self) -> dict:
|
|
653
|
+
result: dict = {}
|
|
654
|
+
result["id"] = str(self.id)
|
|
655
|
+
result["key"] = from_str(self.key)
|
|
656
|
+
result["note"] = from_str(self.note)
|
|
657
|
+
result["organizationId"] = str(self.organization_id)
|
|
658
|
+
result["value"] = from_str(self.value)
|
|
659
|
+
if self.project_ids is not None:
|
|
660
|
+
result["projectIds"] = from_union([from_none, lambda x: from_list(lambda x: str(x), x)], self.project_ids)
|
|
661
|
+
return result
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
@dataclass
|
|
665
|
+
class SecretsCommand:
|
|
666
|
+
"""* Requires Authentication
|
|
667
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
668
|
+
|
|
669
|
+
Retrieve a secret by the provided identifier
|
|
670
|
+
|
|
671
|
+
Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse)
|
|
672
|
+
|
|
673
|
+
* Requires Authentication
|
|
674
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
675
|
+
|
|
676
|
+
Retrieve secrets by the provided identifiers
|
|
677
|
+
|
|
678
|
+
Returns: [SecretsResponse](bitwarden::secrets_manager::secrets::SecretsResponse)
|
|
679
|
+
|
|
680
|
+
* Requires Authentication
|
|
681
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
682
|
+
|
|
683
|
+
Creates a new secret in the provided organization using the given data
|
|
684
|
+
|
|
685
|
+
Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse)
|
|
686
|
+
|
|
687
|
+
* Requires Authentication
|
|
688
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
689
|
+
|
|
690
|
+
Lists all secret identifiers of the given organization, to then retrieve each secret, use
|
|
691
|
+
`CreateSecret`
|
|
692
|
+
|
|
693
|
+
Returns:
|
|
694
|
+
[SecretIdentifiersResponse](bitwarden::secrets_manager::secrets::SecretIdentifiersResponse)
|
|
695
|
+
|
|
696
|
+
* Requires Authentication
|
|
697
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
698
|
+
|
|
699
|
+
Updates an existing secret with the provided ID using the given data
|
|
700
|
+
|
|
701
|
+
Returns: [SecretResponse](bitwarden::secrets_manager::secrets::SecretResponse)
|
|
702
|
+
|
|
703
|
+
* Requires Authentication
|
|
704
|
+
* Requires using an Access Token for login or calling Sync at least once
|
|
705
|
+
|
|
706
|
+
Deletes all the secrets whose IDs match the provided ones
|
|
707
|
+
|
|
708
|
+
Returns:
|
|
709
|
+
[SecretsDeleteResponse](bitwarden::secrets_manager::secrets::SecretsDeleteResponse)
|
|
710
|
+
|
|
711
|
+
* Requires Authentication
|
|
712
|
+
* Requires using an Access Token for login
|
|
713
|
+
|
|
714
|
+
Retrieve the secrets accessible by the authenticated machine account
|
|
715
|
+
Optionally, provide the last synced date to assess whether any changes have occurred
|
|
716
|
+
If changes are detected, retrieves all the secrets accessible by the authenticated
|
|
717
|
+
machine
|
|
718
|
+
account
|
|
719
|
+
|
|
720
|
+
Returns: [SecretsSyncResponse](bitwarden::secrets_manager::secrets::SecretsSyncResponse)
|
|
721
|
+
"""
|
|
722
|
+
get: Optional[SecretGetRequest] = None
|
|
723
|
+
get_by_ids: Optional[SecretsGetRequest] = None
|
|
724
|
+
create: Optional[SecretCreateRequest] = None
|
|
725
|
+
list: Optional[SecretIdentifiersRequest] = None
|
|
726
|
+
update: Optional[SecretPutRequest] = None
|
|
727
|
+
delete: Optional[SecretsDeleteRequest] = None
|
|
728
|
+
sync: Optional[SecretsSyncRequest] = None
|
|
729
|
+
|
|
730
|
+
@staticmethod
|
|
731
|
+
def from_dict(obj: Any) -> 'SecretsCommand':
|
|
732
|
+
assert isinstance(obj, dict)
|
|
733
|
+
get = from_union([SecretGetRequest.from_dict, from_none], obj.get("get"))
|
|
734
|
+
get_by_ids = from_union([SecretsGetRequest.from_dict, from_none], obj.get("getByIds"))
|
|
735
|
+
create = from_union([SecretCreateRequest.from_dict, from_none], obj.get("create"))
|
|
736
|
+
list = from_union([SecretIdentifiersRequest.from_dict, from_none], obj.get("list"))
|
|
737
|
+
update = from_union([SecretPutRequest.from_dict, from_none], obj.get("update"))
|
|
738
|
+
delete = from_union([SecretsDeleteRequest.from_dict, from_none], obj.get("delete"))
|
|
739
|
+
sync = from_union([SecretsSyncRequest.from_dict, from_none], obj.get("sync"))
|
|
740
|
+
return SecretsCommand(get, get_by_ids, create, list, update, delete, sync)
|
|
741
|
+
|
|
742
|
+
def to_dict(self) -> dict:
|
|
743
|
+
result: dict = {}
|
|
744
|
+
if self.get is not None:
|
|
745
|
+
result["get"] = from_union([lambda x: to_class(SecretGetRequest, x), from_none], self.get)
|
|
746
|
+
if self.get_by_ids is not None:
|
|
747
|
+
result["getByIds"] = from_union([lambda x: to_class(SecretsGetRequest, x), from_none], self.get_by_ids)
|
|
748
|
+
if self.create is not None:
|
|
749
|
+
result["create"] = from_union([lambda x: to_class(SecretCreateRequest, x), from_none], self.create)
|
|
750
|
+
if self.list is not None:
|
|
751
|
+
result["list"] = from_union([lambda x: to_class(SecretIdentifiersRequest, x), from_none], self.list)
|
|
752
|
+
if self.update is not None:
|
|
753
|
+
result["update"] = from_union([lambda x: to_class(SecretPutRequest, x), from_none], self.update)
|
|
754
|
+
if self.delete is not None:
|
|
755
|
+
result["delete"] = from_union([lambda x: to_class(SecretsDeleteRequest, x), from_none], self.delete)
|
|
756
|
+
if self.sync is not None:
|
|
757
|
+
result["sync"] = from_union([lambda x: to_class(SecretsSyncRequest, x), from_none], self.sync)
|
|
758
|
+
return result
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
@dataclass
|
|
762
|
+
class Command:
|
|
763
|
+
"""Login with Secrets Manager Access Token
|
|
764
|
+
|
|
765
|
+
This command is for initiating an authentication handshake with Bitwarden.
|
|
766
|
+
|
|
767
|
+
Returns: [ApiKeyLoginResponse](bitwarden::auth::login::ApiKeyLoginResponse)
|
|
768
|
+
"""
|
|
769
|
+
login_access_token: Optional[AccessTokenLoginRequest] = None
|
|
770
|
+
secrets: Optional[SecretsCommand] = None
|
|
771
|
+
projects: Optional[ProjectsCommand] = None
|
|
772
|
+
generators: Optional[GeneratorsCommand] = None
|
|
773
|
+
debug: Optional[DebugCommand] = None
|
|
774
|
+
|
|
775
|
+
@staticmethod
|
|
776
|
+
def from_dict(obj: Any) -> 'Command':
|
|
777
|
+
assert isinstance(obj, dict)
|
|
778
|
+
login_access_token = from_union([AccessTokenLoginRequest.from_dict, from_none], obj.get("loginAccessToken"))
|
|
779
|
+
secrets = from_union([SecretsCommand.from_dict, from_none], obj.get("secrets"))
|
|
780
|
+
projects = from_union([ProjectsCommand.from_dict, from_none], obj.get("projects"))
|
|
781
|
+
generators = from_union([GeneratorsCommand.from_dict, from_none], obj.get("generators"))
|
|
782
|
+
debug = from_union([DebugCommand.from_dict, from_none], obj.get("debug"))
|
|
783
|
+
return Command(login_access_token, secrets, projects, generators, debug)
|
|
784
|
+
|
|
785
|
+
def to_dict(self) -> dict:
|
|
786
|
+
result: dict = {}
|
|
787
|
+
if self.login_access_token is not None:
|
|
788
|
+
result["loginAccessToken"] = from_union([lambda x: to_class(AccessTokenLoginRequest, x), from_none], self.login_access_token)
|
|
789
|
+
if self.secrets is not None:
|
|
790
|
+
result["secrets"] = from_union([lambda x: to_class(SecretsCommand, x), from_none], self.secrets)
|
|
791
|
+
if self.projects is not None:
|
|
792
|
+
result["projects"] = from_union([lambda x: to_class(ProjectsCommand, x), from_none], self.projects)
|
|
793
|
+
if self.generators is not None:
|
|
794
|
+
result["generators"] = from_union([lambda x: to_class(GeneratorsCommand, x), from_none], self.generators)
|
|
795
|
+
if self.debug is not None:
|
|
796
|
+
result["debug"] = from_union([lambda x: to_class(DebugCommand, x), from_none], self.debug)
|
|
797
|
+
return result
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
@dataclass
|
|
801
|
+
class Authenticator:
|
|
802
|
+
pass
|
|
803
|
+
|
|
804
|
+
@staticmethod
|
|
805
|
+
def from_dict(obj: Any) -> 'Authenticator':
|
|
806
|
+
assert isinstance(obj, dict)
|
|
807
|
+
return Authenticator()
|
|
808
|
+
|
|
809
|
+
def to_dict(self) -> dict:
|
|
810
|
+
result: dict = {}
|
|
811
|
+
return result
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
@dataclass
|
|
815
|
+
class Duo:
|
|
816
|
+
host: str
|
|
817
|
+
signature: str
|
|
818
|
+
|
|
819
|
+
@staticmethod
|
|
820
|
+
def from_dict(obj: Any) -> 'Duo':
|
|
821
|
+
assert isinstance(obj, dict)
|
|
822
|
+
host = from_str(obj.get("host"))
|
|
823
|
+
signature = from_str(obj.get("signature"))
|
|
824
|
+
return Duo(host, signature)
|
|
825
|
+
|
|
826
|
+
def to_dict(self) -> dict:
|
|
827
|
+
result: dict = {}
|
|
828
|
+
result["host"] = from_str(self.host)
|
|
829
|
+
result["signature"] = from_str(self.signature)
|
|
830
|
+
return result
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
@dataclass
|
|
834
|
+
class Email:
|
|
835
|
+
email: str
|
|
836
|
+
"""The email to request a 2fa TOTP for"""
|
|
837
|
+
|
|
838
|
+
@staticmethod
|
|
839
|
+
def from_dict(obj: Any) -> 'Email':
|
|
840
|
+
assert isinstance(obj, dict)
|
|
841
|
+
email = from_str(obj.get("email"))
|
|
842
|
+
return Email(email)
|
|
843
|
+
|
|
844
|
+
def to_dict(self) -> dict:
|
|
845
|
+
result: dict = {}
|
|
846
|
+
result["email"] = from_str(self.email)
|
|
847
|
+
return result
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
@dataclass
|
|
851
|
+
class Remember:
|
|
852
|
+
pass
|
|
853
|
+
|
|
854
|
+
@staticmethod
|
|
855
|
+
def from_dict(obj: Any) -> 'Remember':
|
|
856
|
+
assert isinstance(obj, dict)
|
|
857
|
+
return Remember()
|
|
858
|
+
|
|
859
|
+
def to_dict(self) -> dict:
|
|
860
|
+
result: dict = {}
|
|
861
|
+
return result
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
@dataclass
|
|
865
|
+
class WebAuthn:
|
|
866
|
+
pass
|
|
867
|
+
|
|
868
|
+
@staticmethod
|
|
869
|
+
def from_dict(obj: Any) -> 'WebAuthn':
|
|
870
|
+
assert isinstance(obj, dict)
|
|
871
|
+
return WebAuthn()
|
|
872
|
+
|
|
873
|
+
def to_dict(self) -> dict:
|
|
874
|
+
result: dict = {}
|
|
875
|
+
return result
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
@dataclass
|
|
879
|
+
class YubiKey:
|
|
880
|
+
nfc: bool
|
|
881
|
+
"""Whether the stored yubikey supports near field communication"""
|
|
882
|
+
|
|
883
|
+
@staticmethod
|
|
884
|
+
def from_dict(obj: Any) -> 'YubiKey':
|
|
885
|
+
assert isinstance(obj, dict)
|
|
886
|
+
nfc = from_bool(obj.get("nfc"))
|
|
887
|
+
return YubiKey(nfc)
|
|
888
|
+
|
|
889
|
+
def to_dict(self) -> dict:
|
|
890
|
+
result: dict = {}
|
|
891
|
+
result["nfc"] = from_bool(self.nfc)
|
|
892
|
+
return result
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
@dataclass
|
|
896
|
+
class TwoFactorProviders:
|
|
897
|
+
authenticator: Optional[Authenticator] = None
|
|
898
|
+
duo: Optional[Duo] = None
|
|
899
|
+
"""Duo-backed 2fa"""
|
|
900
|
+
|
|
901
|
+
email: Optional[Email] = None
|
|
902
|
+
"""Email 2fa"""
|
|
903
|
+
|
|
904
|
+
organization_duo: Optional[Duo] = None
|
|
905
|
+
"""Duo-backed 2fa operated by an organization the user is a member of"""
|
|
906
|
+
|
|
907
|
+
remember: Optional[Remember] = None
|
|
908
|
+
"""Presence indicates the user has stored this device as bypassing 2fa"""
|
|
909
|
+
|
|
910
|
+
web_authn: Optional[WebAuthn] = None
|
|
911
|
+
"""WebAuthn-backed 2fa"""
|
|
912
|
+
|
|
913
|
+
yubi_key: Optional[YubiKey] = None
|
|
914
|
+
"""Yubikey-backed 2fa"""
|
|
915
|
+
|
|
916
|
+
@staticmethod
|
|
917
|
+
def from_dict(obj: Any) -> 'TwoFactorProviders':
|
|
918
|
+
assert isinstance(obj, dict)
|
|
919
|
+
authenticator = from_union([Authenticator.from_dict, from_none], obj.get("authenticator"))
|
|
920
|
+
duo = from_union([Duo.from_dict, from_none], obj.get("duo"))
|
|
921
|
+
email = from_union([Email.from_dict, from_none], obj.get("email"))
|
|
922
|
+
organization_duo = from_union([Duo.from_dict, from_none], obj.get("organizationDuo"))
|
|
923
|
+
remember = from_union([Remember.from_dict, from_none], obj.get("remember"))
|
|
924
|
+
web_authn = from_union([WebAuthn.from_dict, from_none], obj.get("webAuthn"))
|
|
925
|
+
yubi_key = from_union([YubiKey.from_dict, from_none], obj.get("yubiKey"))
|
|
926
|
+
return TwoFactorProviders(authenticator, duo, email, organization_duo, remember, web_authn, yubi_key)
|
|
927
|
+
|
|
928
|
+
def to_dict(self) -> dict:
|
|
929
|
+
result: dict = {}
|
|
930
|
+
if self.authenticator is not None:
|
|
931
|
+
result["authenticator"] = from_union([lambda x: to_class(Authenticator, x), from_none], self.authenticator)
|
|
932
|
+
if self.duo is not None:
|
|
933
|
+
result["duo"] = from_union([lambda x: to_class(Duo, x), from_none], self.duo)
|
|
934
|
+
if self.email is not None:
|
|
935
|
+
result["email"] = from_union([lambda x: to_class(Email, x), from_none], self.email)
|
|
936
|
+
if self.organization_duo is not None:
|
|
937
|
+
result["organizationDuo"] = from_union([lambda x: to_class(Duo, x), from_none], self.organization_duo)
|
|
938
|
+
if self.remember is not None:
|
|
939
|
+
result["remember"] = from_union([lambda x: to_class(Remember, x), from_none], self.remember)
|
|
940
|
+
if self.web_authn is not None:
|
|
941
|
+
result["webAuthn"] = from_union([lambda x: to_class(WebAuthn, x), from_none], self.web_authn)
|
|
942
|
+
if self.yubi_key is not None:
|
|
943
|
+
result["yubiKey"] = from_union([lambda x: to_class(YubiKey, x), from_none], self.yubi_key)
|
|
944
|
+
return result
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
@dataclass
|
|
948
|
+
class APIKeyLoginResponse:
|
|
949
|
+
authenticated: bool
|
|
950
|
+
force_password_reset: bool
|
|
951
|
+
"""Whether or not the user is required to update their master password"""
|
|
952
|
+
|
|
953
|
+
reset_master_password: bool
|
|
954
|
+
"""TODO: What does this do?"""
|
|
955
|
+
|
|
956
|
+
two_factor: Optional[TwoFactorProviders] = None
|
|
957
|
+
|
|
958
|
+
@staticmethod
|
|
959
|
+
def from_dict(obj: Any) -> 'APIKeyLoginResponse':
|
|
960
|
+
assert isinstance(obj, dict)
|
|
961
|
+
authenticated = from_bool(obj.get("authenticated"))
|
|
962
|
+
force_password_reset = from_bool(obj.get("forcePasswordReset"))
|
|
963
|
+
reset_master_password = from_bool(obj.get("resetMasterPassword"))
|
|
964
|
+
two_factor = from_union([TwoFactorProviders.from_dict, from_none], obj.get("twoFactor"))
|
|
965
|
+
return APIKeyLoginResponse(authenticated, force_password_reset, reset_master_password, two_factor)
|
|
966
|
+
|
|
967
|
+
def to_dict(self) -> dict:
|
|
968
|
+
result: dict = {}
|
|
969
|
+
result["authenticated"] = from_bool(self.authenticated)
|
|
970
|
+
result["forcePasswordReset"] = from_bool(self.force_password_reset)
|
|
971
|
+
result["resetMasterPassword"] = from_bool(self.reset_master_password)
|
|
972
|
+
if self.two_factor is not None:
|
|
973
|
+
result["twoFactor"] = from_union([lambda x: to_class(TwoFactorProviders, x), from_none], self.two_factor)
|
|
974
|
+
return result
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
@dataclass
|
|
978
|
+
class ResponseForAPIKeyLoginResponse:
|
|
979
|
+
success: bool
|
|
980
|
+
"""Whether or not the SDK request succeeded."""
|
|
981
|
+
|
|
982
|
+
data: Optional[APIKeyLoginResponse] = None
|
|
983
|
+
"""The response data. Populated if `success` is true."""
|
|
984
|
+
|
|
985
|
+
error_message: Optional[str] = None
|
|
986
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
987
|
+
|
|
988
|
+
@staticmethod
|
|
989
|
+
def from_dict(obj: Any) -> 'ResponseForAPIKeyLoginResponse':
|
|
990
|
+
assert isinstance(obj, dict)
|
|
991
|
+
success = from_bool(obj.get("success"))
|
|
992
|
+
data = from_union([APIKeyLoginResponse.from_dict, from_none], obj.get("data"))
|
|
993
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
994
|
+
return ResponseForAPIKeyLoginResponse(success, data, error_message)
|
|
995
|
+
|
|
996
|
+
def to_dict(self) -> dict:
|
|
997
|
+
result: dict = {}
|
|
998
|
+
result["success"] = from_bool(self.success)
|
|
999
|
+
if self.data is not None:
|
|
1000
|
+
result["data"] = from_union([lambda x: to_class(APIKeyLoginResponse, x), from_none], self.data)
|
|
1001
|
+
if self.error_message is not None:
|
|
1002
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1003
|
+
return result
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
@dataclass
|
|
1007
|
+
class PasswordLoginResponse:
|
|
1008
|
+
authenticated: bool
|
|
1009
|
+
force_password_reset: bool
|
|
1010
|
+
"""Whether or not the user is required to update their master password"""
|
|
1011
|
+
|
|
1012
|
+
reset_master_password: bool
|
|
1013
|
+
"""TODO: What does this do?"""
|
|
1014
|
+
|
|
1015
|
+
two_factor: Optional[TwoFactorProviders] = None
|
|
1016
|
+
"""The available two factor authentication options. Present only when authentication fails
|
|
1017
|
+
due
|
|
1018
|
+
to requiring a second authentication factor.
|
|
1019
|
+
"""
|
|
1020
|
+
|
|
1021
|
+
@staticmethod
|
|
1022
|
+
def from_dict(obj: Any) -> 'PasswordLoginResponse':
|
|
1023
|
+
assert isinstance(obj, dict)
|
|
1024
|
+
authenticated = from_bool(obj.get("authenticated"))
|
|
1025
|
+
force_password_reset = from_bool(obj.get("forcePasswordReset"))
|
|
1026
|
+
reset_master_password = from_bool(obj.get("resetMasterPassword"))
|
|
1027
|
+
two_factor = from_union([TwoFactorProviders.from_dict, from_none], obj.get("twoFactor"))
|
|
1028
|
+
return PasswordLoginResponse(authenticated, force_password_reset, reset_master_password, two_factor)
|
|
1029
|
+
|
|
1030
|
+
def to_dict(self) -> dict:
|
|
1031
|
+
result: dict = {}
|
|
1032
|
+
result["authenticated"] = from_bool(self.authenticated)
|
|
1033
|
+
result["forcePasswordReset"] = from_bool(self.force_password_reset)
|
|
1034
|
+
result["resetMasterPassword"] = from_bool(self.reset_master_password)
|
|
1035
|
+
if self.two_factor is not None:
|
|
1036
|
+
result["twoFactor"] = from_union([lambda x: to_class(TwoFactorProviders, x), from_none], self.two_factor)
|
|
1037
|
+
return result
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
@dataclass
|
|
1041
|
+
class ResponseForPasswordLoginResponse:
|
|
1042
|
+
success: bool
|
|
1043
|
+
"""Whether or not the SDK request succeeded."""
|
|
1044
|
+
|
|
1045
|
+
data: Optional[PasswordLoginResponse] = None
|
|
1046
|
+
"""The response data. Populated if `success` is true."""
|
|
1047
|
+
|
|
1048
|
+
error_message: Optional[str] = None
|
|
1049
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1050
|
+
|
|
1051
|
+
@staticmethod
|
|
1052
|
+
def from_dict(obj: Any) -> 'ResponseForPasswordLoginResponse':
|
|
1053
|
+
assert isinstance(obj, dict)
|
|
1054
|
+
success = from_bool(obj.get("success"))
|
|
1055
|
+
data = from_union([PasswordLoginResponse.from_dict, from_none], obj.get("data"))
|
|
1056
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1057
|
+
return ResponseForPasswordLoginResponse(success, data, error_message)
|
|
1058
|
+
|
|
1059
|
+
def to_dict(self) -> dict:
|
|
1060
|
+
result: dict = {}
|
|
1061
|
+
result["success"] = from_bool(self.success)
|
|
1062
|
+
if self.data is not None:
|
|
1063
|
+
result["data"] = from_union([lambda x: to_class(PasswordLoginResponse, x), from_none], self.data)
|
|
1064
|
+
if self.error_message is not None:
|
|
1065
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1066
|
+
return result
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
@dataclass
|
|
1070
|
+
class AccessTokenLoginResponse:
|
|
1071
|
+
authenticated: bool
|
|
1072
|
+
force_password_reset: bool
|
|
1073
|
+
"""Whether or not the user is required to update their master password"""
|
|
1074
|
+
|
|
1075
|
+
reset_master_password: bool
|
|
1076
|
+
"""TODO: What does this do?"""
|
|
1077
|
+
|
|
1078
|
+
two_factor: Optional[TwoFactorProviders] = None
|
|
1079
|
+
|
|
1080
|
+
@staticmethod
|
|
1081
|
+
def from_dict(obj: Any) -> 'AccessTokenLoginResponse':
|
|
1082
|
+
assert isinstance(obj, dict)
|
|
1083
|
+
authenticated = from_bool(obj.get("authenticated"))
|
|
1084
|
+
force_password_reset = from_bool(obj.get("forcePasswordReset"))
|
|
1085
|
+
reset_master_password = from_bool(obj.get("resetMasterPassword"))
|
|
1086
|
+
two_factor = from_union([TwoFactorProviders.from_dict, from_none], obj.get("twoFactor"))
|
|
1087
|
+
return AccessTokenLoginResponse(authenticated, force_password_reset, reset_master_password, two_factor)
|
|
1088
|
+
|
|
1089
|
+
def to_dict(self) -> dict:
|
|
1090
|
+
result: dict = {}
|
|
1091
|
+
result["authenticated"] = from_bool(self.authenticated)
|
|
1092
|
+
result["forcePasswordReset"] = from_bool(self.force_password_reset)
|
|
1093
|
+
result["resetMasterPassword"] = from_bool(self.reset_master_password)
|
|
1094
|
+
if self.two_factor is not None:
|
|
1095
|
+
result["twoFactor"] = from_union([lambda x: to_class(TwoFactorProviders, x), from_none], self.two_factor)
|
|
1096
|
+
return result
|
|
1097
|
+
|
|
1098
|
+
|
|
1099
|
+
@dataclass
|
|
1100
|
+
class ResponseForAccessTokenLoginResponse:
|
|
1101
|
+
success: bool
|
|
1102
|
+
"""Whether or not the SDK request succeeded."""
|
|
1103
|
+
|
|
1104
|
+
data: Optional[AccessTokenLoginResponse] = None
|
|
1105
|
+
"""The response data. Populated if `success` is true."""
|
|
1106
|
+
|
|
1107
|
+
error_message: Optional[str] = None
|
|
1108
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1109
|
+
|
|
1110
|
+
@staticmethod
|
|
1111
|
+
def from_dict(obj: Any) -> 'ResponseForAccessTokenLoginResponse':
|
|
1112
|
+
assert isinstance(obj, dict)
|
|
1113
|
+
success = from_bool(obj.get("success"))
|
|
1114
|
+
data = from_union([AccessTokenLoginResponse.from_dict, from_none], obj.get("data"))
|
|
1115
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1116
|
+
return ResponseForAccessTokenLoginResponse(success, data, error_message)
|
|
1117
|
+
|
|
1118
|
+
def to_dict(self) -> dict:
|
|
1119
|
+
result: dict = {}
|
|
1120
|
+
result["success"] = from_bool(self.success)
|
|
1121
|
+
if self.data is not None:
|
|
1122
|
+
result["data"] = from_union([lambda x: to_class(AccessTokenLoginResponse, x), from_none], self.data)
|
|
1123
|
+
if self.error_message is not None:
|
|
1124
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1125
|
+
return result
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
@dataclass
|
|
1129
|
+
class SecretIdentifierResponse:
|
|
1130
|
+
id: UUID
|
|
1131
|
+
key: str
|
|
1132
|
+
organization_id: UUID
|
|
1133
|
+
|
|
1134
|
+
@staticmethod
|
|
1135
|
+
def from_dict(obj: Any) -> 'SecretIdentifierResponse':
|
|
1136
|
+
assert isinstance(obj, dict)
|
|
1137
|
+
id = UUID(obj.get("id"))
|
|
1138
|
+
key = from_str(obj.get("key"))
|
|
1139
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
1140
|
+
return SecretIdentifierResponse(id, key, organization_id)
|
|
1141
|
+
|
|
1142
|
+
def to_dict(self) -> dict:
|
|
1143
|
+
result: dict = {}
|
|
1144
|
+
result["id"] = str(self.id)
|
|
1145
|
+
result["key"] = from_str(self.key)
|
|
1146
|
+
result["organizationId"] = str(self.organization_id)
|
|
1147
|
+
return result
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
@dataclass
|
|
1151
|
+
class SecretIdentifiersResponse:
|
|
1152
|
+
data: List[SecretIdentifierResponse]
|
|
1153
|
+
|
|
1154
|
+
@staticmethod
|
|
1155
|
+
def from_dict(obj: Any) -> 'SecretIdentifiersResponse':
|
|
1156
|
+
assert isinstance(obj, dict)
|
|
1157
|
+
data = from_list(SecretIdentifierResponse.from_dict, obj.get("data"))
|
|
1158
|
+
return SecretIdentifiersResponse(data)
|
|
1159
|
+
|
|
1160
|
+
def to_dict(self) -> dict:
|
|
1161
|
+
result: dict = {}
|
|
1162
|
+
result["data"] = from_list(lambda x: to_class(SecretIdentifierResponse, x), self.data)
|
|
1163
|
+
return result
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
@dataclass
|
|
1167
|
+
class ResponseForSecretIdentifiersResponse:
|
|
1168
|
+
success: bool
|
|
1169
|
+
"""Whether or not the SDK request succeeded."""
|
|
1170
|
+
|
|
1171
|
+
data: Optional[SecretIdentifiersResponse] = None
|
|
1172
|
+
"""The response data. Populated if `success` is true."""
|
|
1173
|
+
|
|
1174
|
+
error_message: Optional[str] = None
|
|
1175
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1176
|
+
|
|
1177
|
+
@staticmethod
|
|
1178
|
+
def from_dict(obj: Any) -> 'ResponseForSecretIdentifiersResponse':
|
|
1179
|
+
assert isinstance(obj, dict)
|
|
1180
|
+
success = from_bool(obj.get("success"))
|
|
1181
|
+
data = from_union([SecretIdentifiersResponse.from_dict, from_none], obj.get("data"))
|
|
1182
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1183
|
+
return ResponseForSecretIdentifiersResponse(success, data, error_message)
|
|
1184
|
+
|
|
1185
|
+
def to_dict(self) -> dict:
|
|
1186
|
+
result: dict = {}
|
|
1187
|
+
result["success"] = from_bool(self.success)
|
|
1188
|
+
if self.data is not None:
|
|
1189
|
+
result["data"] = from_union([lambda x: to_class(SecretIdentifiersResponse, x), from_none], self.data)
|
|
1190
|
+
if self.error_message is not None:
|
|
1191
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1192
|
+
return result
|
|
1193
|
+
|
|
1194
|
+
|
|
1195
|
+
@dataclass
|
|
1196
|
+
class SecretResponse:
|
|
1197
|
+
creation_date: datetime
|
|
1198
|
+
id: UUID
|
|
1199
|
+
key: str
|
|
1200
|
+
note: str
|
|
1201
|
+
organization_id: UUID
|
|
1202
|
+
revision_date: datetime
|
|
1203
|
+
value: str
|
|
1204
|
+
project_id: Optional[UUID] = None
|
|
1205
|
+
|
|
1206
|
+
@staticmethod
|
|
1207
|
+
def from_dict(obj: Any) -> 'SecretResponse':
|
|
1208
|
+
assert isinstance(obj, dict)
|
|
1209
|
+
creation_date = from_datetime(obj.get("creationDate"))
|
|
1210
|
+
id = UUID(obj.get("id"))
|
|
1211
|
+
key = from_str(obj.get("key"))
|
|
1212
|
+
note = from_str(obj.get("note"))
|
|
1213
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
1214
|
+
revision_date = from_datetime(obj.get("revisionDate"))
|
|
1215
|
+
value = from_str(obj.get("value"))
|
|
1216
|
+
project_id = from_union([from_none, lambda x: UUID(x)], obj.get("projectId"))
|
|
1217
|
+
return SecretResponse(creation_date, id, key, note, organization_id, revision_date, value, project_id)
|
|
1218
|
+
|
|
1219
|
+
def to_dict(self) -> dict:
|
|
1220
|
+
result: dict = {}
|
|
1221
|
+
result["creationDate"] = self.creation_date.isoformat()
|
|
1222
|
+
result["id"] = str(self.id)
|
|
1223
|
+
result["key"] = from_str(self.key)
|
|
1224
|
+
result["note"] = from_str(self.note)
|
|
1225
|
+
result["organizationId"] = str(self.organization_id)
|
|
1226
|
+
result["revisionDate"] = self.revision_date.isoformat()
|
|
1227
|
+
result["value"] = from_str(self.value)
|
|
1228
|
+
if self.project_id is not None:
|
|
1229
|
+
result["projectId"] = from_union([from_none, lambda x: str(x)], self.project_id)
|
|
1230
|
+
return result
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
@dataclass
|
|
1234
|
+
class ResponseForSecretResponse:
|
|
1235
|
+
success: bool
|
|
1236
|
+
"""Whether or not the SDK request succeeded."""
|
|
1237
|
+
|
|
1238
|
+
data: Optional[SecretResponse] = None
|
|
1239
|
+
"""The response data. Populated if `success` is true."""
|
|
1240
|
+
|
|
1241
|
+
error_message: Optional[str] = None
|
|
1242
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1243
|
+
|
|
1244
|
+
@staticmethod
|
|
1245
|
+
def from_dict(obj: Any) -> 'ResponseForSecretResponse':
|
|
1246
|
+
assert isinstance(obj, dict)
|
|
1247
|
+
success = from_bool(obj.get("success"))
|
|
1248
|
+
data = from_union([SecretResponse.from_dict, from_none], obj.get("data"))
|
|
1249
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1250
|
+
return ResponseForSecretResponse(success, data, error_message)
|
|
1251
|
+
|
|
1252
|
+
def to_dict(self) -> dict:
|
|
1253
|
+
result: dict = {}
|
|
1254
|
+
result["success"] = from_bool(self.success)
|
|
1255
|
+
if self.data is not None:
|
|
1256
|
+
result["data"] = from_union([lambda x: to_class(SecretResponse, x), from_none], self.data)
|
|
1257
|
+
if self.error_message is not None:
|
|
1258
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1259
|
+
return result
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
@dataclass
|
|
1263
|
+
class SecretsResponse:
|
|
1264
|
+
data: List[SecretResponse]
|
|
1265
|
+
|
|
1266
|
+
@staticmethod
|
|
1267
|
+
def from_dict(obj: Any) -> 'SecretsResponse':
|
|
1268
|
+
assert isinstance(obj, dict)
|
|
1269
|
+
data = from_list(SecretResponse.from_dict, obj.get("data"))
|
|
1270
|
+
return SecretsResponse(data)
|
|
1271
|
+
|
|
1272
|
+
def to_dict(self) -> dict:
|
|
1273
|
+
result: dict = {}
|
|
1274
|
+
result["data"] = from_list(lambda x: to_class(SecretResponse, x), self.data)
|
|
1275
|
+
return result
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
@dataclass
|
|
1279
|
+
class ResponseForSecretsResponse:
|
|
1280
|
+
success: bool
|
|
1281
|
+
"""Whether or not the SDK request succeeded."""
|
|
1282
|
+
|
|
1283
|
+
data: Optional[SecretsResponse] = None
|
|
1284
|
+
"""The response data. Populated if `success` is true."""
|
|
1285
|
+
|
|
1286
|
+
error_message: Optional[str] = None
|
|
1287
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1288
|
+
|
|
1289
|
+
@staticmethod
|
|
1290
|
+
def from_dict(obj: Any) -> 'ResponseForSecretsResponse':
|
|
1291
|
+
assert isinstance(obj, dict)
|
|
1292
|
+
success = from_bool(obj.get("success"))
|
|
1293
|
+
data = from_union([SecretsResponse.from_dict, from_none], obj.get("data"))
|
|
1294
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1295
|
+
return ResponseForSecretsResponse(success, data, error_message)
|
|
1296
|
+
|
|
1297
|
+
def to_dict(self) -> dict:
|
|
1298
|
+
result: dict = {}
|
|
1299
|
+
result["success"] = from_bool(self.success)
|
|
1300
|
+
if self.data is not None:
|
|
1301
|
+
result["data"] = from_union([lambda x: to_class(SecretsResponse, x), from_none], self.data)
|
|
1302
|
+
if self.error_message is not None:
|
|
1303
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1304
|
+
return result
|
|
1305
|
+
|
|
1306
|
+
|
|
1307
|
+
@dataclass
|
|
1308
|
+
class SecretDeleteResponse:
|
|
1309
|
+
id: UUID
|
|
1310
|
+
error: Optional[str] = None
|
|
1311
|
+
|
|
1312
|
+
@staticmethod
|
|
1313
|
+
def from_dict(obj: Any) -> 'SecretDeleteResponse':
|
|
1314
|
+
assert isinstance(obj, dict)
|
|
1315
|
+
id = UUID(obj.get("id"))
|
|
1316
|
+
error = from_union([from_none, from_str], obj.get("error"))
|
|
1317
|
+
return SecretDeleteResponse(id, error)
|
|
1318
|
+
|
|
1319
|
+
def to_dict(self) -> dict:
|
|
1320
|
+
result: dict = {}
|
|
1321
|
+
result["id"] = str(self.id)
|
|
1322
|
+
if self.error is not None:
|
|
1323
|
+
result["error"] = from_union([from_none, from_str], self.error)
|
|
1324
|
+
return result
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
@dataclass
|
|
1328
|
+
class SecretsDeleteResponse:
|
|
1329
|
+
data: List[SecretDeleteResponse]
|
|
1330
|
+
|
|
1331
|
+
@staticmethod
|
|
1332
|
+
def from_dict(obj: Any) -> 'SecretsDeleteResponse':
|
|
1333
|
+
assert isinstance(obj, dict)
|
|
1334
|
+
data = from_list(SecretDeleteResponse.from_dict, obj.get("data"))
|
|
1335
|
+
return SecretsDeleteResponse(data)
|
|
1336
|
+
|
|
1337
|
+
def to_dict(self) -> dict:
|
|
1338
|
+
result: dict = {}
|
|
1339
|
+
result["data"] = from_list(lambda x: to_class(SecretDeleteResponse, x), self.data)
|
|
1340
|
+
return result
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
@dataclass
|
|
1344
|
+
class ResponseForSecretsDeleteResponse:
|
|
1345
|
+
success: bool
|
|
1346
|
+
"""Whether or not the SDK request succeeded."""
|
|
1347
|
+
|
|
1348
|
+
data: Optional[SecretsDeleteResponse] = None
|
|
1349
|
+
"""The response data. Populated if `success` is true."""
|
|
1350
|
+
|
|
1351
|
+
error_message: Optional[str] = None
|
|
1352
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1353
|
+
|
|
1354
|
+
@staticmethod
|
|
1355
|
+
def from_dict(obj: Any) -> 'ResponseForSecretsDeleteResponse':
|
|
1356
|
+
assert isinstance(obj, dict)
|
|
1357
|
+
success = from_bool(obj.get("success"))
|
|
1358
|
+
data = from_union([SecretsDeleteResponse.from_dict, from_none], obj.get("data"))
|
|
1359
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1360
|
+
return ResponseForSecretsDeleteResponse(success, data, error_message)
|
|
1361
|
+
|
|
1362
|
+
def to_dict(self) -> dict:
|
|
1363
|
+
result: dict = {}
|
|
1364
|
+
result["success"] = from_bool(self.success)
|
|
1365
|
+
if self.data is not None:
|
|
1366
|
+
result["data"] = from_union([lambda x: to_class(SecretsDeleteResponse, x), from_none], self.data)
|
|
1367
|
+
if self.error_message is not None:
|
|
1368
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1369
|
+
return result
|
|
1370
|
+
|
|
1371
|
+
|
|
1372
|
+
@dataclass
|
|
1373
|
+
class SecretsSyncResponse:
|
|
1374
|
+
has_changes: bool
|
|
1375
|
+
secrets: Optional[List[SecretResponse]] = None
|
|
1376
|
+
|
|
1377
|
+
@staticmethod
|
|
1378
|
+
def from_dict(obj: Any) -> 'SecretsSyncResponse':
|
|
1379
|
+
assert isinstance(obj, dict)
|
|
1380
|
+
has_changes = from_bool(obj.get("hasChanges"))
|
|
1381
|
+
secrets = from_union([from_none, lambda x: from_list(SecretResponse.from_dict, x)], obj.get("secrets"))
|
|
1382
|
+
return SecretsSyncResponse(has_changes, secrets)
|
|
1383
|
+
|
|
1384
|
+
def to_dict(self) -> dict:
|
|
1385
|
+
result: dict = {}
|
|
1386
|
+
result["hasChanges"] = from_bool(self.has_changes)
|
|
1387
|
+
if self.secrets is not None:
|
|
1388
|
+
result["secrets"] = from_union([from_none, lambda x: from_list(lambda x: to_class(SecretResponse, x), x)], self.secrets)
|
|
1389
|
+
return result
|
|
1390
|
+
|
|
1391
|
+
|
|
1392
|
+
@dataclass
|
|
1393
|
+
class ResponseForSecretsSyncResponse:
|
|
1394
|
+
success: bool
|
|
1395
|
+
"""Whether or not the SDK request succeeded."""
|
|
1396
|
+
|
|
1397
|
+
data: Optional[SecretsSyncResponse] = None
|
|
1398
|
+
"""The response data. Populated if `success` is true."""
|
|
1399
|
+
|
|
1400
|
+
error_message: Optional[str] = None
|
|
1401
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1402
|
+
|
|
1403
|
+
@staticmethod
|
|
1404
|
+
def from_dict(obj: Any) -> 'ResponseForSecretsSyncResponse':
|
|
1405
|
+
assert isinstance(obj, dict)
|
|
1406
|
+
success = from_bool(obj.get("success"))
|
|
1407
|
+
data = from_union([SecretsSyncResponse.from_dict, from_none], obj.get("data"))
|
|
1408
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1409
|
+
return ResponseForSecretsSyncResponse(success, data, error_message)
|
|
1410
|
+
|
|
1411
|
+
def to_dict(self) -> dict:
|
|
1412
|
+
result: dict = {}
|
|
1413
|
+
result["success"] = from_bool(self.success)
|
|
1414
|
+
if self.data is not None:
|
|
1415
|
+
result["data"] = from_union([lambda x: to_class(SecretsSyncResponse, x), from_none], self.data)
|
|
1416
|
+
if self.error_message is not None:
|
|
1417
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1418
|
+
return result
|
|
1419
|
+
|
|
1420
|
+
|
|
1421
|
+
@dataclass
|
|
1422
|
+
class ProjectResponse:
|
|
1423
|
+
creation_date: datetime
|
|
1424
|
+
id: UUID
|
|
1425
|
+
name: str
|
|
1426
|
+
organization_id: UUID
|
|
1427
|
+
revision_date: datetime
|
|
1428
|
+
|
|
1429
|
+
@staticmethod
|
|
1430
|
+
def from_dict(obj: Any) -> 'ProjectResponse':
|
|
1431
|
+
assert isinstance(obj, dict)
|
|
1432
|
+
creation_date = from_datetime(obj.get("creationDate"))
|
|
1433
|
+
id = UUID(obj.get("id"))
|
|
1434
|
+
name = from_str(obj.get("name"))
|
|
1435
|
+
organization_id = UUID(obj.get("organizationId"))
|
|
1436
|
+
revision_date = from_datetime(obj.get("revisionDate"))
|
|
1437
|
+
return ProjectResponse(creation_date, id, name, organization_id, revision_date)
|
|
1438
|
+
|
|
1439
|
+
def to_dict(self) -> dict:
|
|
1440
|
+
result: dict = {}
|
|
1441
|
+
result["creationDate"] = self.creation_date.isoformat()
|
|
1442
|
+
result["id"] = str(self.id)
|
|
1443
|
+
result["name"] = from_str(self.name)
|
|
1444
|
+
result["organizationId"] = str(self.organization_id)
|
|
1445
|
+
result["revisionDate"] = self.revision_date.isoformat()
|
|
1446
|
+
return result
|
|
1447
|
+
|
|
1448
|
+
|
|
1449
|
+
@dataclass
|
|
1450
|
+
class ResponseForProjectResponse:
|
|
1451
|
+
success: bool
|
|
1452
|
+
"""Whether or not the SDK request succeeded."""
|
|
1453
|
+
|
|
1454
|
+
data: Optional[ProjectResponse] = None
|
|
1455
|
+
"""The response data. Populated if `success` is true."""
|
|
1456
|
+
|
|
1457
|
+
error_message: Optional[str] = None
|
|
1458
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1459
|
+
|
|
1460
|
+
@staticmethod
|
|
1461
|
+
def from_dict(obj: Any) -> 'ResponseForProjectResponse':
|
|
1462
|
+
assert isinstance(obj, dict)
|
|
1463
|
+
success = from_bool(obj.get("success"))
|
|
1464
|
+
data = from_union([ProjectResponse.from_dict, from_none], obj.get("data"))
|
|
1465
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1466
|
+
return ResponseForProjectResponse(success, data, error_message)
|
|
1467
|
+
|
|
1468
|
+
def to_dict(self) -> dict:
|
|
1469
|
+
result: dict = {}
|
|
1470
|
+
result["success"] = from_bool(self.success)
|
|
1471
|
+
if self.data is not None:
|
|
1472
|
+
result["data"] = from_union([lambda x: to_class(ProjectResponse, x), from_none], self.data)
|
|
1473
|
+
if self.error_message is not None:
|
|
1474
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1475
|
+
return result
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
@dataclass
|
|
1479
|
+
class ProjectsResponse:
|
|
1480
|
+
data: List[ProjectResponse]
|
|
1481
|
+
|
|
1482
|
+
@staticmethod
|
|
1483
|
+
def from_dict(obj: Any) -> 'ProjectsResponse':
|
|
1484
|
+
assert isinstance(obj, dict)
|
|
1485
|
+
data = from_list(ProjectResponse.from_dict, obj.get("data"))
|
|
1486
|
+
return ProjectsResponse(data)
|
|
1487
|
+
|
|
1488
|
+
def to_dict(self) -> dict:
|
|
1489
|
+
result: dict = {}
|
|
1490
|
+
result["data"] = from_list(lambda x: to_class(ProjectResponse, x), self.data)
|
|
1491
|
+
return result
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
@dataclass
|
|
1495
|
+
class ResponseForProjectsResponse:
|
|
1496
|
+
success: bool
|
|
1497
|
+
"""Whether or not the SDK request succeeded."""
|
|
1498
|
+
|
|
1499
|
+
data: Optional[ProjectsResponse] = None
|
|
1500
|
+
"""The response data. Populated if `success` is true."""
|
|
1501
|
+
|
|
1502
|
+
error_message: Optional[str] = None
|
|
1503
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1504
|
+
|
|
1505
|
+
@staticmethod
|
|
1506
|
+
def from_dict(obj: Any) -> 'ResponseForProjectsResponse':
|
|
1507
|
+
assert isinstance(obj, dict)
|
|
1508
|
+
success = from_bool(obj.get("success"))
|
|
1509
|
+
data = from_union([ProjectsResponse.from_dict, from_none], obj.get("data"))
|
|
1510
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1511
|
+
return ResponseForProjectsResponse(success, data, error_message)
|
|
1512
|
+
|
|
1513
|
+
def to_dict(self) -> dict:
|
|
1514
|
+
result: dict = {}
|
|
1515
|
+
result["success"] = from_bool(self.success)
|
|
1516
|
+
if self.data is not None:
|
|
1517
|
+
result["data"] = from_union([lambda x: to_class(ProjectsResponse, x), from_none], self.data)
|
|
1518
|
+
if self.error_message is not None:
|
|
1519
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1520
|
+
return result
|
|
1521
|
+
|
|
1522
|
+
|
|
1523
|
+
@dataclass
|
|
1524
|
+
class ProjectDeleteResponse:
|
|
1525
|
+
id: UUID
|
|
1526
|
+
error: Optional[str] = None
|
|
1527
|
+
|
|
1528
|
+
@staticmethod
|
|
1529
|
+
def from_dict(obj: Any) -> 'ProjectDeleteResponse':
|
|
1530
|
+
assert isinstance(obj, dict)
|
|
1531
|
+
id = UUID(obj.get("id"))
|
|
1532
|
+
error = from_union([from_none, from_str], obj.get("error"))
|
|
1533
|
+
return ProjectDeleteResponse(id, error)
|
|
1534
|
+
|
|
1535
|
+
def to_dict(self) -> dict:
|
|
1536
|
+
result: dict = {}
|
|
1537
|
+
result["id"] = str(self.id)
|
|
1538
|
+
if self.error is not None:
|
|
1539
|
+
result["error"] = from_union([from_none, from_str], self.error)
|
|
1540
|
+
return result
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
@dataclass
|
|
1544
|
+
class ProjectsDeleteResponse:
|
|
1545
|
+
data: List[ProjectDeleteResponse]
|
|
1546
|
+
|
|
1547
|
+
@staticmethod
|
|
1548
|
+
def from_dict(obj: Any) -> 'ProjectsDeleteResponse':
|
|
1549
|
+
assert isinstance(obj, dict)
|
|
1550
|
+
data = from_list(ProjectDeleteResponse.from_dict, obj.get("data"))
|
|
1551
|
+
return ProjectsDeleteResponse(data)
|
|
1552
|
+
|
|
1553
|
+
def to_dict(self) -> dict:
|
|
1554
|
+
result: dict = {}
|
|
1555
|
+
result["data"] = from_list(lambda x: to_class(ProjectDeleteResponse, x), self.data)
|
|
1556
|
+
return result
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
@dataclass
|
|
1560
|
+
class ResponseForProjectsDeleteResponse:
|
|
1561
|
+
success: bool
|
|
1562
|
+
"""Whether or not the SDK request succeeded."""
|
|
1563
|
+
|
|
1564
|
+
data: Optional[ProjectsDeleteResponse] = None
|
|
1565
|
+
"""The response data. Populated if `success` is true."""
|
|
1566
|
+
|
|
1567
|
+
error_message: Optional[str] = None
|
|
1568
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1569
|
+
|
|
1570
|
+
@staticmethod
|
|
1571
|
+
def from_dict(obj: Any) -> 'ResponseForProjectsDeleteResponse':
|
|
1572
|
+
assert isinstance(obj, dict)
|
|
1573
|
+
success = from_bool(obj.get("success"))
|
|
1574
|
+
data = from_union([ProjectsDeleteResponse.from_dict, from_none], obj.get("data"))
|
|
1575
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1576
|
+
return ResponseForProjectsDeleteResponse(success, data, error_message)
|
|
1577
|
+
|
|
1578
|
+
def to_dict(self) -> dict:
|
|
1579
|
+
result: dict = {}
|
|
1580
|
+
result["success"] = from_bool(self.success)
|
|
1581
|
+
if self.data is not None:
|
|
1582
|
+
result["data"] = from_union([lambda x: to_class(ProjectsDeleteResponse, x), from_none], self.data)
|
|
1583
|
+
if self.error_message is not None:
|
|
1584
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1585
|
+
return result
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
@dataclass
|
|
1589
|
+
class ResponseForString:
|
|
1590
|
+
success: bool
|
|
1591
|
+
"""Whether or not the SDK request succeeded."""
|
|
1592
|
+
|
|
1593
|
+
data: Optional[str] = None
|
|
1594
|
+
"""The response data. Populated if `success` is true."""
|
|
1595
|
+
|
|
1596
|
+
error_message: Optional[str] = None
|
|
1597
|
+
"""A message for any error that may occur. Populated if `success` is false."""
|
|
1598
|
+
|
|
1599
|
+
@staticmethod
|
|
1600
|
+
def from_dict(obj: Any) -> 'ResponseForString':
|
|
1601
|
+
assert isinstance(obj, dict)
|
|
1602
|
+
success = from_bool(obj.get("success"))
|
|
1603
|
+
data = from_union([from_none, from_str], obj.get("data"))
|
|
1604
|
+
error_message = from_union([from_none, from_str], obj.get("errorMessage"))
|
|
1605
|
+
return ResponseForString(success, data, error_message)
|
|
1606
|
+
|
|
1607
|
+
def to_dict(self) -> dict:
|
|
1608
|
+
result: dict = {}
|
|
1609
|
+
result["success"] = from_bool(self.success)
|
|
1610
|
+
if self.data is not None:
|
|
1611
|
+
result["data"] = from_union([from_none, from_str], self.data)
|
|
1612
|
+
if self.error_message is not None:
|
|
1613
|
+
result["errorMessage"] = from_union([from_none, from_str], self.error_message)
|
|
1614
|
+
return result
|
|
1615
|
+
|
|
1616
|
+
|
|
1617
|
+
def client_settings_from_dict(s: Any) -> ClientSettings:
|
|
1618
|
+
return ClientSettings.from_dict(s)
|
|
1619
|
+
|
|
1620
|
+
|
|
1621
|
+
def client_settings_to_dict(x: ClientSettings) -> Any:
|
|
1622
|
+
return to_class(ClientSettings, x)
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
def device_type_from_dict(s: Any) -> DeviceType:
|
|
1626
|
+
return DeviceType(s)
|
|
1627
|
+
|
|
1628
|
+
|
|
1629
|
+
def device_type_to_dict(x: DeviceType) -> Any:
|
|
1630
|
+
return to_enum(DeviceType, x)
|
|
1631
|
+
|
|
1632
|
+
|
|
1633
|
+
def command_from_dict(s: Any) -> Command:
|
|
1634
|
+
return Command.from_dict(s)
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
def command_to_dict(x: Command) -> Any:
|
|
1638
|
+
return to_class(Command, x)
|
|
1639
|
+
|
|
1640
|
+
|
|
1641
|
+
def access_token_login_request_from_dict(s: Any) -> AccessTokenLoginRequest:
|
|
1642
|
+
return AccessTokenLoginRequest.from_dict(s)
|
|
1643
|
+
|
|
1644
|
+
|
|
1645
|
+
def access_token_login_request_to_dict(x: AccessTokenLoginRequest) -> Any:
|
|
1646
|
+
return to_class(AccessTokenLoginRequest, x)
|
|
1647
|
+
|
|
1648
|
+
|
|
1649
|
+
def secrets_command_from_dict(s: Any) -> SecretsCommand:
|
|
1650
|
+
return SecretsCommand.from_dict(s)
|
|
1651
|
+
|
|
1652
|
+
|
|
1653
|
+
def secrets_command_to_dict(x: SecretsCommand) -> Any:
|
|
1654
|
+
return to_class(SecretsCommand, x)
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
def secret_get_request_from_dict(s: Any) -> SecretGetRequest:
|
|
1658
|
+
return SecretGetRequest.from_dict(s)
|
|
1659
|
+
|
|
1660
|
+
|
|
1661
|
+
def secret_get_request_to_dict(x: SecretGetRequest) -> Any:
|
|
1662
|
+
return to_class(SecretGetRequest, x)
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
def secrets_get_request_from_dict(s: Any) -> SecretsGetRequest:
|
|
1666
|
+
return SecretsGetRequest.from_dict(s)
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
def secrets_get_request_to_dict(x: SecretsGetRequest) -> Any:
|
|
1670
|
+
return to_class(SecretsGetRequest, x)
|
|
1671
|
+
|
|
1672
|
+
|
|
1673
|
+
def secret_create_request_from_dict(s: Any) -> SecretCreateRequest:
|
|
1674
|
+
return SecretCreateRequest.from_dict(s)
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
def secret_create_request_to_dict(x: SecretCreateRequest) -> Any:
|
|
1678
|
+
return to_class(SecretCreateRequest, x)
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
def secret_identifiers_request_from_dict(s: Any) -> SecretIdentifiersRequest:
|
|
1682
|
+
return SecretIdentifiersRequest.from_dict(s)
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
def secret_identifiers_request_to_dict(x: SecretIdentifiersRequest) -> Any:
|
|
1686
|
+
return to_class(SecretIdentifiersRequest, x)
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
def secret_put_request_from_dict(s: Any) -> SecretPutRequest:
|
|
1690
|
+
return SecretPutRequest.from_dict(s)
|
|
1691
|
+
|
|
1692
|
+
|
|
1693
|
+
def secret_put_request_to_dict(x: SecretPutRequest) -> Any:
|
|
1694
|
+
return to_class(SecretPutRequest, x)
|
|
1695
|
+
|
|
1696
|
+
|
|
1697
|
+
def secrets_delete_request_from_dict(s: Any) -> SecretsDeleteRequest:
|
|
1698
|
+
return SecretsDeleteRequest.from_dict(s)
|
|
1699
|
+
|
|
1700
|
+
|
|
1701
|
+
def secrets_delete_request_to_dict(x: SecretsDeleteRequest) -> Any:
|
|
1702
|
+
return to_class(SecretsDeleteRequest, x)
|
|
1703
|
+
|
|
1704
|
+
|
|
1705
|
+
def secrets_sync_request_from_dict(s: Any) -> SecretsSyncRequest:
|
|
1706
|
+
return SecretsSyncRequest.from_dict(s)
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
def secrets_sync_request_to_dict(x: SecretsSyncRequest) -> Any:
|
|
1710
|
+
return to_class(SecretsSyncRequest, x)
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
def projects_command_from_dict(s: Any) -> ProjectsCommand:
|
|
1714
|
+
return ProjectsCommand.from_dict(s)
|
|
1715
|
+
|
|
1716
|
+
|
|
1717
|
+
def projects_command_to_dict(x: ProjectsCommand) -> Any:
|
|
1718
|
+
return to_class(ProjectsCommand, x)
|
|
1719
|
+
|
|
1720
|
+
|
|
1721
|
+
def project_get_request_from_dict(s: Any) -> ProjectGetRequest:
|
|
1722
|
+
return ProjectGetRequest.from_dict(s)
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
def project_get_request_to_dict(x: ProjectGetRequest) -> Any:
|
|
1726
|
+
return to_class(ProjectGetRequest, x)
|
|
1727
|
+
|
|
1728
|
+
|
|
1729
|
+
def project_create_request_from_dict(s: Any) -> ProjectCreateRequest:
|
|
1730
|
+
return ProjectCreateRequest.from_dict(s)
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
def project_create_request_to_dict(x: ProjectCreateRequest) -> Any:
|
|
1734
|
+
return to_class(ProjectCreateRequest, x)
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
def projects_list_request_from_dict(s: Any) -> ProjectsListRequest:
|
|
1738
|
+
return ProjectsListRequest.from_dict(s)
|
|
1739
|
+
|
|
1740
|
+
|
|
1741
|
+
def projects_list_request_to_dict(x: ProjectsListRequest) -> Any:
|
|
1742
|
+
return to_class(ProjectsListRequest, x)
|
|
1743
|
+
|
|
1744
|
+
|
|
1745
|
+
def project_put_request_from_dict(s: Any) -> ProjectPutRequest:
|
|
1746
|
+
return ProjectPutRequest.from_dict(s)
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
def project_put_request_to_dict(x: ProjectPutRequest) -> Any:
|
|
1750
|
+
return to_class(ProjectPutRequest, x)
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
def projects_delete_request_from_dict(s: Any) -> ProjectsDeleteRequest:
|
|
1754
|
+
return ProjectsDeleteRequest.from_dict(s)
|
|
1755
|
+
|
|
1756
|
+
|
|
1757
|
+
def projects_delete_request_to_dict(x: ProjectsDeleteRequest) -> Any:
|
|
1758
|
+
return to_class(ProjectsDeleteRequest, x)
|
|
1759
|
+
|
|
1760
|
+
|
|
1761
|
+
def generators_command_from_dict(s: Any) -> GeneratorsCommand:
|
|
1762
|
+
return GeneratorsCommand.from_dict(s)
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
def generators_command_to_dict(x: GeneratorsCommand) -> Any:
|
|
1766
|
+
return to_class(GeneratorsCommand, x)
|
|
1767
|
+
|
|
1768
|
+
|
|
1769
|
+
def password_generator_request_from_dict(s: Any) -> PasswordGeneratorRequest:
|
|
1770
|
+
return PasswordGeneratorRequest.from_dict(s)
|
|
1771
|
+
|
|
1772
|
+
|
|
1773
|
+
def password_generator_request_to_dict(x: PasswordGeneratorRequest) -> Any:
|
|
1774
|
+
return to_class(PasswordGeneratorRequest, x)
|
|
1775
|
+
|
|
1776
|
+
|
|
1777
|
+
def debug_command_from_dict(s: Any) -> DebugCommand:
|
|
1778
|
+
return DebugCommand.from_dict(s)
|
|
1779
|
+
|
|
1780
|
+
|
|
1781
|
+
def debug_command_to_dict(x: DebugCommand) -> Any:
|
|
1782
|
+
return to_class(DebugCommand, x)
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
def response_for_api_key_login_response_from_dict(s: Any) -> ResponseForAPIKeyLoginResponse:
|
|
1786
|
+
return ResponseForAPIKeyLoginResponse.from_dict(s)
|
|
1787
|
+
|
|
1788
|
+
|
|
1789
|
+
def response_for_api_key_login_response_to_dict(x: ResponseForAPIKeyLoginResponse) -> Any:
|
|
1790
|
+
return to_class(ResponseForAPIKeyLoginResponse, x)
|
|
1791
|
+
|
|
1792
|
+
|
|
1793
|
+
def api_key_login_response_from_dict(s: Any) -> APIKeyLoginResponse:
|
|
1794
|
+
return APIKeyLoginResponse.from_dict(s)
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
def api_key_login_response_to_dict(x: APIKeyLoginResponse) -> Any:
|
|
1798
|
+
return to_class(APIKeyLoginResponse, x)
|
|
1799
|
+
|
|
1800
|
+
|
|
1801
|
+
def two_factor_providers_from_dict(s: Any) -> TwoFactorProviders:
|
|
1802
|
+
return TwoFactorProviders.from_dict(s)
|
|
1803
|
+
|
|
1804
|
+
|
|
1805
|
+
def two_factor_providers_to_dict(x: TwoFactorProviders) -> Any:
|
|
1806
|
+
return to_class(TwoFactorProviders, x)
|
|
1807
|
+
|
|
1808
|
+
|
|
1809
|
+
def authenticator_from_dict(s: Any) -> Authenticator:
|
|
1810
|
+
return Authenticator.from_dict(s)
|
|
1811
|
+
|
|
1812
|
+
|
|
1813
|
+
def authenticator_to_dict(x: Authenticator) -> Any:
|
|
1814
|
+
return to_class(Authenticator, x)
|
|
1815
|
+
|
|
1816
|
+
|
|
1817
|
+
def email_from_dict(s: Any) -> Email:
|
|
1818
|
+
return Email.from_dict(s)
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
def email_to_dict(x: Email) -> Any:
|
|
1822
|
+
return to_class(Email, x)
|
|
1823
|
+
|
|
1824
|
+
|
|
1825
|
+
def duo_from_dict(s: Any) -> Duo:
|
|
1826
|
+
return Duo.from_dict(s)
|
|
1827
|
+
|
|
1828
|
+
|
|
1829
|
+
def duo_to_dict(x: Duo) -> Any:
|
|
1830
|
+
return to_class(Duo, x)
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
def yubi_key_from_dict(s: Any) -> YubiKey:
|
|
1834
|
+
return YubiKey.from_dict(s)
|
|
1835
|
+
|
|
1836
|
+
|
|
1837
|
+
def yubi_key_to_dict(x: YubiKey) -> Any:
|
|
1838
|
+
return to_class(YubiKey, x)
|
|
1839
|
+
|
|
1840
|
+
|
|
1841
|
+
def remember_from_dict(s: Any) -> Remember:
|
|
1842
|
+
return Remember.from_dict(s)
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
def remember_to_dict(x: Remember) -> Any:
|
|
1846
|
+
return to_class(Remember, x)
|
|
1847
|
+
|
|
1848
|
+
|
|
1849
|
+
def web_authn_from_dict(s: Any) -> WebAuthn:
|
|
1850
|
+
return WebAuthn.from_dict(s)
|
|
1851
|
+
|
|
1852
|
+
|
|
1853
|
+
def web_authn_to_dict(x: WebAuthn) -> Any:
|
|
1854
|
+
return to_class(WebAuthn, x)
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
def response_for_password_login_response_from_dict(s: Any) -> ResponseForPasswordLoginResponse:
|
|
1858
|
+
return ResponseForPasswordLoginResponse.from_dict(s)
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
def response_for_password_login_response_to_dict(x: ResponseForPasswordLoginResponse) -> Any:
|
|
1862
|
+
return to_class(ResponseForPasswordLoginResponse, x)
|
|
1863
|
+
|
|
1864
|
+
|
|
1865
|
+
def password_login_response_from_dict(s: Any) -> PasswordLoginResponse:
|
|
1866
|
+
return PasswordLoginResponse.from_dict(s)
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
def password_login_response_to_dict(x: PasswordLoginResponse) -> Any:
|
|
1870
|
+
return to_class(PasswordLoginResponse, x)
|
|
1871
|
+
|
|
1872
|
+
|
|
1873
|
+
def response_for_access_token_login_response_from_dict(s: Any) -> ResponseForAccessTokenLoginResponse:
|
|
1874
|
+
return ResponseForAccessTokenLoginResponse.from_dict(s)
|
|
1875
|
+
|
|
1876
|
+
|
|
1877
|
+
def response_for_access_token_login_response_to_dict(x: ResponseForAccessTokenLoginResponse) -> Any:
|
|
1878
|
+
return to_class(ResponseForAccessTokenLoginResponse, x)
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
def access_token_login_response_from_dict(s: Any) -> AccessTokenLoginResponse:
|
|
1882
|
+
return AccessTokenLoginResponse.from_dict(s)
|
|
1883
|
+
|
|
1884
|
+
|
|
1885
|
+
def access_token_login_response_to_dict(x: AccessTokenLoginResponse) -> Any:
|
|
1886
|
+
return to_class(AccessTokenLoginResponse, x)
|
|
1887
|
+
|
|
1888
|
+
|
|
1889
|
+
def response_for_secret_identifiers_response_from_dict(s: Any) -> ResponseForSecretIdentifiersResponse:
|
|
1890
|
+
return ResponseForSecretIdentifiersResponse.from_dict(s)
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
def response_for_secret_identifiers_response_to_dict(x: ResponseForSecretIdentifiersResponse) -> Any:
|
|
1894
|
+
return to_class(ResponseForSecretIdentifiersResponse, x)
|
|
1895
|
+
|
|
1896
|
+
|
|
1897
|
+
def secret_identifiers_response_from_dict(s: Any) -> SecretIdentifiersResponse:
|
|
1898
|
+
return SecretIdentifiersResponse.from_dict(s)
|
|
1899
|
+
|
|
1900
|
+
|
|
1901
|
+
def secret_identifiers_response_to_dict(x: SecretIdentifiersResponse) -> Any:
|
|
1902
|
+
return to_class(SecretIdentifiersResponse, x)
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
def secret_identifier_response_from_dict(s: Any) -> SecretIdentifierResponse:
|
|
1906
|
+
return SecretIdentifierResponse.from_dict(s)
|
|
1907
|
+
|
|
1908
|
+
|
|
1909
|
+
def secret_identifier_response_to_dict(x: SecretIdentifierResponse) -> Any:
|
|
1910
|
+
return to_class(SecretIdentifierResponse, x)
|
|
1911
|
+
|
|
1912
|
+
|
|
1913
|
+
def response_for_secret_response_from_dict(s: Any) -> ResponseForSecretResponse:
|
|
1914
|
+
return ResponseForSecretResponse.from_dict(s)
|
|
1915
|
+
|
|
1916
|
+
|
|
1917
|
+
def response_for_secret_response_to_dict(x: ResponseForSecretResponse) -> Any:
|
|
1918
|
+
return to_class(ResponseForSecretResponse, x)
|
|
1919
|
+
|
|
1920
|
+
|
|
1921
|
+
def secret_response_from_dict(s: Any) -> SecretResponse:
|
|
1922
|
+
return SecretResponse.from_dict(s)
|
|
1923
|
+
|
|
1924
|
+
|
|
1925
|
+
def secret_response_to_dict(x: SecretResponse) -> Any:
|
|
1926
|
+
return to_class(SecretResponse, x)
|
|
1927
|
+
|
|
1928
|
+
|
|
1929
|
+
def response_for_secrets_response_from_dict(s: Any) -> ResponseForSecretsResponse:
|
|
1930
|
+
return ResponseForSecretsResponse.from_dict(s)
|
|
1931
|
+
|
|
1932
|
+
|
|
1933
|
+
def response_for_secrets_response_to_dict(x: ResponseForSecretsResponse) -> Any:
|
|
1934
|
+
return to_class(ResponseForSecretsResponse, x)
|
|
1935
|
+
|
|
1936
|
+
|
|
1937
|
+
def secrets_response_from_dict(s: Any) -> SecretsResponse:
|
|
1938
|
+
return SecretsResponse.from_dict(s)
|
|
1939
|
+
|
|
1940
|
+
|
|
1941
|
+
def secrets_response_to_dict(x: SecretsResponse) -> Any:
|
|
1942
|
+
return to_class(SecretsResponse, x)
|
|
1943
|
+
|
|
1944
|
+
|
|
1945
|
+
def response_for_secrets_delete_response_from_dict(s: Any) -> ResponseForSecretsDeleteResponse:
|
|
1946
|
+
return ResponseForSecretsDeleteResponse.from_dict(s)
|
|
1947
|
+
|
|
1948
|
+
|
|
1949
|
+
def response_for_secrets_delete_response_to_dict(x: ResponseForSecretsDeleteResponse) -> Any:
|
|
1950
|
+
return to_class(ResponseForSecretsDeleteResponse, x)
|
|
1951
|
+
|
|
1952
|
+
|
|
1953
|
+
def secrets_delete_response_from_dict(s: Any) -> SecretsDeleteResponse:
|
|
1954
|
+
return SecretsDeleteResponse.from_dict(s)
|
|
1955
|
+
|
|
1956
|
+
|
|
1957
|
+
def secrets_delete_response_to_dict(x: SecretsDeleteResponse) -> Any:
|
|
1958
|
+
return to_class(SecretsDeleteResponse, x)
|
|
1959
|
+
|
|
1960
|
+
|
|
1961
|
+
def secret_delete_response_from_dict(s: Any) -> SecretDeleteResponse:
|
|
1962
|
+
return SecretDeleteResponse.from_dict(s)
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
def secret_delete_response_to_dict(x: SecretDeleteResponse) -> Any:
|
|
1966
|
+
return to_class(SecretDeleteResponse, x)
|
|
1967
|
+
|
|
1968
|
+
|
|
1969
|
+
def response_for_secrets_sync_response_from_dict(s: Any) -> ResponseForSecretsSyncResponse:
|
|
1970
|
+
return ResponseForSecretsSyncResponse.from_dict(s)
|
|
1971
|
+
|
|
1972
|
+
|
|
1973
|
+
def response_for_secrets_sync_response_to_dict(x: ResponseForSecretsSyncResponse) -> Any:
|
|
1974
|
+
return to_class(ResponseForSecretsSyncResponse, x)
|
|
1975
|
+
|
|
1976
|
+
|
|
1977
|
+
def secrets_sync_response_from_dict(s: Any) -> SecretsSyncResponse:
|
|
1978
|
+
return SecretsSyncResponse.from_dict(s)
|
|
1979
|
+
|
|
1980
|
+
|
|
1981
|
+
def secrets_sync_response_to_dict(x: SecretsSyncResponse) -> Any:
|
|
1982
|
+
return to_class(SecretsSyncResponse, x)
|
|
1983
|
+
|
|
1984
|
+
|
|
1985
|
+
def response_for_project_response_from_dict(s: Any) -> ResponseForProjectResponse:
|
|
1986
|
+
return ResponseForProjectResponse.from_dict(s)
|
|
1987
|
+
|
|
1988
|
+
|
|
1989
|
+
def response_for_project_response_to_dict(x: ResponseForProjectResponse) -> Any:
|
|
1990
|
+
return to_class(ResponseForProjectResponse, x)
|
|
1991
|
+
|
|
1992
|
+
|
|
1993
|
+
def project_response_from_dict(s: Any) -> ProjectResponse:
|
|
1994
|
+
return ProjectResponse.from_dict(s)
|
|
1995
|
+
|
|
1996
|
+
|
|
1997
|
+
def project_response_to_dict(x: ProjectResponse) -> Any:
|
|
1998
|
+
return to_class(ProjectResponse, x)
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
def response_for_projects_response_from_dict(s: Any) -> ResponseForProjectsResponse:
|
|
2002
|
+
return ResponseForProjectsResponse.from_dict(s)
|
|
2003
|
+
|
|
2004
|
+
|
|
2005
|
+
def response_for_projects_response_to_dict(x: ResponseForProjectsResponse) -> Any:
|
|
2006
|
+
return to_class(ResponseForProjectsResponse, x)
|
|
2007
|
+
|
|
2008
|
+
|
|
2009
|
+
def projects_response_from_dict(s: Any) -> ProjectsResponse:
|
|
2010
|
+
return ProjectsResponse.from_dict(s)
|
|
2011
|
+
|
|
2012
|
+
|
|
2013
|
+
def projects_response_to_dict(x: ProjectsResponse) -> Any:
|
|
2014
|
+
return to_class(ProjectsResponse, x)
|
|
2015
|
+
|
|
2016
|
+
|
|
2017
|
+
def response_for_projects_delete_response_from_dict(s: Any) -> ResponseForProjectsDeleteResponse:
|
|
2018
|
+
return ResponseForProjectsDeleteResponse.from_dict(s)
|
|
2019
|
+
|
|
2020
|
+
|
|
2021
|
+
def response_for_projects_delete_response_to_dict(x: ResponseForProjectsDeleteResponse) -> Any:
|
|
2022
|
+
return to_class(ResponseForProjectsDeleteResponse, x)
|
|
2023
|
+
|
|
2024
|
+
|
|
2025
|
+
def projects_delete_response_from_dict(s: Any) -> ProjectsDeleteResponse:
|
|
2026
|
+
return ProjectsDeleteResponse.from_dict(s)
|
|
2027
|
+
|
|
2028
|
+
|
|
2029
|
+
def projects_delete_response_to_dict(x: ProjectsDeleteResponse) -> Any:
|
|
2030
|
+
return to_class(ProjectsDeleteResponse, x)
|
|
2031
|
+
|
|
2032
|
+
|
|
2033
|
+
def project_delete_response_from_dict(s: Any) -> ProjectDeleteResponse:
|
|
2034
|
+
return ProjectDeleteResponse.from_dict(s)
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
def project_delete_response_to_dict(x: ProjectDeleteResponse) -> Any:
|
|
2038
|
+
return to_class(ProjectDeleteResponse, x)
|
|
2039
|
+
|
|
2040
|
+
|
|
2041
|
+
def response_for_string_from_dict(s: Any) -> ResponseForString:
|
|
2042
|
+
return ResponseForString.from_dict(s)
|
|
2043
|
+
|
|
2044
|
+
|
|
2045
|
+
def response_for_string_to_dict(x: ResponseForString) -> Any:
|
|
2046
|
+
return to_class(ResponseForString, x)
|
|
2047
|
+
|