Skip to content

Commit 07b15f0

Browse files
Generate objectstorage
1 parent c2204fd commit 07b15f0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

services/objectstorage/src/stackit/objectstorage/models/create_access_key_response.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CreateAccessKeyResponse(BaseModel):
2828

2929
access_key: StrictStr = Field(description="Access key", alias="accessKey")
3030
display_name: StrictStr = Field(description="Obfuscated access key", alias="displayName")
31-
expires: StrictStr = Field(description="Expiration date. Null means never expires.")
31+
expires: Optional[StrictStr] = Field(description="Expiration date. Null means never expires.")
3232
key_id: StrictStr = Field(
3333
description="Identifies the pair of access key and secret access key for deletion", alias="keyId"
3434
)
@@ -73,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]:
7373
exclude=excluded_fields,
7474
exclude_none=True,
7575
)
76+
# set to None if expires (nullable) is None
77+
# and model_fields_set contains the field
78+
if self.expires is None and "expires" in self.model_fields_set:
79+
_dict["expires"] = None
80+
7681
return _dict
7782

7883
@classmethod

0 commit comments

Comments
 (0)