-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathlifecycle.py
More file actions
38 lines (26 loc) · 985 Bytes
/
lifecycle.py
File metadata and controls
38 lines (26 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from dataclasses import dataclass
from typing import TYPE_CHECKING, TypedDict
from databricks.bundles.core._transform import _transform
from databricks.bundles.core._transform_to_json import _transform_to_json_value
from databricks.bundles.core._variable import VariableOrOptional
if TYPE_CHECKING:
from typing_extensions import Self
@dataclass(kw_only=True)
class Lifecycle:
""""""
prevent_destroy: VariableOrOptional[bool] = None
"""
Lifecycle setting to prevent the resource from being destroyed.
"""
@classmethod
def from_dict(cls, value: "LifecycleDict") -> "Self":
return _transform(cls, value)
def as_dict(self) -> "LifecycleDict":
return _transform_to_json_value(self) # type:ignore
class LifecycleDict(TypedDict, total=False):
""""""
prevent_destroy: VariableOrOptional[bool]
"""
Lifecycle setting to prevent the resource from being destroyed.
"""
LifecycleParam = LifecycleDict | Lifecycle