From 3c3b40e741b48ba6b79f4cc080ee47e13ffd6368 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 7 Aug 2025 11:22:37 +0000 Subject: [PATCH] Generate serviceaccount --- .../create_service_account_key_payload.py | 22 ++++++++++++++++--- .../create_service_account_key_response.py | 4 ++-- .../get_service_account_key_response.py | 4 ++-- ...ial_update_service_account_key_response.py | 4 ++-- .../service_account_key_list_response.py | 4 ++-- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py index e40ed290f..ab577b157 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_payload.py @@ -18,7 +18,7 @@ from datetime import datetime from typing import Any, ClassVar, Dict, List, Optional, Set -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing_extensions import Self @@ -27,6 +27,10 @@ class CreateServiceAccountKeyPayload(BaseModel): CreateServiceAccountKeyPayload """ # noqa: E501 + algorithm: Optional[StrictStr] = Field( + default=None, + description="Optional, key algorithm of the generated key-pair. Used only if publicKey attribute is not specified, otherwise the algorithm is derived from the public key.", + ) public_key: Optional[StrictStr] = Field( default=None, description="Optional, public key part of the user generated RSA key-pair wrapped in a [X.509 v3 certificate](https://www.rfc-editor.org/rfc/rfc5280)", @@ -37,7 +41,17 @@ class CreateServiceAccountKeyPayload(BaseModel): description="Optional, date of key expiration. When omitted, key is valid until deleted", alias="validUntil", ) - __properties: ClassVar[List[str]] = ["publicKey", "validUntil"] + __properties: ClassVar[List[str]] = ["algorithm", "publicKey", "validUntil"] + + @field_validator("algorithm") + def algorithm_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(["RSA_2048", "RSA_4096"]): + raise ValueError("must be one of enum values ('RSA_2048', 'RSA_4096')") + return value model_config = ConfigDict( populate_by_name=True, @@ -87,5 +101,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: if not isinstance(obj, dict): return cls.model_validate(obj) - _obj = cls.model_validate({"publicKey": obj.get("publicKey"), "validUntil": obj.get("validUntil")}) + _obj = cls.model_validate( + {"algorithm": obj.get("algorithm"), "publicKey": obj.get("publicKey"), "validUntil": obj.get("validUntil")} + ) return _obj diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py index 5f618bb5d..5de09c8d0 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/create_service_account_key_response.py @@ -66,8 +66,8 @@ class CreateServiceAccountKeyResponse(BaseModel): @field_validator("key_algorithm") def key_algorithm_validate_enum(cls, value): """Validates the enum""" - if value not in set(["RSA_2048"]): - raise ValueError("must be one of enum values ('RSA_2048')") + if value not in set(["RSA_2048", "RSA_4096"]): + raise ValueError("must be one of enum values ('RSA_2048', 'RSA_4096')") return value @field_validator("key_origin") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py index 583cd87bb..998de674a 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/get_service_account_key_response.py @@ -66,8 +66,8 @@ class GetServiceAccountKeyResponse(BaseModel): @field_validator("key_algorithm") def key_algorithm_validate_enum(cls, value): """Validates the enum""" - if value not in set(["RSA_2048"]): - raise ValueError("must be one of enum values ('RSA_2048')") + if value not in set(["RSA_2048", "RSA_4096"]): + raise ValueError("must be one of enum values ('RSA_2048', 'RSA_4096')") return value @field_validator("key_origin") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py index 4917402d9..c567aea2b 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/partial_update_service_account_key_response.py @@ -56,8 +56,8 @@ class PartialUpdateServiceAccountKeyResponse(BaseModel): @field_validator("key_algorithm") def key_algorithm_validate_enum(cls, value): """Validates the enum""" - if value not in set(["RSA_2048"]): - raise ValueError("must be one of enum values ('RSA_2048')") + if value not in set(["RSA_2048", "RSA_4096"]): + raise ValueError("must be one of enum values ('RSA_2048', 'RSA_4096')") return value @field_validator("key_origin") diff --git a/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py b/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py index 0b5463cef..1e8c9c136 100644 --- a/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py +++ b/services/serviceaccount/src/stackit/serviceaccount/models/service_account_key_list_response.py @@ -56,8 +56,8 @@ class ServiceAccountKeyListResponse(BaseModel): @field_validator("key_algorithm") def key_algorithm_validate_enum(cls, value): """Validates the enum""" - if value not in set(["RSA_2048"]): - raise ValueError("must be one of enum values ('RSA_2048')") + if value not in set(["RSA_2048", "RSA_4096"]): + raise ValueError("must be one of enum values ('RSA_2048', 'RSA_4096')") return value @field_validator("key_origin")