From e02f65b5fde96b870381b5d20b06de9b94ebf12f Mon Sep 17 00:00:00 2001 From: scaleway-bot Date: Thu, 27 Aug 2026 17:08:38 +0000 Subject: [PATCH] chore(serverless_sqldb): fix MD001 --- .../scaleway_async/k8s/v1/marshalling.py | 3 + scaleway-async/scaleway_async/k8s/v1/types.py | 5 + .../key_manager/v1alpha1/__init__.py | 8 ++ .../key_manager/v1alpha1/api.py | 104 ++++++++++++++++++ .../key_manager/v1alpha1/marshalling.py | 80 ++++++++++++++ .../key_manager/v1alpha1/types.py | 38 +++++++ .../product_catalog/v2alpha1/__init__.py | 2 + .../product_catalog/v2alpha1/marshalling.py | 22 ++++ .../product_catalog/v2alpha1/types.py | 10 ++ scaleway/scaleway/k8s/v1/marshalling.py | 3 + scaleway/scaleway/k8s/v1/types.py | 5 + .../scaleway/key_manager/v1alpha1/__init__.py | 8 ++ scaleway/scaleway/key_manager/v1alpha1/api.py | 104 ++++++++++++++++++ .../key_manager/v1alpha1/marshalling.py | 80 ++++++++++++++ .../scaleway/key_manager/v1alpha1/types.py | 38 +++++++ .../product_catalog/v2alpha1/__init__.py | 2 + .../product_catalog/v2alpha1/marshalling.py | 22 ++++ .../product_catalog/v2alpha1/types.py | 10 ++ 18 files changed, 544 insertions(+) diff --git a/scaleway-async/scaleway_async/k8s/v1/marshalling.py b/scaleway-async/scaleway_async/k8s/v1/marshalling.py index cb05424d3..0b1267ba6 100644 --- a/scaleway-async/scaleway_async/k8s/v1/marshalling.py +++ b/scaleway-async/scaleway_async/k8s/v1/marshalling.py @@ -1713,6 +1713,9 @@ def marshal_CreateClusterRequestPoolConfig( marshal_CoreV1Taint(item, defaults) for item in request.startup_taints ] + if request.user_data is not None: + output["user_data"] = {key: value for key, value in request.user_data.items()} + if request.security_group_id is not None: output["security_group_id"] = request.security_group_id diff --git a/scaleway-async/scaleway_async/k8s/v1/types.py b/scaleway-async/scaleway_async/k8s/v1/types.py index 96c5d8884..89f86049b 100644 --- a/scaleway-async/scaleway_async/k8s/v1/types.py +++ b/scaleway-async/scaleway_async/k8s/v1/types.py @@ -605,6 +605,11 @@ class CreateClusterRequestPoolConfig: Kubernetes taints applied at node creation but not reconciled afterwards. """ + user_data: dict[str, str] + """ + User data applied and reconciled with the pool. + """ + placement_group_id: Optional[str] = None """ Placement group ID in which all the nodes of the pool will be created, placement groups are limited to 20 instances. diff --git a/scaleway-async/scaleway_async/key_manager/v1alpha1/__init__.py b/scaleway-async/scaleway_async/key_manager/v1alpha1/__init__.py index 6e853a234..185eff119 100644 --- a/scaleway-async/scaleway_async/key_manager/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/key_manager/v1alpha1/__init__.py @@ -38,9 +38,13 @@ from .types import SignRequest from .types import SignResponse from .types import UnprotectKeyRequest +from .types import UnwrapKeyRequest +from .types import UnwrapKeyResponse from .types import UpdateKeyRequest from .types import VerifyRequest from .types import VerifyResponse +from .types import WrapKeyRequest +from .types import WrapKeyResponse from .api import KeyManagerV1Alpha1API __all__ = [ @@ -82,8 +86,12 @@ "SignRequest", "SignResponse", "UnprotectKeyRequest", + "UnwrapKeyRequest", + "UnwrapKeyResponse", "UpdateKeyRequest", "VerifyRequest", "VerifyResponse", + "WrapKeyRequest", + "WrapKeyResponse", "KeyManagerV1Alpha1API", ] diff --git a/scaleway-async/scaleway_async/key_manager/v1alpha1/api.py b/scaleway-async/scaleway_async/key_manager/v1alpha1/api.py index e8fa9ca62..32b39e68b 100644 --- a/scaleway-async/scaleway_async/key_manager/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/key_manager/v1alpha1/api.py @@ -33,9 +33,13 @@ PublicKey, SignRequest, SignResponse, + UnwrapKeyRequest, + UnwrapKeyResponse, UpdateKeyRequest, VerifyRequest, VerifyResponse, + WrapKeyRequest, + WrapKeyResponse, ) from .marshalling import ( unmarshal_Key, @@ -46,15 +50,19 @@ unmarshal_ListKeysResponse, unmarshal_PublicKey, unmarshal_SignResponse, + unmarshal_UnwrapKeyResponse, unmarshal_VerifyResponse, + unmarshal_WrapKeyResponse, marshal_CreateKeyRequest, marshal_DecryptRequest, marshal_EncryptRequest, marshal_GenerateDataKeyRequest, marshal_ImportKeyMaterialRequest, marshal_SignRequest, + marshal_UnwrapKeyRequest, marshal_UpdateKeyRequest, marshal_VerifyRequest, + marshal_WrapKeyRequest, ) @@ -964,3 +972,99 @@ async def list_algorithms( self._throw_on_error(res) return unmarshal_ListAlgorithmsResponse(res.json()) + + async def wrap_key( + self, + *, + key_id: str, + plaintext: str, + region: Optional[ScwRegion] = None, + associated_data: Optional[str] = None, + ) -> WrapKeyResponse: + """ + Wrap a key. + Wrap (encrypt) a key using an existing key, specified by the `key_id` parameter. The key must use ML-KEM algorithm. The maximum key size that can be wrapped is 2 KB of plaintext. + :param key_id: + :param plaintext: + :param region: Region to target. If none is passed will use default region from the config. + :param associated_data: + :return: :class:`WrapKeyResponse ` + + Usage: + :: + + result = await api.wrap_key( + key_id="example", + plaintext="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_key_id = validate_path_param("key_id", key_id) + + res = self._request( + "POST", + f"/key-manager/v1alpha1/regions/{param_region}/keys/{param_key_id}/wrap", + body=marshal_WrapKeyRequest( + WrapKeyRequest( + key_id=key_id, + plaintext=plaintext, + region=region, + associated_data=associated_data, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_WrapKeyResponse(res.json()) + + async def unwrap_key( + self, + *, + key_id: str, + ciphertext: str, + region: Optional[ScwRegion] = None, + associated_data: Optional[str] = None, + ) -> UnwrapKeyResponse: + """ + Unwrap a key. + Unwrap (decrypt) a wrapped key using an existing key, specified by the `key_id` parameter. The key must use ML-KEM algorithm. The maximum key size that can be unwrapped is 4 KB of ciphertext. + :param key_id: + :param ciphertext: + :param region: Region to target. If none is passed will use default region from the config. + :param associated_data: + :return: :class:`UnwrapKeyResponse ` + + Usage: + :: + + result = await api.unwrap_key( + key_id="example", + ciphertext="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_key_id = validate_path_param("key_id", key_id) + + res = self._request( + "POST", + f"/key-manager/v1alpha1/regions/{param_region}/keys/{param_key_id}/unwrap", + body=marshal_UnwrapKeyRequest( + UnwrapKeyRequest( + key_id=key_id, + ciphertext=ciphertext, + region=region, + associated_data=associated_data, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_UnwrapKeyResponse(res.json()) diff --git a/scaleway-async/scaleway_async/key_manager/v1alpha1/marshalling.py b/scaleway-async/scaleway_async/key_manager/v1alpha1/marshalling.py index 2627d9f4e..336c95806 100644 --- a/scaleway-async/scaleway_async/key_manager/v1alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/key_manager/v1alpha1/marshalling.py @@ -27,15 +27,19 @@ ListKeysResponse, PublicKey, SignResponse, + UnwrapKeyResponse, VerifyResponse, + WrapKeyResponse, CreateKeyRequest, DecryptRequest, EncryptRequest, GenerateDataKeyRequest, ImportKeyMaterialRequest, SignRequest, + UnwrapKeyRequest, UpdateKeyRequest, VerifyRequest, + WrapKeyRequest, ) @@ -424,6 +428,29 @@ def unmarshal_SignResponse(data: Any) -> SignResponse: return SignResponse(**args) +def unmarshal_UnwrapKeyResponse(data: Any) -> UnwrapKeyResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'UnwrapKeyResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("key_id", None) + if field is not None: + args["key_id"] = field + else: + args["key_id"] = None + + field = data.get("plaintext", None) + if field is not None: + args["plaintext"] = field + else: + args["plaintext"] = None + + return UnwrapKeyResponse(**args) + + def unmarshal_VerifyResponse(data: Any) -> VerifyResponse: if not isinstance(data, dict): raise TypeError( @@ -447,6 +474,29 @@ def unmarshal_VerifyResponse(data: Any) -> VerifyResponse: return VerifyResponse(**args) +def unmarshal_WrapKeyResponse(data: Any) -> WrapKeyResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'WrapKeyResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("key_id", None) + if field is not None: + args["key_id"] = field + else: + args["key_id"] = None + + field = data.get("ciphertext", None) + if field is not None: + args["ciphertext"] = field + else: + args["ciphertext"] = None + + return WrapKeyResponse(**args) + + def marshal_KeyRotationPolicy( request: KeyRotationPolicy, defaults: ProfileDefaults, @@ -601,6 +651,21 @@ def marshal_SignRequest( return output +def marshal_UnwrapKeyRequest( + request: UnwrapKeyRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.ciphertext is not None: + output["ciphertext"] = request.ciphertext + + if request.associated_data is not None: + output["associated_data"] = request.associated_data + + return output + + def marshal_UpdateKeyRequest( request: UpdateKeyRequest, defaults: ProfileDefaults, @@ -637,3 +702,18 @@ def marshal_VerifyRequest( output["signature"] = request.signature return output + + +def marshal_WrapKeyRequest( + request: WrapKeyRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.plaintext is not None: + output["plaintext"] = request.plaintext + + if request.associated_data is not None: + output["associated_data"] = request.associated_data + + return output diff --git a/scaleway-async/scaleway_async/key_manager/v1alpha1/types.py b/scaleway-async/scaleway_async/key_manager/v1alpha1/types.py index fe3f7877a..9ecf8d4cf 100644 --- a/scaleway-async/scaleway_async/key_manager/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/key_manager/v1alpha1/types.py @@ -28,6 +28,8 @@ class KeyAlgorithmAsymmetricEncryption(str, Enum, metaclass=StrEnumMeta): RSA_OAEP_2048_SHA256 = "rsa_oaep_2048_sha256" RSA_OAEP_3072_SHA256 = "rsa_oaep_3072_sha256" RSA_OAEP_4096_SHA256 = "rsa_oaep_4096_sha256" + ML_KEM_768 = "ml_kem_768" + ML_KEM_1024 = "ml_kem_1024" def __str__(self) -> str: return str(self.value) @@ -673,6 +675,24 @@ class UnprotectKeyRequest: """ +@dataclass +class UnwrapKeyRequest: + key_id: str + ciphertext: str + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + associated_data: Optional[str] = None + + +@dataclass +class UnwrapKeyResponse: + key_id: str + plaintext: str + + @dataclass class UpdateKeyRequest: key_id: str @@ -740,3 +760,21 @@ class VerifyResponse: """ Returns `true` if the signature is valid for the digest and key, and `false` otherwise. """ + + +@dataclass +class WrapKeyRequest: + key_id: str + plaintext: str + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + associated_data: Optional[str] = None + + +@dataclass +class WrapKeyResponse: + key_id: str + ciphertext: str diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py index 8ec9438a6..6bb32b9a9 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/__init__.py @@ -86,6 +86,7 @@ from .types import PublicCatalogProductPropertiesServerlessContainers from .types import PublicCatalogProductPropertiesServerlessFunctions from .types import PublicCatalogProductPropertiesServerlessJobs +from .types import PublicCatalogProductPropertiesServerlessSqlDatabase from .types import PublicCatalogProductEnvironmentalImpactEstimation from .types import PublicCatalogProductLocality from .types import PublicCatalogProductPrice @@ -175,6 +176,7 @@ "PublicCatalogProductPropertiesServerlessContainers", "PublicCatalogProductPropertiesServerlessFunctions", "PublicCatalogProductPropertiesServerlessJobs", + "PublicCatalogProductPropertiesServerlessSqlDatabase", "PublicCatalogProductEnvironmentalImpactEstimation", "PublicCatalogProductLocality", "PublicCatalogProductPrice", diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py index c2816ab2c..cc0244139 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/marshalling.py @@ -81,6 +81,7 @@ PublicCatalogProductPropertiesServerlessContainers, PublicCatalogProductPropertiesServerlessFunctions, PublicCatalogProductPropertiesServerlessJobs, + PublicCatalogProductPropertiesServerlessSqlDatabase, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, @@ -1682,6 +1683,19 @@ def unmarshal_PublicCatalogProductPropertiesServerlessJobs( return PublicCatalogProductPropertiesServerlessJobs(**args) +def unmarshal_PublicCatalogProductPropertiesServerlessSqlDatabase( + data: Any, +) -> PublicCatalogProductPropertiesServerlessSqlDatabase: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessSqlDatabase' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessSqlDatabase(**args) + + def unmarshal_PublicCatalogProductEnvironmentalImpactEstimation( data: Any, ) -> PublicCatalogProductEnvironmentalImpactEstimation: @@ -1911,6 +1925,14 @@ def unmarshal_PublicCatalogProductProperties( else: args["serverless_jobs"] = None + field = data.get("serverless_sql_database", None) + if field is not None: + args["serverless_sql_database"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessSqlDatabase(field) + ) + else: + args["serverless_sql_database"] = None + field = data.get("apache_kafka", None) if field is not None: args["apache_kafka"] = unmarshal_PublicCatalogProductPropertiesApacheKafka( diff --git a/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py b/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py index 033549e0e..42d25c161 100644 --- a/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py +++ b/scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py @@ -42,6 +42,7 @@ class ListPublicCatalogProductsRequestProductType(str, Enum, metaclass=StrEnumMe INSTANCE_LOCAL_SSD_SNAPSHOT = "instance_local_ssd_snapshot" INSTANCE_LOCAL_SSD_STORAGE = "instance_local_ssd_storage" FILE_STORAGE = "file_storage" + SERVERLESS_SQL_DATABASE = "serverless_sql_database" def __str__(self) -> str: return str(self.value) @@ -953,6 +954,11 @@ class PublicCatalogProductPropertiesServerlessJobs: cpu: Optional[PublicCatalogProductPropertiesServerlessJobsCPUType] = None +@dataclass +class PublicCatalogProductPropertiesServerlessSqlDatabase: + pass + + @dataclass class PublicCatalogProductEnvironmentalImpactEstimation: kg_co2_equivalent: Optional[float] = None @@ -1029,6 +1035,10 @@ class PublicCatalogProductProperties: serverless_jobs: Optional[PublicCatalogProductPropertiesServerlessJobs] = None + serverless_sql_database: Optional[ + PublicCatalogProductPropertiesServerlessSqlDatabase + ] = None + apache_kafka: Optional[PublicCatalogProductPropertiesApacheKafka] = None open_search: Optional[PublicCatalogProductPropertiesOpenSearch] = None diff --git a/scaleway/scaleway/k8s/v1/marshalling.py b/scaleway/scaleway/k8s/v1/marshalling.py index cb05424d3..0b1267ba6 100644 --- a/scaleway/scaleway/k8s/v1/marshalling.py +++ b/scaleway/scaleway/k8s/v1/marshalling.py @@ -1713,6 +1713,9 @@ def marshal_CreateClusterRequestPoolConfig( marshal_CoreV1Taint(item, defaults) for item in request.startup_taints ] + if request.user_data is not None: + output["user_data"] = {key: value for key, value in request.user_data.items()} + if request.security_group_id is not None: output["security_group_id"] = request.security_group_id diff --git a/scaleway/scaleway/k8s/v1/types.py b/scaleway/scaleway/k8s/v1/types.py index 96c5d8884..89f86049b 100644 --- a/scaleway/scaleway/k8s/v1/types.py +++ b/scaleway/scaleway/k8s/v1/types.py @@ -605,6 +605,11 @@ class CreateClusterRequestPoolConfig: Kubernetes taints applied at node creation but not reconciled afterwards. """ + user_data: dict[str, str] + """ + User data applied and reconciled with the pool. + """ + placement_group_id: Optional[str] = None """ Placement group ID in which all the nodes of the pool will be created, placement groups are limited to 20 instances. diff --git a/scaleway/scaleway/key_manager/v1alpha1/__init__.py b/scaleway/scaleway/key_manager/v1alpha1/__init__.py index 6e853a234..185eff119 100644 --- a/scaleway/scaleway/key_manager/v1alpha1/__init__.py +++ b/scaleway/scaleway/key_manager/v1alpha1/__init__.py @@ -38,9 +38,13 @@ from .types import SignRequest from .types import SignResponse from .types import UnprotectKeyRequest +from .types import UnwrapKeyRequest +from .types import UnwrapKeyResponse from .types import UpdateKeyRequest from .types import VerifyRequest from .types import VerifyResponse +from .types import WrapKeyRequest +from .types import WrapKeyResponse from .api import KeyManagerV1Alpha1API __all__ = [ @@ -82,8 +86,12 @@ "SignRequest", "SignResponse", "UnprotectKeyRequest", + "UnwrapKeyRequest", + "UnwrapKeyResponse", "UpdateKeyRequest", "VerifyRequest", "VerifyResponse", + "WrapKeyRequest", + "WrapKeyResponse", "KeyManagerV1Alpha1API", ] diff --git a/scaleway/scaleway/key_manager/v1alpha1/api.py b/scaleway/scaleway/key_manager/v1alpha1/api.py index f12698c29..6abc2534d 100644 --- a/scaleway/scaleway/key_manager/v1alpha1/api.py +++ b/scaleway/scaleway/key_manager/v1alpha1/api.py @@ -33,9 +33,13 @@ PublicKey, SignRequest, SignResponse, + UnwrapKeyRequest, + UnwrapKeyResponse, UpdateKeyRequest, VerifyRequest, VerifyResponse, + WrapKeyRequest, + WrapKeyResponse, ) from .marshalling import ( unmarshal_Key, @@ -46,15 +50,19 @@ unmarshal_ListKeysResponse, unmarshal_PublicKey, unmarshal_SignResponse, + unmarshal_UnwrapKeyResponse, unmarshal_VerifyResponse, + unmarshal_WrapKeyResponse, marshal_CreateKeyRequest, marshal_DecryptRequest, marshal_EncryptRequest, marshal_GenerateDataKeyRequest, marshal_ImportKeyMaterialRequest, marshal_SignRequest, + marshal_UnwrapKeyRequest, marshal_UpdateKeyRequest, marshal_VerifyRequest, + marshal_WrapKeyRequest, ) @@ -964,3 +972,99 @@ def list_algorithms( self._throw_on_error(res) return unmarshal_ListAlgorithmsResponse(res.json()) + + def wrap_key( + self, + *, + key_id: str, + plaintext: str, + region: Optional[ScwRegion] = None, + associated_data: Optional[str] = None, + ) -> WrapKeyResponse: + """ + Wrap a key. + Wrap (encrypt) a key using an existing key, specified by the `key_id` parameter. The key must use ML-KEM algorithm. The maximum key size that can be wrapped is 2 KB of plaintext. + :param key_id: + :param plaintext: + :param region: Region to target. If none is passed will use default region from the config. + :param associated_data: + :return: :class:`WrapKeyResponse ` + + Usage: + :: + + result = api.wrap_key( + key_id="example", + plaintext="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_key_id = validate_path_param("key_id", key_id) + + res = self._request( + "POST", + f"/key-manager/v1alpha1/regions/{param_region}/keys/{param_key_id}/wrap", + body=marshal_WrapKeyRequest( + WrapKeyRequest( + key_id=key_id, + plaintext=plaintext, + region=region, + associated_data=associated_data, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_WrapKeyResponse(res.json()) + + def unwrap_key( + self, + *, + key_id: str, + ciphertext: str, + region: Optional[ScwRegion] = None, + associated_data: Optional[str] = None, + ) -> UnwrapKeyResponse: + """ + Unwrap a key. + Unwrap (decrypt) a wrapped key using an existing key, specified by the `key_id` parameter. The key must use ML-KEM algorithm. The maximum key size that can be unwrapped is 4 KB of ciphertext. + :param key_id: + :param ciphertext: + :param region: Region to target. If none is passed will use default region from the config. + :param associated_data: + :return: :class:`UnwrapKeyResponse ` + + Usage: + :: + + result = api.unwrap_key( + key_id="example", + ciphertext="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_key_id = validate_path_param("key_id", key_id) + + res = self._request( + "POST", + f"/key-manager/v1alpha1/regions/{param_region}/keys/{param_key_id}/unwrap", + body=marshal_UnwrapKeyRequest( + UnwrapKeyRequest( + key_id=key_id, + ciphertext=ciphertext, + region=region, + associated_data=associated_data, + ), + self.client, + ), + ) + + self._throw_on_error(res) + return unmarshal_UnwrapKeyResponse(res.json()) diff --git a/scaleway/scaleway/key_manager/v1alpha1/marshalling.py b/scaleway/scaleway/key_manager/v1alpha1/marshalling.py index 2627d9f4e..336c95806 100644 --- a/scaleway/scaleway/key_manager/v1alpha1/marshalling.py +++ b/scaleway/scaleway/key_manager/v1alpha1/marshalling.py @@ -27,15 +27,19 @@ ListKeysResponse, PublicKey, SignResponse, + UnwrapKeyResponse, VerifyResponse, + WrapKeyResponse, CreateKeyRequest, DecryptRequest, EncryptRequest, GenerateDataKeyRequest, ImportKeyMaterialRequest, SignRequest, + UnwrapKeyRequest, UpdateKeyRequest, VerifyRequest, + WrapKeyRequest, ) @@ -424,6 +428,29 @@ def unmarshal_SignResponse(data: Any) -> SignResponse: return SignResponse(**args) +def unmarshal_UnwrapKeyResponse(data: Any) -> UnwrapKeyResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'UnwrapKeyResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("key_id", None) + if field is not None: + args["key_id"] = field + else: + args["key_id"] = None + + field = data.get("plaintext", None) + if field is not None: + args["plaintext"] = field + else: + args["plaintext"] = None + + return UnwrapKeyResponse(**args) + + def unmarshal_VerifyResponse(data: Any) -> VerifyResponse: if not isinstance(data, dict): raise TypeError( @@ -447,6 +474,29 @@ def unmarshal_VerifyResponse(data: Any) -> VerifyResponse: return VerifyResponse(**args) +def unmarshal_WrapKeyResponse(data: Any) -> WrapKeyResponse: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'WrapKeyResponse' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + field = data.get("key_id", None) + if field is not None: + args["key_id"] = field + else: + args["key_id"] = None + + field = data.get("ciphertext", None) + if field is not None: + args["ciphertext"] = field + else: + args["ciphertext"] = None + + return WrapKeyResponse(**args) + + def marshal_KeyRotationPolicy( request: KeyRotationPolicy, defaults: ProfileDefaults, @@ -601,6 +651,21 @@ def marshal_SignRequest( return output +def marshal_UnwrapKeyRequest( + request: UnwrapKeyRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.ciphertext is not None: + output["ciphertext"] = request.ciphertext + + if request.associated_data is not None: + output["associated_data"] = request.associated_data + + return output + + def marshal_UpdateKeyRequest( request: UpdateKeyRequest, defaults: ProfileDefaults, @@ -637,3 +702,18 @@ def marshal_VerifyRequest( output["signature"] = request.signature return output + + +def marshal_WrapKeyRequest( + request: WrapKeyRequest, + defaults: ProfileDefaults, +) -> dict[str, Any]: + output: dict[str, Any] = {} + + if request.plaintext is not None: + output["plaintext"] = request.plaintext + + if request.associated_data is not None: + output["associated_data"] = request.associated_data + + return output diff --git a/scaleway/scaleway/key_manager/v1alpha1/types.py b/scaleway/scaleway/key_manager/v1alpha1/types.py index fe3f7877a..9ecf8d4cf 100644 --- a/scaleway/scaleway/key_manager/v1alpha1/types.py +++ b/scaleway/scaleway/key_manager/v1alpha1/types.py @@ -28,6 +28,8 @@ class KeyAlgorithmAsymmetricEncryption(str, Enum, metaclass=StrEnumMeta): RSA_OAEP_2048_SHA256 = "rsa_oaep_2048_sha256" RSA_OAEP_3072_SHA256 = "rsa_oaep_3072_sha256" RSA_OAEP_4096_SHA256 = "rsa_oaep_4096_sha256" + ML_KEM_768 = "ml_kem_768" + ML_KEM_1024 = "ml_kem_1024" def __str__(self) -> str: return str(self.value) @@ -673,6 +675,24 @@ class UnprotectKeyRequest: """ +@dataclass +class UnwrapKeyRequest: + key_id: str + ciphertext: str + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + associated_data: Optional[str] = None + + +@dataclass +class UnwrapKeyResponse: + key_id: str + plaintext: str + + @dataclass class UpdateKeyRequest: key_id: str @@ -740,3 +760,21 @@ class VerifyResponse: """ Returns `true` if the signature is valid for the digest and key, and `false` otherwise. """ + + +@dataclass +class WrapKeyRequest: + key_id: str + plaintext: str + region: Optional[ScwRegion] = None + """ + Region to target. If none is passed will use default region from the config. + """ + + associated_data: Optional[str] = None + + +@dataclass +class WrapKeyResponse: + key_id: str + ciphertext: str diff --git a/scaleway/scaleway/product_catalog/v2alpha1/__init__.py b/scaleway/scaleway/product_catalog/v2alpha1/__init__.py index 8ec9438a6..6bb32b9a9 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/__init__.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/__init__.py @@ -86,6 +86,7 @@ from .types import PublicCatalogProductPropertiesServerlessContainers from .types import PublicCatalogProductPropertiesServerlessFunctions from .types import PublicCatalogProductPropertiesServerlessJobs +from .types import PublicCatalogProductPropertiesServerlessSqlDatabase from .types import PublicCatalogProductEnvironmentalImpactEstimation from .types import PublicCatalogProductLocality from .types import PublicCatalogProductPrice @@ -175,6 +176,7 @@ "PublicCatalogProductPropertiesServerlessContainers", "PublicCatalogProductPropertiesServerlessFunctions", "PublicCatalogProductPropertiesServerlessJobs", + "PublicCatalogProductPropertiesServerlessSqlDatabase", "PublicCatalogProductEnvironmentalImpactEstimation", "PublicCatalogProductLocality", "PublicCatalogProductPrice", diff --git a/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py b/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py index c2816ab2c..cc0244139 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/marshalling.py @@ -81,6 +81,7 @@ PublicCatalogProductPropertiesServerlessContainers, PublicCatalogProductPropertiesServerlessFunctions, PublicCatalogProductPropertiesServerlessJobs, + PublicCatalogProductPropertiesServerlessSqlDatabase, PublicCatalogProductEnvironmentalImpactEstimation, PublicCatalogProductLocality, PublicCatalogProductPrice, @@ -1682,6 +1683,19 @@ def unmarshal_PublicCatalogProductPropertiesServerlessJobs( return PublicCatalogProductPropertiesServerlessJobs(**args) +def unmarshal_PublicCatalogProductPropertiesServerlessSqlDatabase( + data: Any, +) -> PublicCatalogProductPropertiesServerlessSqlDatabase: + if not isinstance(data, dict): + raise TypeError( + "Unmarshalling the type 'PublicCatalogProductPropertiesServerlessSqlDatabase' failed as data isn't a dictionary." + ) + + args: dict[str, Any] = {} + + return PublicCatalogProductPropertiesServerlessSqlDatabase(**args) + + def unmarshal_PublicCatalogProductEnvironmentalImpactEstimation( data: Any, ) -> PublicCatalogProductEnvironmentalImpactEstimation: @@ -1911,6 +1925,14 @@ def unmarshal_PublicCatalogProductProperties( else: args["serverless_jobs"] = None + field = data.get("serverless_sql_database", None) + if field is not None: + args["serverless_sql_database"] = ( + unmarshal_PublicCatalogProductPropertiesServerlessSqlDatabase(field) + ) + else: + args["serverless_sql_database"] = None + field = data.get("apache_kafka", None) if field is not None: args["apache_kafka"] = unmarshal_PublicCatalogProductPropertiesApacheKafka( diff --git a/scaleway/scaleway/product_catalog/v2alpha1/types.py b/scaleway/scaleway/product_catalog/v2alpha1/types.py index 033549e0e..42d25c161 100644 --- a/scaleway/scaleway/product_catalog/v2alpha1/types.py +++ b/scaleway/scaleway/product_catalog/v2alpha1/types.py @@ -42,6 +42,7 @@ class ListPublicCatalogProductsRequestProductType(str, Enum, metaclass=StrEnumMe INSTANCE_LOCAL_SSD_SNAPSHOT = "instance_local_ssd_snapshot" INSTANCE_LOCAL_SSD_STORAGE = "instance_local_ssd_storage" FILE_STORAGE = "file_storage" + SERVERLESS_SQL_DATABASE = "serverless_sql_database" def __str__(self) -> str: return str(self.value) @@ -953,6 +954,11 @@ class PublicCatalogProductPropertiesServerlessJobs: cpu: Optional[PublicCatalogProductPropertiesServerlessJobsCPUType] = None +@dataclass +class PublicCatalogProductPropertiesServerlessSqlDatabase: + pass + + @dataclass class PublicCatalogProductEnvironmentalImpactEstimation: kg_co2_equivalent: Optional[float] = None @@ -1029,6 +1035,10 @@ class PublicCatalogProductProperties: serverless_jobs: Optional[PublicCatalogProductPropertiesServerlessJobs] = None + serverless_sql_database: Optional[ + PublicCatalogProductPropertiesServerlessSqlDatabase + ] = None + apache_kafka: Optional[PublicCatalogProductPropertiesApacheKafka] = None open_search: Optional[PublicCatalogProductPropertiesOpenSearch] = None