blaxel 0.1.10rc39__py3-none-any.whl → 0.1.10rc40__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.
- blaxel/client/api/compute/create_sandbox_preview.py +179 -0
- blaxel/client/api/compute/create_sandbox_preview_token.py +192 -0
- blaxel/client/api/compute/delete_sandbox_preview.py +167 -0
- blaxel/client/api/compute/delete_sandbox_preview_token.py +180 -0
- blaxel/client/api/compute/get_sandbox_preview.py +167 -0
- blaxel/client/api/compute/list_sandbox_preview_tokens.py +172 -0
- blaxel/client/api/compute/list_sandbox_previews.py +159 -0
- blaxel/client/api/compute/update_sandbox_preview.py +192 -0
- blaxel/client/api/integrations/get_integration.py +64 -7
- blaxel/client/api/workspaces/check_workspace_availability.py +165 -0
- blaxel/client/models/__init__.py +32 -2
- blaxel/client/models/check_workspace_availability_body.py +60 -0
- blaxel/client/models/delete_sandbox_preview_token_response_200.py +60 -0
- blaxel/client/models/integration.py +197 -0
- blaxel/client/models/integration_additional_infos.py +45 -0
- blaxel/client/models/integration_endpoint.py +143 -0
- blaxel/client/models/integration_endpoint_token.py +79 -0
- blaxel/client/models/integration_endpoints.py +61 -0
- blaxel/client/models/integration_headers.py +45 -0
- blaxel/client/models/integration_organization.py +88 -0
- blaxel/client/models/integration_query_params.py +45 -0
- blaxel/client/models/metrics.py +9 -0
- blaxel/client/models/preview.py +96 -0
- blaxel/client/models/preview_metadata.py +133 -0
- blaxel/client/models/preview_spec.py +79 -0
- blaxel/client/models/preview_token.py +96 -0
- blaxel/client/models/preview_token_metadata.py +97 -0
- blaxel/client/models/preview_token_spec.py +88 -0
- blaxel/sandbox/client/api/process/get_process_identifier_logs.py +22 -1
- blaxel/sandbox/client/api/process/get_process_identifier_logs_stream.py +190 -0
- blaxel/sandbox/client/models/__init__.py +6 -0
- blaxel/sandbox/client/models/directory.py +5 -3
- blaxel/sandbox/client/models/file.py +1 -1
- blaxel/sandbox/client/models/file_with_content.py +1 -1
- blaxel/sandbox/client/models/get_process_identifier_logs_stream_response_200.py +45 -0
- blaxel/sandbox/client/models/subdirectory.py +60 -0
- {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc40.dist-info}/METADATA +1 -1
- {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc40.dist-info}/RECORD +40 -13
- blaxel/client/models/sandboxes.py +0 -129
- {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc40.dist-info}/WHEEL +0 -0
- {blaxel-0.1.10rc39.dist-info → blaxel-0.1.10rc40.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="IntegrationQueryParams")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class IntegrationQueryParams:
|
11
|
+
"""Integration query params"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
integration_query_params = cls()
|
27
|
+
|
28
|
+
integration_query_params.additional_properties = d
|
29
|
+
return integration_query_params
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> str:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: str) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
blaxel/client/models/metrics.py
CHANGED
@@ -31,6 +31,7 @@ class Metrics:
|
|
31
31
|
rps (Union[Unset, float]): Number of requests per second for all resources globally
|
32
32
|
rps_per_code (Union[Unset, MetricsRpsPerCode]): Number of requests per second for all resources globally per
|
33
33
|
code
|
34
|
+
sandboxes (Union[Unset, Any]): Metrics for sandboxes
|
34
35
|
"""
|
35
36
|
|
36
37
|
agents: Union[Unset, Any] = UNSET
|
@@ -43,6 +44,7 @@ class Metrics:
|
|
43
44
|
request_total_per_code: Union[Unset, "MetricsRequestTotalPerCode"] = UNSET
|
44
45
|
rps: Union[Unset, float] = UNSET
|
45
46
|
rps_per_code: Union[Unset, "MetricsRpsPerCode"] = UNSET
|
47
|
+
sandboxes: Union[Unset, Any] = UNSET
|
46
48
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
47
49
|
|
48
50
|
def to_dict(self) -> dict[str, Any]:
|
@@ -86,6 +88,8 @@ class Metrics:
|
|
86
88
|
elif self.rps_per_code and isinstance(self.rps_per_code, dict):
|
87
89
|
rps_per_code = self.rps_per_code
|
88
90
|
|
91
|
+
sandboxes = self.sandboxes
|
92
|
+
|
89
93
|
field_dict: dict[str, Any] = {}
|
90
94
|
field_dict.update(self.additional_properties)
|
91
95
|
field_dict.update({})
|
@@ -109,6 +113,8 @@ class Metrics:
|
|
109
113
|
field_dict["rps"] = rps
|
110
114
|
if rps_per_code is not UNSET:
|
111
115
|
field_dict["rpsPerCode"] = rps_per_code
|
116
|
+
if sandboxes is not UNSET:
|
117
|
+
field_dict["sandboxes"] = sandboxes
|
112
118
|
|
113
119
|
return field_dict
|
114
120
|
|
@@ -156,6 +162,8 @@ class Metrics:
|
|
156
162
|
else:
|
157
163
|
rps_per_code = MetricsRpsPerCode.from_dict(_rps_per_code)
|
158
164
|
|
165
|
+
sandboxes = d.pop("sandboxes", UNSET)
|
166
|
+
|
159
167
|
metrics = cls(
|
160
168
|
agents=agents,
|
161
169
|
functions=functions,
|
@@ -167,6 +175,7 @@ class Metrics:
|
|
167
175
|
request_total_per_code=request_total_per_code,
|
168
176
|
rps=rps,
|
169
177
|
rps_per_code=rps_per_code,
|
178
|
+
sandboxes=sandboxes,
|
170
179
|
)
|
171
180
|
|
172
181
|
metrics.additional_properties = d
|
@@ -0,0 +1,96 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.preview_metadata import PreviewMetadata
|
10
|
+
from ..models.preview_spec import PreviewSpec
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="Preview")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class Preview:
|
18
|
+
"""Preview of a Resource
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
metadata (Union[Unset, PreviewMetadata]): PreviewMetadata
|
22
|
+
spec (Union[Unset, PreviewSpec]): Preview of a Resource
|
23
|
+
"""
|
24
|
+
|
25
|
+
metadata: Union[Unset, "PreviewMetadata"] = UNSET
|
26
|
+
spec: Union[Unset, "PreviewSpec"] = UNSET
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
28
|
+
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
30
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
31
|
+
if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
|
32
|
+
metadata = self.metadata.to_dict()
|
33
|
+
elif self.metadata and isinstance(self.metadata, dict):
|
34
|
+
metadata = self.metadata
|
35
|
+
|
36
|
+
spec: Union[Unset, dict[str, Any]] = UNSET
|
37
|
+
if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
|
38
|
+
spec = self.spec.to_dict()
|
39
|
+
elif self.spec and isinstance(self.spec, dict):
|
40
|
+
spec = self.spec
|
41
|
+
|
42
|
+
field_dict: dict[str, Any] = {}
|
43
|
+
field_dict.update(self.additional_properties)
|
44
|
+
field_dict.update({})
|
45
|
+
if metadata is not UNSET:
|
46
|
+
field_dict["metadata"] = metadata
|
47
|
+
if spec is not UNSET:
|
48
|
+
field_dict["spec"] = spec
|
49
|
+
|
50
|
+
return field_dict
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
54
|
+
from ..models.preview_metadata import PreviewMetadata
|
55
|
+
from ..models.preview_spec import PreviewSpec
|
56
|
+
|
57
|
+
if not src_dict:
|
58
|
+
return None
|
59
|
+
d = src_dict.copy()
|
60
|
+
_metadata = d.pop("metadata", UNSET)
|
61
|
+
metadata: Union[Unset, PreviewMetadata]
|
62
|
+
if isinstance(_metadata, Unset):
|
63
|
+
metadata = UNSET
|
64
|
+
else:
|
65
|
+
metadata = PreviewMetadata.from_dict(_metadata)
|
66
|
+
|
67
|
+
_spec = d.pop("spec", UNSET)
|
68
|
+
spec: Union[Unset, PreviewSpec]
|
69
|
+
if isinstance(_spec, Unset):
|
70
|
+
spec = UNSET
|
71
|
+
else:
|
72
|
+
spec = PreviewSpec.from_dict(_spec)
|
73
|
+
|
74
|
+
preview = cls(
|
75
|
+
metadata=metadata,
|
76
|
+
spec=spec,
|
77
|
+
)
|
78
|
+
|
79
|
+
preview.additional_properties = d
|
80
|
+
return preview
|
81
|
+
|
82
|
+
@property
|
83
|
+
def additional_keys(self) -> list[str]:
|
84
|
+
return list(self.additional_properties.keys())
|
85
|
+
|
86
|
+
def __getitem__(self, key: str) -> Any:
|
87
|
+
return self.additional_properties[key]
|
88
|
+
|
89
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
90
|
+
self.additional_properties[key] = value
|
91
|
+
|
92
|
+
def __delitem__(self, key: str) -> None:
|
93
|
+
del self.additional_properties[key]
|
94
|
+
|
95
|
+
def __contains__(self, key: str) -> bool:
|
96
|
+
return key in self.additional_properties
|
@@ -0,0 +1,133 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="PreviewMetadata")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class PreviewMetadata:
|
13
|
+
"""PreviewMetadata
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
17
|
+
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
18
|
+
created_by (Union[Unset, str]): The user or service account who created the resource
|
19
|
+
updated_by (Union[Unset, str]): The user or service account who updated the resource
|
20
|
+
display_name (Union[Unset, str]): Model display name
|
21
|
+
name (Union[Unset, str]): Preview name
|
22
|
+
resource_name (Union[Unset, str]): Resource name
|
23
|
+
resource_type (Union[Unset, str]): Resource type
|
24
|
+
workspace (Union[Unset, str]): Workspace name
|
25
|
+
"""
|
26
|
+
|
27
|
+
created_at: Union[Unset, str] = UNSET
|
28
|
+
updated_at: Union[Unset, str] = UNSET
|
29
|
+
created_by: Union[Unset, str] = UNSET
|
30
|
+
updated_by: Union[Unset, str] = UNSET
|
31
|
+
display_name: Union[Unset, str] = UNSET
|
32
|
+
name: Union[Unset, str] = UNSET
|
33
|
+
resource_name: Union[Unset, str] = UNSET
|
34
|
+
resource_type: Union[Unset, str] = UNSET
|
35
|
+
workspace: Union[Unset, str] = UNSET
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
37
|
+
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
39
|
+
created_at = self.created_at
|
40
|
+
|
41
|
+
updated_at = self.updated_at
|
42
|
+
|
43
|
+
created_by = self.created_by
|
44
|
+
|
45
|
+
updated_by = self.updated_by
|
46
|
+
|
47
|
+
display_name = self.display_name
|
48
|
+
|
49
|
+
name = self.name
|
50
|
+
|
51
|
+
resource_name = self.resource_name
|
52
|
+
|
53
|
+
resource_type = self.resource_type
|
54
|
+
|
55
|
+
workspace = self.workspace
|
56
|
+
|
57
|
+
field_dict: dict[str, Any] = {}
|
58
|
+
field_dict.update(self.additional_properties)
|
59
|
+
field_dict.update({})
|
60
|
+
if created_at is not UNSET:
|
61
|
+
field_dict["createdAt"] = created_at
|
62
|
+
if updated_at is not UNSET:
|
63
|
+
field_dict["updatedAt"] = updated_at
|
64
|
+
if created_by is not UNSET:
|
65
|
+
field_dict["createdBy"] = created_by
|
66
|
+
if updated_by is not UNSET:
|
67
|
+
field_dict["updatedBy"] = updated_by
|
68
|
+
if display_name is not UNSET:
|
69
|
+
field_dict["displayName"] = display_name
|
70
|
+
if name is not UNSET:
|
71
|
+
field_dict["name"] = name
|
72
|
+
if resource_name is not UNSET:
|
73
|
+
field_dict["resourceName"] = resource_name
|
74
|
+
if resource_type is not UNSET:
|
75
|
+
field_dict["resourceType"] = resource_type
|
76
|
+
if workspace is not UNSET:
|
77
|
+
field_dict["workspace"] = workspace
|
78
|
+
|
79
|
+
return field_dict
|
80
|
+
|
81
|
+
@classmethod
|
82
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
83
|
+
if not src_dict:
|
84
|
+
return None
|
85
|
+
d = src_dict.copy()
|
86
|
+
created_at = d.pop("createdAt", UNSET)
|
87
|
+
|
88
|
+
updated_at = d.pop("updatedAt", UNSET)
|
89
|
+
|
90
|
+
created_by = d.pop("createdBy", UNSET)
|
91
|
+
|
92
|
+
updated_by = d.pop("updatedBy", UNSET)
|
93
|
+
|
94
|
+
display_name = d.pop("displayName", UNSET)
|
95
|
+
|
96
|
+
name = d.pop("name", UNSET)
|
97
|
+
|
98
|
+
resource_name = d.pop("resourceName", UNSET)
|
99
|
+
|
100
|
+
resource_type = d.pop("resourceType", UNSET)
|
101
|
+
|
102
|
+
workspace = d.pop("workspace", UNSET)
|
103
|
+
|
104
|
+
preview_metadata = cls(
|
105
|
+
created_at=created_at,
|
106
|
+
updated_at=updated_at,
|
107
|
+
created_by=created_by,
|
108
|
+
updated_by=updated_by,
|
109
|
+
display_name=display_name,
|
110
|
+
name=name,
|
111
|
+
resource_name=resource_name,
|
112
|
+
resource_type=resource_type,
|
113
|
+
workspace=workspace,
|
114
|
+
)
|
115
|
+
|
116
|
+
preview_metadata.additional_properties = d
|
117
|
+
return preview_metadata
|
118
|
+
|
119
|
+
@property
|
120
|
+
def additional_keys(self) -> list[str]:
|
121
|
+
return list(self.additional_properties.keys())
|
122
|
+
|
123
|
+
def __getitem__(self, key: str) -> Any:
|
124
|
+
return self.additional_properties[key]
|
125
|
+
|
126
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
127
|
+
self.additional_properties[key] = value
|
128
|
+
|
129
|
+
def __delitem__(self, key: str) -> None:
|
130
|
+
del self.additional_properties[key]
|
131
|
+
|
132
|
+
def __contains__(self, key: str) -> bool:
|
133
|
+
return key in self.additional_properties
|
@@ -0,0 +1,79 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="PreviewSpec")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class PreviewSpec:
|
13
|
+
"""Preview of a Resource
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
port (Union[Unset, int]): Port of the preview
|
17
|
+
public (Union[Unset, bool]): Whether the preview is public
|
18
|
+
url (Union[Unset, str]): URL of the preview
|
19
|
+
"""
|
20
|
+
|
21
|
+
port: Union[Unset, int] = UNSET
|
22
|
+
public: Union[Unset, bool] = UNSET
|
23
|
+
url: Union[Unset, str] = UNSET
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
25
|
+
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
27
|
+
port = self.port
|
28
|
+
|
29
|
+
public = self.public
|
30
|
+
|
31
|
+
url = self.url
|
32
|
+
|
33
|
+
field_dict: dict[str, Any] = {}
|
34
|
+
field_dict.update(self.additional_properties)
|
35
|
+
field_dict.update({})
|
36
|
+
if port is not UNSET:
|
37
|
+
field_dict["port"] = port
|
38
|
+
if public is not UNSET:
|
39
|
+
field_dict["public"] = public
|
40
|
+
if url is not UNSET:
|
41
|
+
field_dict["url"] = url
|
42
|
+
|
43
|
+
return field_dict
|
44
|
+
|
45
|
+
@classmethod
|
46
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
47
|
+
if not src_dict:
|
48
|
+
return None
|
49
|
+
d = src_dict.copy()
|
50
|
+
port = d.pop("port", UNSET)
|
51
|
+
|
52
|
+
public = d.pop("public", UNSET)
|
53
|
+
|
54
|
+
url = d.pop("url", UNSET)
|
55
|
+
|
56
|
+
preview_spec = cls(
|
57
|
+
port=port,
|
58
|
+
public=public,
|
59
|
+
url=url,
|
60
|
+
)
|
61
|
+
|
62
|
+
preview_spec.additional_properties = d
|
63
|
+
return preview_spec
|
64
|
+
|
65
|
+
@property
|
66
|
+
def additional_keys(self) -> list[str]:
|
67
|
+
return list(self.additional_properties.keys())
|
68
|
+
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
70
|
+
return self.additional_properties[key]
|
71
|
+
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
73
|
+
self.additional_properties[key] = value
|
74
|
+
|
75
|
+
def __delitem__(self, key: str) -> None:
|
76
|
+
del self.additional_properties[key]
|
77
|
+
|
78
|
+
def __contains__(self, key: str) -> bool:
|
79
|
+
return key in self.additional_properties
|
@@ -0,0 +1,96 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.preview_token_metadata import PreviewTokenMetadata
|
10
|
+
from ..models.preview_token_spec import PreviewTokenSpec
|
11
|
+
|
12
|
+
|
13
|
+
T = TypeVar("T", bound="PreviewToken")
|
14
|
+
|
15
|
+
|
16
|
+
@_attrs_define
|
17
|
+
class PreviewToken:
|
18
|
+
"""Token for a Preview
|
19
|
+
|
20
|
+
Attributes:
|
21
|
+
metadata (Union[Unset, PreviewTokenMetadata]): PreviewTokenMetadata
|
22
|
+
spec (Union[Unset, PreviewTokenSpec]): Spec for a Preview Token
|
23
|
+
"""
|
24
|
+
|
25
|
+
metadata: Union[Unset, "PreviewTokenMetadata"] = UNSET
|
26
|
+
spec: Union[Unset, "PreviewTokenSpec"] = UNSET
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
28
|
+
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
30
|
+
metadata: Union[Unset, dict[str, Any]] = UNSET
|
31
|
+
if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
|
32
|
+
metadata = self.metadata.to_dict()
|
33
|
+
elif self.metadata and isinstance(self.metadata, dict):
|
34
|
+
metadata = self.metadata
|
35
|
+
|
36
|
+
spec: Union[Unset, dict[str, Any]] = UNSET
|
37
|
+
if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
|
38
|
+
spec = self.spec.to_dict()
|
39
|
+
elif self.spec and isinstance(self.spec, dict):
|
40
|
+
spec = self.spec
|
41
|
+
|
42
|
+
field_dict: dict[str, Any] = {}
|
43
|
+
field_dict.update(self.additional_properties)
|
44
|
+
field_dict.update({})
|
45
|
+
if metadata is not UNSET:
|
46
|
+
field_dict["metadata"] = metadata
|
47
|
+
if spec is not UNSET:
|
48
|
+
field_dict["spec"] = spec
|
49
|
+
|
50
|
+
return field_dict
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
54
|
+
from ..models.preview_token_metadata import PreviewTokenMetadata
|
55
|
+
from ..models.preview_token_spec import PreviewTokenSpec
|
56
|
+
|
57
|
+
if not src_dict:
|
58
|
+
return None
|
59
|
+
d = src_dict.copy()
|
60
|
+
_metadata = d.pop("metadata", UNSET)
|
61
|
+
metadata: Union[Unset, PreviewTokenMetadata]
|
62
|
+
if isinstance(_metadata, Unset):
|
63
|
+
metadata = UNSET
|
64
|
+
else:
|
65
|
+
metadata = PreviewTokenMetadata.from_dict(_metadata)
|
66
|
+
|
67
|
+
_spec = d.pop("spec", UNSET)
|
68
|
+
spec: Union[Unset, PreviewTokenSpec]
|
69
|
+
if isinstance(_spec, Unset):
|
70
|
+
spec = UNSET
|
71
|
+
else:
|
72
|
+
spec = PreviewTokenSpec.from_dict(_spec)
|
73
|
+
|
74
|
+
preview_token = cls(
|
75
|
+
metadata=metadata,
|
76
|
+
spec=spec,
|
77
|
+
)
|
78
|
+
|
79
|
+
preview_token.additional_properties = d
|
80
|
+
return preview_token
|
81
|
+
|
82
|
+
@property
|
83
|
+
def additional_keys(self) -> list[str]:
|
84
|
+
return list(self.additional_properties.keys())
|
85
|
+
|
86
|
+
def __getitem__(self, key: str) -> Any:
|
87
|
+
return self.additional_properties[key]
|
88
|
+
|
89
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
90
|
+
self.additional_properties[key] = value
|
91
|
+
|
92
|
+
def __delitem__(self, key: str) -> None:
|
93
|
+
del self.additional_properties[key]
|
94
|
+
|
95
|
+
def __contains__(self, key: str) -> bool:
|
96
|
+
return key in self.additional_properties
|
@@ -0,0 +1,97 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="PreviewTokenMetadata")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class PreviewTokenMetadata:
|
13
|
+
"""PreviewTokenMetadata
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
name (Union[Unset, str]): Token name
|
17
|
+
preview_name (Union[Unset, str]): Preview name
|
18
|
+
resource_name (Union[Unset, str]): Resource name
|
19
|
+
resource_type (Union[Unset, str]): Resource type
|
20
|
+
workspace (Union[Unset, str]): Workspace name
|
21
|
+
"""
|
22
|
+
|
23
|
+
name: Union[Unset, str] = UNSET
|
24
|
+
preview_name: Union[Unset, str] = UNSET
|
25
|
+
resource_name: Union[Unset, str] = UNSET
|
26
|
+
resource_type: Union[Unset, str] = UNSET
|
27
|
+
workspace: Union[Unset, str] = UNSET
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
|
+
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
31
|
+
name = self.name
|
32
|
+
|
33
|
+
preview_name = self.preview_name
|
34
|
+
|
35
|
+
resource_name = self.resource_name
|
36
|
+
|
37
|
+
resource_type = self.resource_type
|
38
|
+
|
39
|
+
workspace = self.workspace
|
40
|
+
|
41
|
+
field_dict: dict[str, Any] = {}
|
42
|
+
field_dict.update(self.additional_properties)
|
43
|
+
field_dict.update({})
|
44
|
+
if name is not UNSET:
|
45
|
+
field_dict["name"] = name
|
46
|
+
if preview_name is not UNSET:
|
47
|
+
field_dict["previewName"] = preview_name
|
48
|
+
if resource_name is not UNSET:
|
49
|
+
field_dict["resourceName"] = resource_name
|
50
|
+
if resource_type is not UNSET:
|
51
|
+
field_dict["resourceType"] = resource_type
|
52
|
+
if workspace is not UNSET:
|
53
|
+
field_dict["workspace"] = workspace
|
54
|
+
|
55
|
+
return field_dict
|
56
|
+
|
57
|
+
@classmethod
|
58
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
59
|
+
if not src_dict:
|
60
|
+
return None
|
61
|
+
d = src_dict.copy()
|
62
|
+
name = d.pop("name", UNSET)
|
63
|
+
|
64
|
+
preview_name = d.pop("previewName", UNSET)
|
65
|
+
|
66
|
+
resource_name = d.pop("resourceName", UNSET)
|
67
|
+
|
68
|
+
resource_type = d.pop("resourceType", UNSET)
|
69
|
+
|
70
|
+
workspace = d.pop("workspace", UNSET)
|
71
|
+
|
72
|
+
preview_token_metadata = cls(
|
73
|
+
name=name,
|
74
|
+
preview_name=preview_name,
|
75
|
+
resource_name=resource_name,
|
76
|
+
resource_type=resource_type,
|
77
|
+
workspace=workspace,
|
78
|
+
)
|
79
|
+
|
80
|
+
preview_token_metadata.additional_properties = d
|
81
|
+
return preview_token_metadata
|
82
|
+
|
83
|
+
@property
|
84
|
+
def additional_keys(self) -> list[str]:
|
85
|
+
return list(self.additional_properties.keys())
|
86
|
+
|
87
|
+
def __getitem__(self, key: str) -> Any:
|
88
|
+
return self.additional_properties[key]
|
89
|
+
|
90
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
91
|
+
self.additional_properties[key] = value
|
92
|
+
|
93
|
+
def __delitem__(self, key: str) -> None:
|
94
|
+
del self.additional_properties[key]
|
95
|
+
|
96
|
+
def __contains__(self, key: str) -> bool:
|
97
|
+
return key in self.additional_properties
|
@@ -0,0 +1,88 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="PreviewTokenSpec")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class PreviewTokenSpec:
|
13
|
+
"""Spec for a Preview Token
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
expired (Union[Unset, bool]): Whether the token is expired
|
17
|
+
expires_at (Union[Unset, str]): Expiration time of the token
|
18
|
+
public (Union[Unset, bool]): Whether the token is public
|
19
|
+
token (Union[Unset, str]): Token
|
20
|
+
"""
|
21
|
+
|
22
|
+
expired: Union[Unset, bool] = UNSET
|
23
|
+
expires_at: Union[Unset, str] = UNSET
|
24
|
+
public: Union[Unset, bool] = UNSET
|
25
|
+
token: Union[Unset, str] = UNSET
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
|
+
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
29
|
+
expired = self.expired
|
30
|
+
|
31
|
+
expires_at = self.expires_at
|
32
|
+
|
33
|
+
public = self.public
|
34
|
+
|
35
|
+
token = self.token
|
36
|
+
|
37
|
+
field_dict: dict[str, Any] = {}
|
38
|
+
field_dict.update(self.additional_properties)
|
39
|
+
field_dict.update({})
|
40
|
+
if expired is not UNSET:
|
41
|
+
field_dict["expired"] = expired
|
42
|
+
if expires_at is not UNSET:
|
43
|
+
field_dict["expiresAt"] = expires_at
|
44
|
+
if public is not UNSET:
|
45
|
+
field_dict["public"] = public
|
46
|
+
if token is not UNSET:
|
47
|
+
field_dict["token"] = token
|
48
|
+
|
49
|
+
return field_dict
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
53
|
+
if not src_dict:
|
54
|
+
return None
|
55
|
+
d = src_dict.copy()
|
56
|
+
expired = d.pop("expired", UNSET)
|
57
|
+
|
58
|
+
expires_at = d.pop("expiresAt", UNSET)
|
59
|
+
|
60
|
+
public = d.pop("public", UNSET)
|
61
|
+
|
62
|
+
token = d.pop("token", UNSET)
|
63
|
+
|
64
|
+
preview_token_spec = cls(
|
65
|
+
expired=expired,
|
66
|
+
expires_at=expires_at,
|
67
|
+
public=public,
|
68
|
+
token=token,
|
69
|
+
)
|
70
|
+
|
71
|
+
preview_token_spec.additional_properties = d
|
72
|
+
return preview_token_spec
|
73
|
+
|
74
|
+
@property
|
75
|
+
def additional_keys(self) -> list[str]:
|
76
|
+
return list(self.additional_properties.keys())
|
77
|
+
|
78
|
+
def __getitem__(self, key: str) -> Any:
|
79
|
+
return self.additional_properties[key]
|
80
|
+
|
81
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
82
|
+
self.additional_properties[key] = value
|
83
|
+
|
84
|
+
def __delitem__(self, key: str) -> None:
|
85
|
+
del self.additional_properties[key]
|
86
|
+
|
87
|
+
def __contains__(self, key: str) -> bool:
|
88
|
+
return key in self.additional_properties
|