Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions scaleway-async/scaleway_async/key_manager/v1alpha1/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.

from typing import List, Optional
from typing import Optional

from scaleway_core.api import API
from scaleway_core.bridge import (
Expand Down Expand Up @@ -72,18 +72,18 @@ async def create_key(
name: Optional[str] = None,
usage: Optional[KeyUsage] = None,
description: Optional[str] = None,
tags: Optional[List[str]] = None,
tags: Optional[list[str]] = None,
rotation_policy: Optional[KeyRotationPolicy] = None,
origin: Optional[KeyOrigin] = None,
) -> Key:
"""
Create a key.
Create a key in a given region specified by the `region` parameter. Keys only support symmetric encryption. You can use keys to encrypt or decrypt arbitrary payloads, or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**.
Create a key in a given region specified by the `region` parameter. You can use keys to encrypt or decrypt arbitrary payloads, to sign and verify messages or to generate data encryption keys. **Data encryption keys are not stored in Key Manager**.
:param unprotected: Default value is `false`.
:param region: Region to target. If none is passed will use default region from the config.
:param project_id: ID of the Project containing the key.
:param name: (Optional) Name of the key.
:param usage: See the `Key.Algorithm.SymmetricEncryption` enum for a description of values.
:param usage: See the `Key.Usage` enum for a description of possible values.
:param description: (Optional) Description of the key.
:param tags: (Optional) List of the key's tags.
:param rotation_policy: If not specified, no rotation policy will be applied to the key.
Expand Down Expand Up @@ -199,7 +199,7 @@ async def update_key(
region: Optional[ScwRegion] = None,
name: Optional[str] = None,
description: Optional[str] = None,
tags: Optional[List[str]] = None,
tags: Optional[list[str]] = None,
rotation_policy: Optional[KeyRotationPolicy] = None,
) -> Key:
"""
Expand Down Expand Up @@ -462,7 +462,7 @@ async def list_keys(
order_by: Optional[ListKeysRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
tags: Optional[List[str]] = None,
tags: Optional[list[str]] = None,
name: Optional[str] = None,
usage: Optional[ListKeysRequestUsage] = None,
) -> ListKeysResponse:
Expand Down Expand Up @@ -523,10 +523,10 @@ async def list_keys_all(
order_by: Optional[ListKeysRequestOrderBy] = None,
page: Optional[int] = None,
page_size: Optional[int] = None,
tags: Optional[List[str]] = None,
tags: Optional[list[str]] = None,
name: Optional[str] = None,
usage: Optional[ListKeysRequestUsage] = None,
) -> List[Key]:
) -> list[Key]:
"""
List keys.
Retrieve a list of keys across all Projects in an Organization or within a specific Project. You must specify the `region`, and either the `organization_id` or the `project_id`.
Expand All @@ -540,7 +540,7 @@ async def list_keys_all(
:param tags: (Optional) List of tags to filter on.
:param name: (Optional) Filter by key name.
:param usage: Select from symmetric encryption, asymmetric encryption, or asymmetric signing.
:return: :class:`List[Key] <List[Key]>`
:return: :class:`list[Key] <list[Key]>`

Usage:
::
Expand Down Expand Up @@ -929,7 +929,7 @@ async def list_algorithms(
self,
*,
region: Optional[ScwRegion] = None,
usages: Optional[List[ListAlgorithmsRequestUsage]] = None,
usages: Optional[list[ListAlgorithmsRequestUsage]] = None,
) -> ListAlgorithmsResponse:
"""
List all available algorithms.
Expand Down
76 changes: 41 additions & 35 deletions scaleway-async/scaleway_async/key_manager/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file was automatically generated. DO NOT EDIT.
# If you have any remark or suggestion do not hesitate to open an issue.

from typing import Any, Dict
from typing import Any
from dateutil import parser

from scaleway_core.profile import ProfileDefaults
Expand All @@ -11,6 +11,8 @@
)
from .types import (
DataKeyAlgorithmSymmetricEncryption,
KeyAlgorithmAsymmetricEncryption,
KeyAlgorithmAsymmetricSigning,
KeyAlgorithmSymmetricEncryption,
KeyOrigin,
KeyState,
Expand Down Expand Up @@ -43,7 +45,7 @@ def unmarshal_KeyRotationPolicy(data: Any) -> KeyRotationPolicy:
"Unmarshalling the type 'KeyRotationPolicy' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("rotation_period", None)
if field is not None:
Expand All @@ -68,7 +70,7 @@ def unmarshal_KeyUsage(data: Any) -> KeyUsage:
"Unmarshalling the type 'KeyUsage' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("symmetric_encryption", None)
if field is not None:
Expand All @@ -82,13 +84,17 @@ def unmarshal_KeyUsage(data: Any) -> KeyUsage:
if field is not None:
args["asymmetric_encryption"] = field
else:
args["asymmetric_encryption"] = None
args["asymmetric_encryption"] = (
KeyAlgorithmAsymmetricEncryption.UNKNOWN_ASYMMETRIC_ENCRYPTION
)

field = data.get("asymmetric_signing", None)
if field is not None:
args["asymmetric_signing"] = field
else:
args["asymmetric_signing"] = None
args["asymmetric_signing"] = (
KeyAlgorithmAsymmetricSigning.UNKNOWN_ASYMMETRIC_SIGNING
)

return KeyUsage(**args)

Expand All @@ -99,7 +105,7 @@ def unmarshal_Key(data: Any) -> Key:
"Unmarshalling the type 'Key' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("id", None)
if field is not None:
Expand Down Expand Up @@ -214,7 +220,7 @@ def unmarshal_DataKey(data: Any) -> DataKey:
"Unmarshalling the type 'DataKey' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("key_id", None)
if field is not None:
Expand Down Expand Up @@ -257,7 +263,7 @@ def unmarshal_DecryptResponse(data: Any) -> DecryptResponse:
"Unmarshalling the type 'DecryptResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("key_id", None)
if field is not None:
Expand Down Expand Up @@ -286,7 +292,7 @@ def unmarshal_EncryptResponse(data: Any) -> EncryptResponse:
"Unmarshalling the type 'EncryptResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("key_id", None)
if field is not None:
Expand All @@ -311,7 +317,7 @@ def unmarshal_ListAlgorithmsResponseAlgorithm(
"Unmarshalling the type 'ListAlgorithmsResponseAlgorithm' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("usage", None)
if field is not None:
Expand Down Expand Up @@ -340,7 +346,7 @@ def unmarshal_ListAlgorithmsResponse(data: Any) -> ListAlgorithmsResponse:
"Unmarshalling the type 'ListAlgorithmsResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("algorithms", None)
if field is not None:
Expand All @@ -361,7 +367,7 @@ def unmarshal_ListKeysResponse(data: Any) -> ListKeysResponse:
"Unmarshalling the type 'ListKeysResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("keys", None)
if field is not None:
Expand All @@ -384,7 +390,7 @@ def unmarshal_PublicKey(data: Any) -> PublicKey:
"Unmarshalling the type 'PublicKey' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("pem", None)
if field is not None:
Expand All @@ -401,7 +407,7 @@ def unmarshal_SignResponse(data: Any) -> SignResponse:
"Unmarshalling the type 'SignResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("key_id", None)
if field is not None:
Expand All @@ -424,7 +430,7 @@ def unmarshal_VerifyResponse(data: Any) -> VerifyResponse:
"Unmarshalling the type 'VerifyResponse' failed as data isn't a dictionary."
)

args: Dict[str, Any] = {}
args: dict[str, Any] = {}

field = data.get("key_id", None)
if field is not None:
Expand All @@ -444,8 +450,8 @@ def unmarshal_VerifyResponse(data: Any) -> VerifyResponse:
def marshal_KeyRotationPolicy(
request: KeyRotationPolicy,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.rotation_period is not None:
output["rotation_period"] = request.rotation_period
Expand All @@ -459,8 +465,8 @@ def marshal_KeyRotationPolicy(
def marshal_KeyUsage(
request: KeyUsage,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}
output.update(
resolve_one_of(
[
Expand Down Expand Up @@ -489,8 +495,8 @@ def marshal_KeyUsage(
def marshal_CreateKeyRequest(
request: CreateKeyRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.unprotected is not None:
output["unprotected"] = request.unprotected
Expand Down Expand Up @@ -526,8 +532,8 @@ def marshal_CreateKeyRequest(
def marshal_DecryptRequest(
request: DecryptRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.ciphertext is not None:
output["ciphertext"] = request.ciphertext
Expand All @@ -541,8 +547,8 @@ def marshal_DecryptRequest(
def marshal_EncryptRequest(
request: EncryptRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.plaintext is not None:
output["plaintext"] = request.plaintext
Expand All @@ -556,8 +562,8 @@ def marshal_EncryptRequest(
def marshal_GenerateDataKeyRequest(
request: GenerateDataKeyRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.without_plaintext is not None:
output["without_plaintext"] = request.without_plaintext
Expand All @@ -571,8 +577,8 @@ def marshal_GenerateDataKeyRequest(
def marshal_ImportKeyMaterialRequest(
request: ImportKeyMaterialRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.key_material is not None:
output["key_material"] = request.key_material
Expand All @@ -586,8 +592,8 @@ def marshal_ImportKeyMaterialRequest(
def marshal_SignRequest(
request: SignRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.digest is not None:
output["digest"] = request.digest
Expand All @@ -598,8 +604,8 @@ def marshal_SignRequest(
def marshal_UpdateKeyRequest(
request: UpdateKeyRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.name is not None:
output["name"] = request.name
Expand All @@ -621,8 +627,8 @@ def marshal_UpdateKeyRequest(
def marshal_VerifyRequest(
request: VerifyRequest,
defaults: ProfileDefaults,
) -> Dict[str, Any]:
output: Dict[str, Any] = {}
) -> dict[str, Any]:
output: dict[str, Any] = {}

if request.digest is not None:
output["digest"] = request.digest
Expand Down
Loading