2020from pydantic import BaseModel , ConfigDict , Field , StrictBool , StrictStr
2121from typing_extensions import Annotated , Self
2222
23+ from stackit .kms .models .access_scope import AccessScope
2324from stackit .kms .models .algorithm import Algorithm
2425from stackit .kms .models .backend import Backend
26+ from stackit .kms .models .protection import Protection
2527from stackit .kms .models .purpose import Purpose
2628
2729
@@ -30,6 +32,7 @@ class CreateKeyPayload(BaseModel):
3032 CreateKeyPayload
3133 """ # noqa: E501
3234
35+ access_scope : Optional [AccessScope ] = AccessScope .PUBLIC
3336 algorithm : Algorithm
3437 backend : Backend
3538 description : Optional [StrictStr ] = Field (
@@ -41,8 +44,18 @@ class CreateKeyPayload(BaseModel):
4144 import_only : Optional [StrictBool ] = Field (
4245 default = False , description = "States whether versions can be created or only imported." , alias = "importOnly"
4346 )
47+ protection : Optional [Protection ] = None
4448 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+ ]
4659
4760 model_config = ConfigDict (
4861 populate_by_name = True ,
@@ -94,11 +107,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94107
95108 _obj = cls .model_validate (
96109 {
110+ "access_scope" : obj .get ("access_scope" ) if obj .get ("access_scope" ) is not None else AccessScope .PUBLIC ,
97111 "algorithm" : obj .get ("algorithm" ),
98112 "backend" : obj .get ("backend" ),
99113 "description" : obj .get ("description" ),
100114 "displayName" : obj .get ("displayName" ),
101115 "importOnly" : obj .get ("importOnly" ) if obj .get ("importOnly" ) is not None else False ,
116+ "protection" : obj .get ("protection" ),
102117 "purpose" : obj .get ("purpose" ),
103118 }
104119 )
0 commit comments