-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathlock.py
More file actions
47 lines (32 loc) · 964 Bytes
/
lock.py
File metadata and controls
47 lines (32 loc) · 964 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
39
40
41
42
43
44
45
46
47
from dataclasses import dataclass
from linode_api4.objects.base import Base, Property
from linode_api4.objects.serializable import JSONObject, StrEnum
__all__ = ["LockType", "LockEntity", "Lock"]
class LockType(StrEnum):
"""
LockType defines valid values for resource lock types.
API Documentation: TBD
"""
cannot_delete = "cannot_delete"
cannot_delete_with_subresources = "cannot_delete_with_subresources"
@dataclass
class LockEntity(JSONObject):
"""
Represents the entity that is locked.
API Documentation: TBD
"""
id: int = 0
type: str = ""
label: str = ""
url: str = ""
class Lock(Base):
"""
A resource lock that prevents deletion or modification of a resource.
API Documentation: TBD
"""
api_endpoint = "/locks/{id}"
properties = {
"id": Property(identifier=True),
"lock_type": Property(),
"entity": Property(json_object=LockEntity),
}