20
20
from pydantic import BaseModel , ConfigDict , Field , StrictBool , StrictStr
21
21
from typing_extensions import Annotated , Self
22
22
23
+ from stackit .kms .models .access_scope import AccessScope
23
24
from stackit .kms .models .algorithm import Algorithm
24
25
from stackit .kms .models .backend import Backend
26
+ from stackit .kms .models .protection import Protection
25
27
from stackit .kms .models .purpose import Purpose
26
28
27
29
@@ -30,6 +32,7 @@ class CreateKeyPayload(BaseModel):
30
32
CreateKeyPayload
31
33
""" # noqa: E501
32
34
35
+ access_scope : Optional [AccessScope ] = AccessScope .PUBLIC
33
36
algorithm : Algorithm
34
37
backend : Backend
35
38
description : Optional [StrictStr ] = Field (
@@ -41,8 +44,18 @@ class CreateKeyPayload(BaseModel):
41
44
import_only : Optional [StrictBool ] = Field (
42
45
default = False , description = "States whether versions can be created or only imported." , alias = "importOnly"
43
46
)
47
+ protection : Optional [Protection ] = None
44
48
purpose : Purpose
45
- __properties : ClassVar [List [str ]] = ["algorithm" , "backend" , "description" , "displayName" , "importOnly" , "purpose" ]
49
+ __properties : ClassVar [List [str ]] = [
50
+ "access_scope" ,
51
+ "algorithm" ,
52
+ "backend" ,
53
+ "description" ,
54
+ "displayName" ,
55
+ "importOnly" ,
56
+ "protection" ,
57
+ "purpose" ,
58
+ ]
46
59
47
60
model_config = ConfigDict (
48
61
populate_by_name = True ,
@@ -94,11 +107,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
107
95
108
_obj = cls .model_validate (
96
109
{
110
+ "access_scope" : obj .get ("access_scope" ) if obj .get ("access_scope" ) is not None else AccessScope .PUBLIC ,
97
111
"algorithm" : obj .get ("algorithm" ),
98
112
"backend" : obj .get ("backend" ),
99
113
"description" : obj .get ("description" ),
100
114
"displayName" : obj .get ("displayName" ),
101
115
"importOnly" : obj .get ("importOnly" ) if obj .get ("importOnly" ) is not None else False ,
116
+ "protection" : obj .get ("protection" ),
102
117
"purpose" : obj .get ("purpose" ),
103
118
}
104
119
)
0 commit comments