From 18f0d481ef6500718328dbbb90e525ce934f04ad Mon Sep 17 00:00:00 2001 From: Shubham Chaturvedi Date: Mon, 28 Oct 2024 15:52:02 -0700 Subject: [PATCH] fix: Polymorph Python --- .../aws_cryptography_keystore/__init__.py | 1 + .../aws_cryptography_keystore/client.py | 50 +- .../aws_cryptography_keystore/config.py | 70 +- .../dafnyImplInterface.py | 11 +- .../dafny_protocol.py | 2 - .../dafny_to_smithy.py | 243 +- .../aws_cryptography_keystore/deserialize.py | 69 +- .../aws_cryptography_keystore/errors.py | 191 +- .../aws_cryptography_keystore/models.py | 467 +- .../aws_cryptography_keystore/plugin.py | 28 +- .../aws_cryptography_keystore/serialize.py | 48 +- .../smithy_to_dafny.py | 483 +- .../__init__.py | 1 + .../client.py | 210 +- .../config.py | 47 +- .../dafnyImplInterface.py | 11 +- .../dafny_protocol.py | 2 - .../dafny_to_smithy.py | 1497 +---- .../deserialize.py | 315 +- .../errors.py | 619 +- .../models.py | 2567 ++++---- .../plugin.py | 35 +- .../references.py | 529 +- .../serialize.py | 301 +- .../smithy_to_dafny.py | 1997 +----- .../aws_cryptography_primitives/__init__.py | 1 + .../aws_cryptography_primitives/client.py | 69 +- .../aws_cryptography_primitives/config.py | 47 +- .../dafnyImplInterface.py | 11 +- .../dafny_protocol.py | 2 - .../dafny_to_smithy.py | 235 +- .../deserialize.py | 218 +- .../aws_cryptography_primitives/errors.py | 189 +- .../aws_cryptography_primitives/models.py | 842 +-- .../aws_cryptography_primitives/plugin.py | 28 +- .../aws_cryptography_primitives/serialize.py | 191 +- .../smithy_to_dafny.py | 258 +- .../com_amazonaws_kms/__init__.py | 1 + .../com_amazonaws_kms/aws_sdk_to_dafny.py | 5491 ++--------------- .../com_amazonaws_kms/dafny_to_aws_sdk.py | 1882 ++---- .../smithygenerated/com_amazonaws_kms/shim.py | 1010 +-- .../__init__.py | 1 + .../shim.py | 437 +- .../__init__.py | 1 + .../client.py | 49 +- .../config.py | 58 +- .../dafnyImplInterface.py | 11 +- .../dafny_protocol.py | 2 - .../dafny_to_smithy.py | 296 +- .../deserialize.py | 51 +- .../errors.py | 181 +- .../models.py | 501 +- .../plugin.py | 28 +- .../serialize.py | 43 +- .../smithy_to_dafny.py | 546 +- 55 files changed, 5351 insertions(+), 17123 deletions(-) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/__init__.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/__init__.py index 09be6133b..89d64801a 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/__init__.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/__init__.py @@ -1,3 +1,4 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. + diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/client.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/client.py index f35f12562..9aa4c0fdf 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/client.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/client.py @@ -55,17 +55,15 @@ Input = TypeVar("Input") Output = TypeVar("Output") - class KeyStore: - """Client for KeyStore. + """Client for KeyStore :param config: Configuration for the client. """ - def __init__( self, config: KeyStoreConfig | None = None, - dafny_client: IKeyStoreClient | None = None, + dafny_client: IKeyStoreClient | None = None ): if config is None: self._config = Config() @@ -97,9 +95,7 @@ def get_key_store_info(self, input: Unit) -> GetKeyStoreInfoOutput: ) def create_key_store(self, input: CreateKeyStoreInput) -> CreateKeyStoreOutput: - """Create the DynamoDB table that backs this Key Store based on the Key - Store configuration. If a table already exists, validate it is - configured as expected. + """Create the DynamoDB table that backs this Key Store based on the Key Store configuration. If a table already exists, validate it is configured as expected. :param input: The operation's input. """ @@ -113,8 +109,7 @@ def create_key_store(self, input: CreateKeyStoreInput) -> CreateKeyStoreOutput: ) def create_key(self, input: CreateKeyInput) -> CreateKeyOutput: - """Create a new Branch Key in the Key Store. Additionally create a - Beacon Key that is tied to this Branch Key. + """Create a new Branch Key in the Key Store. Additionally create a Beacon Key that is tied to this Branch Key. :param input: The operation's input. """ @@ -128,8 +123,7 @@ def create_key(self, input: CreateKeyInput) -> CreateKeyOutput: ) def version_key(self, input: VersionKeyInput) -> VersionKeyOutput: - """Create a new ACTIVE version of an existing Branch Key in the Key - Store, and set the previously ACTIVE version to DECRYPT_ONLY. + """Create a new ACTIVE version of an existing Branch Key in the Key Store, and set the previously ACTIVE version to DECRYPT_ONLY. :param input: Inputs for versioning a Branch Key. """ @@ -142,11 +136,8 @@ def version_key(self, input: VersionKeyInput) -> VersionKeyOutput: operation_name="VersionKey", ) - def get_active_branch_key( - self, input: GetActiveBranchKeyInput - ) -> GetActiveBranchKeyOutput: - """Get the ACTIVE version for a particular Branch Key from the Key - Store. + def get_active_branch_key(self, input: GetActiveBranchKeyInput) -> GetActiveBranchKeyOutput: + """Get the ACTIVE version for a particular Branch Key from the Key Store. :param input: Inputs for getting a Branch Key's ACTIVE version. """ @@ -159,9 +150,7 @@ def get_active_branch_key( operation_name="GetActiveBranchKey", ) - def get_branch_key_version( - self, input: GetBranchKeyVersionInput - ) -> GetBranchKeyVersionOutput: + def get_branch_key_version(self, input: GetBranchKeyVersionInput) -> GetBranchKeyVersionOutput: """Get a particular version of a Branch Key from the Key Store. :param input: Inputs for getting a version of a Branch Key. @@ -226,8 +215,7 @@ def _handle_execution( ) _client_interceptors = config.interceptors client_interceptors = cast( - list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - _client_interceptors, + list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], _client_interceptors ) interceptors = client_interceptors @@ -310,7 +298,7 @@ def _handle_execution( error_info=RetryErrorInfo( # TODO: Determine the error type. error_type=RetryErrorType.CLIENT_ERROR, - ), + ) ) except SmithyRetryException: raise context_with_response.response @@ -325,10 +313,7 @@ def _handle_execution( # The response will be set either with the modeled output or an exception. The # transport_request and transport_response may be set or None. execution_context = cast( - InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], - context, + InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], context ) return self._finalize_execution(interceptors, execution_context) @@ -353,10 +338,8 @@ def _handle_attempt( InterceptorContext[Input, None, DafnyRequest, DafnyResponse], context ) - context_with_response._transport_response = ( - config.dafnyImplInterface.handle_request( - input=context_with_response.transport_request - ) + context_with_response._transport_response = config.dafnyImplInterface.handle_request( + input=context_with_response.transport_request ) # Step 7n: Invoke read_after_transmit @@ -393,8 +376,7 @@ def _handle_attempt( # None. This will also be true after _finalize_attempt because there is no opportunity # there to set the transport_response. attempt_context = cast( - InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], - context, + InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], context ) return self._finalize_attempt(interceptors, attempt_context) @@ -424,9 +406,7 @@ def _finalize_attempt( def _finalize_execution( self, interceptors: list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - context: InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], + context: InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], ) -> Output: try: # Step 9: Invoke modify_before_completion diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/config.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/config.py index c79bcff34..8cce4eba9 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/config.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/config.py @@ -20,8 +20,6 @@ _ServiceInterceptor = Any - - @dataclass(init=False) class Config: """Configuration for KeyStore.""" @@ -39,21 +37,21 @@ def __init__( ): """Constructor. - :param interceptors: The list of interceptors, which are hooks - that are called during the execution of a request. - :param retry_strategy: The retry strategy for issuing retry - tokens and computing retry delays. + :param interceptors: The list of interceptors, which are hooks that are called + during the execution of a request. + + :param retry_strategy: The retry strategy for issuing retry tokens and computing + retry delays. + :param dafnyImplInterface: """ self.interceptors = interceptors or [] self.retry_strategy = retry_strategy or SimpleRetryStrategy() self.dafnyImplInterface = dafnyImplInterface - # A callable that allows customizing the config object on each request. Plugin: TypeAlias = Callable[[Config], None] - class KeyStoreConfig(Config): ddb_table_name: str kms_configuration: KMSConfiguration @@ -62,7 +60,6 @@ class KeyStoreConfig(Config): grant_tokens: Optional[list[str]] ddb_client: Optional[BaseClient] kms_client: Optional[BaseClient] - def __init__( self, *, @@ -74,7 +71,7 @@ def __init__( ddb_client: Optional[BaseClient] = None, kms_client: Optional[BaseClient] = None, ): - """Constructor for KeyStoreConfig. + """Constructor for KeyStoreConfig :param ddb_table_name: The DynamoDB table name that backs this Key Store. :param kms_configuration: Configures Key Store's KMS Key ARN restrictions. @@ -93,14 +90,10 @@ def __init__( """ super().__init__() if (ddb_table_name is not None) and (len(ddb_table_name) < 3): - raise ValueError( - "The size of ddb_table_name must be greater than or equal to 3" - ) + raise ValueError("The size of ddb_table_name must be greater than or equal to 3") if (ddb_table_name is not None) and (len(ddb_table_name) > 255): - raise ValueError( - "The size of ddb_table_name must be less than or equal to 255" - ) + raise ValueError("The size of ddb_table_name must be less than or equal to 255") self.ddb_table_name = ddb_table_name self.kms_configuration = kms_configuration @@ -111,7 +104,9 @@ def __init__( self.kms_client = kms_client def as_dict(self) -> Dict[str, Any]: - """Converts the KeyStoreConfig to a dictionary.""" + """Converts the KeyStoreConfig to a dictionary. + + """ d: Dict[str, Any] = { "ddb_table_name": self.ddb_table_name, "kms_configuration": self.kms_configuration.as_dict(), @@ -134,7 +129,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyStoreConfig": - """Creates a KeyStoreConfig from a dictionary.""" + """Creates a KeyStoreConfig from a dictionary. + + """ kwargs: Dict[str, Any] = { "ddb_table_name": d["ddb_table_name"], "kms_configuration": _kms_configuration_from_dict(d["kms_configuration"]), @@ -183,29 +180,22 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KeyStoreConfig): return False - attributes: list[str] = [ - "ddb_table_name", - "kms_configuration", - "logical_key_store_name", - "id", - "grant_tokens", - "ddb_client", - "kms_client", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ddb_table_name','kms_configuration','logical_key_store_name','id','grant_tokens','ddb_client','kms_client',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) def dafny_config_to_smithy_config(dafny_config) -> KeyStoreConfig: - """Converts the provided Dafny shape for this localService's config into - the corresponding Smithy-modelled shape.""" - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KeyStoreConfig( - dafny_config - ) - + """ + Converts the provided Dafny shape for this localService's config + into the corresponding Smithy-modelled shape. + """ + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KeyStoreConfig(dafny_config) def smithy_config_to_dafny_config(smithy_config) -> DafnyKeyStoreConfig: - """Converts the provided Smithy-modelled shape for this localService's - config into the corresponding Dafny shape.""" - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KeyStoreConfig( - smithy_config - ) + """ + Converts the provided Smithy-modelled shape for this localService's config + into the corresponding Dafny shape. + """ + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KeyStoreConfig(smithy_config) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafnyImplInterface.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafnyImplInterface.py index 06d6a6557..80d7f6631 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafnyImplInterface.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafnyImplInterface.py @@ -2,12 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. -from aws_cryptographic_material_providers.internaldafny.generated.KeyStore import ( - KeyStoreClient, -) +from aws_cryptographic_material_providers.internaldafny.generated.KeyStore import KeyStoreClient from .dafny_protocol import DafnyRequest - class DafnyImplInterface: impl: KeyStoreClient | None = None @@ -30,9 +27,9 @@ def handle_request(self, input: DafnyRequest): "GetBeaconKey": self.impl.GetBeaconKey, } - # This logic is where a typical Smithy client would expect the "server" to be. - # This code can be thought of as logic our Dafny "server" uses - # to route incoming client requests to the correct request handler code. + # This logic is where a typical Smithy client would expect the "server" to be. + # This code can be thought of as logic our Dafny "server" uses + # to route incoming client requests to the correct request handler code. if input.dafny_operation_input is None: return self.operation_map[input.operation_name]() else: diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_protocol.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_protocol.py index b188822b9..e9be890f4 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_protocol.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_protocol.py @@ -16,7 +16,6 @@ import smithy_dafny_standard_library.internaldafny.generated.Wrappers as Wrappers from typing import Union - class DafnyRequest: operation_name: str @@ -36,7 +35,6 @@ def __init__(self, operation_name, dafny_operation_input): self.operation_name = operation_name self.dafny_operation_input = dafny_operation_input - class DafnyResponse(Wrappers.Result): def __init__(self): super().__init__(self) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_to_smithy.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_to_smithy.py index 3f84327b0..0d78f2cf6 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_to_smithy.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/dafny_to_smithy.py @@ -13,296 +13,133 @@ def smithy_api_Unit(): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.Unit() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.Unit( ) - def aws_cryptography_keystore_CreateKeyStoreInput(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.CreateKeyStoreInput() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.CreateKeyStoreInput( ) - def aws_cryptography_keystore_CreateKeyInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.CreateKeyInput( - branch_key_identifier=( - ( - b"".join( - ord(c).to_bytes(2, "big") - for c in dafny_input.branchKeyIdentifier.value - ).decode("utf-16-be") - ) - if (dafny_input.branchKeyIdentifier.is_Some) - else None - ), - encryption_context=( - ( - { - bytes(key.Elements) - .decode("utf-8"): bytes(value.Elements) - .decode("utf-8") - for (key, value) in dafny_input.encryptionContext.value.items - } - ) - if (dafny_input.encryptionContext.is_Some) - else None - ), + branch_key_identifier=(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyIdentifier.value).decode('utf-16-be')) if (dafny_input.branchKeyIdentifier.is_Some) else None, + encryption_context=({bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.value.items }) if (dafny_input.encryptionContext.is_Some) else None, ) - def aws_cryptography_keystore_VersionKeyInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.VersionKeyInput( - branch_key_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyIdentifier - ).decode("utf-16-be"), + branch_key_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyIdentifier).decode('utf-16-be'), ) - def aws_cryptography_keystore_GetActiveBranchKeyInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.GetActiveBranchKeyInput( - branch_key_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyIdentifier - ).decode("utf-16-be"), + branch_key_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyIdentifier).decode('utf-16-be'), ) - def aws_cryptography_keystore_GetBranchKeyVersionInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.GetBranchKeyVersionInput( - branch_key_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyIdentifier - ).decode("utf-16-be"), - branch_key_version=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyVersion - ).decode("utf-16-be"), + branch_key_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyIdentifier).decode('utf-16-be'), + branch_key_version=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyVersion).decode('utf-16-be'), ) - def aws_cryptography_keystore_GetBeaconKeyInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.GetBeaconKeyInput( - branch_key_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyIdentifier - ).decode("utf-16-be"), + branch_key_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyIdentifier).decode('utf-16-be'), ) - def aws_cryptography_keystore_KMSConfiguration(dafny_input): # Convert KMSConfiguration if isinstance(dafny_input, KMSConfiguration_kmsKeyArn): - KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsKeyArn( - b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.kmsKeyArn).decode( - "utf-16-be" - ) - ) + KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsKeyArn(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.kmsKeyArn).decode('utf-16-be')) elif isinstance(dafny_input, KMSConfiguration_kmsMRKeyArn): - KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsMRKeyArn( - b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.kmsMRKeyArn).decode( - "utf-16-be" - ) - ) + KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsMRKeyArn(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.kmsMRKeyArn).decode('utf-16-be')) elif isinstance(dafny_input, KMSConfiguration_discovery): - KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationDiscovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_Discovery( - dafny_input.discovery - ) - ) + KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationDiscovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_Discovery(dafny_input.discovery)) elif isinstance(dafny_input, KMSConfiguration_mrDiscovery): - KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationMrDiscovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_MRDiscovery( - dafny_input.mrDiscovery - ) - ) + KMSConfiguration_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationMrDiscovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_MRDiscovery(dafny_input.mrDiscovery)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return KMSConfiguration_union_value - def aws_cryptography_keystore_Discovery(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.Discovery() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.Discovery( ) - def aws_cryptography_keystore_MRDiscovery(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.MRDiscovery( - region=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.region).decode( - "utf-16-be" - ), + region=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.region).decode('utf-16-be'), ) - def aws_cryptography_keystore_GetKeyStoreInfoOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.GetKeyStoreInfoOutput( - key_store_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyStoreId - ).decode("utf-16-be"), - key_store_name=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyStoreName - ).decode("utf-16-be"), - logical_key_store_name=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.logicalKeyStoreName - ).decode("utf-16-be"), - grant_tokens=[ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens - ], - kms_configuration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KMSConfiguration( - dafny_input.kmsConfiguration - ), + key_store_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyStoreId).decode('utf-16-be'), + key_store_name=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyStoreName).decode('utf-16-be'), + logical_key_store_name=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.logicalKeyStoreName).decode('utf-16-be'), + grant_tokens=[b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens], + kms_configuration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KMSConfiguration(dafny_input.kmsConfiguration), ) - def aws_cryptography_keystore_CreateKeyStoreOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.CreateKeyStoreOutput( - table_arn=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.tableArn - ).decode("utf-16-be"), + table_arn=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.tableArn).decode('utf-16-be'), ) - def aws_cryptography_keystore_CreateKeyOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.CreateKeyOutput( - branch_key_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyIdentifier - ).decode("utf-16-be"), + branch_key_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyIdentifier).decode('utf-16-be'), ) - def aws_cryptography_keystore_VersionKeyOutput(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.VersionKeyOutput() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.VersionKeyOutput( ) - def aws_cryptography_keystore_BranchKeyMaterials(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.BranchKeyMaterials( - branch_key_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyIdentifier - ).decode("utf-16-be"), - branch_key_version=bytes(dafny_input.branchKeyVersion.Elements).decode("utf-8"), - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, + branch_key_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyIdentifier).decode('utf-16-be'), + branch_key_version=bytes(dafny_input.branchKeyVersion.Elements).decode('utf-8'), + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, branch_key=bytes(dafny_input.branchKey), ) - def aws_cryptography_keystore_GetActiveBranchKeyOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.GetActiveBranchKeyOutput( - branch_key_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BranchKeyMaterials( - dafny_input.branchKeyMaterials - ), + branch_key_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BranchKeyMaterials(dafny_input.branchKeyMaterials), ) - def aws_cryptography_keystore_GetBranchKeyVersionOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.GetBranchKeyVersionOutput( - branch_key_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BranchKeyMaterials( - dafny_input.branchKeyMaterials - ), + branch_key_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BranchKeyMaterials(dafny_input.branchKeyMaterials), ) - def aws_cryptography_keystore_BeaconKeyMaterials(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.BeaconKeyMaterials( - beacon_key_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.beaconKeyIdentifier - ).decode("utf-16-be"), - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, - beacon_key=( - (bytes(dafny_input.beaconKey.value)) - if (dafny_input.beaconKey.is_Some) - else None - ), - hmac_keys=( - ( - { - b"".join(ord(c).to_bytes(2, "big") for c in key).decode( - "utf-16-be" - ): bytes(value) - for (key, value) in dafny_input.hmacKeys.value.items - } - ) - if (dafny_input.hmacKeys.is_Some) - else None - ), + beacon_key_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.beaconKeyIdentifier).decode('utf-16-be'), + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, + beacon_key=(bytes(dafny_input.beaconKey.value)) if (dafny_input.beaconKey.is_Some) else None, + hmac_keys=({b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): bytes(value) for (key, value) in dafny_input.hmacKeys.value.items }) if (dafny_input.hmacKeys.is_Some) else None, ) - def aws_cryptography_keystore_GetBeaconKeyOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.GetBeaconKeyOutput( - beacon_key_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BeaconKeyMaterials( - dafny_input.beaconKeyMaterials - ), + beacon_key_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BeaconKeyMaterials(dafny_input.beaconKeyMaterials), ) - def aws_cryptography_keystore_DdbClientReference(dafny_input): return dafny_input._impl - def aws_cryptography_keystore_KmsClientReference(dafny_input): return dafny_input._impl - def aws_cryptography_keystore_KeyStoreConfig(dafny_input): # Deferred import of .config to avoid circular dependency import aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.config - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.config.KeyStoreConfig( - ddb_table_name=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.ddbTableName - ).decode("utf-16-be"), - kms_configuration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KMSConfiguration( - dafny_input.kmsConfiguration - ), - logical_key_store_name=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.logicalKeyStoreName - ).decode("utf-16-be"), - id=( - ( - b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.id.value - ).decode("utf-16-be") - ) - if (dafny_input.id.is_Some) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), - ddb_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_DdbClientReference( - dafny_input.ddbClient.UnwrapOr(None) - ) - ) - if (dafny_input.ddbClient.UnwrapOr(None) is not None) - else None - ), - kms_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KmsClientReference( - dafny_input.kmsClient.UnwrapOr(None) - ) - ) - if (dafny_input.kmsClient.UnwrapOr(None) is not None) - else None - ), + ddb_table_name=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.ddbTableName).decode('utf-16-be'), + kms_configuration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KMSConfiguration(dafny_input.kmsConfiguration), + logical_key_store_name=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.logicalKeyStoreName).decode('utf-16-be'), + id=(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.id.value).decode('utf-16-be')) if (dafny_input.id.is_Some) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, + ddb_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_DdbClientReference(dafny_input.ddbClient.UnwrapOr(None))) if (dafny_input.ddbClient.UnwrapOr(None) is not None) else None, + kms_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_KmsClientReference(dafny_input.kmsClient.UnwrapOr(None))) if (dafny_input.kmsClient.UnwrapOr(None) is not None) else None, ) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/deserialize.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/deserialize.py index 559eda641..82917ac01 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/deserialize.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/deserialize.py @@ -39,66 +39,45 @@ def _deserialize_get_key_store_info(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetKeyStoreInfoOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetKeyStoreInfoOutput(input.value) def _deserialize_create_key_store(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_CreateKeyStoreOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_CreateKeyStoreOutput(input.value) def _deserialize_create_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_CreateKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_CreateKeyOutput(input.value) def _deserialize_version_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_VersionKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_VersionKeyOutput(input.value) def _deserialize_get_active_branch_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetActiveBranchKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetActiveBranchKeyOutput(input.value) def _deserialize_get_branch_key_version(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetBranchKeyVersionOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetBranchKeyVersionOutput(input.value) def _deserialize_get_beacon_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetBeaconKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_GetBeaconKeyOutput(input.value) def _deserialize_error(error: Error) -> ServiceError: if error.is_Opaque: @@ -109,12 +88,10 @@ def _deserialize_error(error: Error) -> ServiceError: list=[_deserialize_error(dafny_e) for dafny_e in error.list], ) elif error.is_KeyStoreException: - return KeyStoreException(message=_dafny.string_of(error.message)) + return KeyStoreException(message=_dafny.string_of(error.message)) elif error.is_ComAmazonawsKms: return ComAmazonawsKms(message=_dafny.string_of(error.ComAmazonawsKms.message)) elif error.is_ComAmazonawsDynamodb: - return ComAmazonawsDynamodb( - message=_dafny.string_of(error.ComAmazonawsDynamodb.message) - ) + return ComAmazonawsDynamodb(message=_dafny.string_of(error.ComAmazonawsDynamodb.message)) else: return OpaqueError(obj=error, alt_text=repr(error)) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/errors.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/errors.py index e06e72414..b14701bd2 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/errors.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/errors.py @@ -16,34 +16,27 @@ class ServiceError(Exception): - """Base error for all errors in the service.""" - + """Base error for all errors in the service. + """ pass - -T = TypeVar("T") - - +T = TypeVar('T') class ApiError(ServiceError, Generic[T]): - """Base error for all api errors in the service.""" - + """Base error for all api errors in the service. + """ code: T - def __init__(self, message: str): super().__init__(message) self.message = message - -class UnknownApiError(ApiError[Literal["Unknown"]]): - """Error representing any unknown api errors.""" - - code: Literal["Unknown"] = "Unknown" - +class UnknownApiError(ApiError[Literal['Unknown']]): + """Error representing any unknown api errors + """ + code: Literal['Unknown'] = 'Unknown' class KeyStoreException(ApiError[Literal["KeyStoreException"]]): code: Literal["KeyStoreException"] = "KeyStoreException" message: str - def __init__( self, *, @@ -52,17 +45,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the KeyStoreException to a dictionary.""" + """Converts the KeyStoreException to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyStoreException": - """Creates a KeyStoreException from a dictionary.""" + """Creates a KeyStoreException from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return KeyStoreException(**kwargs) @@ -77,65 +74,68 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KeyStoreException): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KeyStoreException(ApiError[Literal["KeyStoreException"]]): code: Literal["KeyStoreException"] = "KeyStoreException" message: str - class ComAmazonawsDynamodb(ApiError[Literal["ComAmazonawsDynamodb"]]): ComAmazonawsDynamodb: Any - class ComAmazonawsKms(ApiError[Literal["ComAmazonawsKms"]]): ComAmazonawsKms: Any - class CollectionOfErrors(ApiError[Literal["CollectionOfErrors"]]): code: Literal["CollectionOfErrors"] = "CollectionOfErrors" message: str list: List[ServiceError] - def __init__(self, *, message: str, list): + def __init__( + self, + *, + message: str, + list + ): super().__init__(message) self.list = list def as_dict(self) -> Dict[str, Any]: """Converts the CollectionOfErrors to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "list": self.list, + 'message': self.message, + 'code': self.code, + 'list': self.list, } @staticmethod def from_dict(d: Dict[str, Any]) -> "CollectionOfErrors": """Creates a CollectionOfErrors from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ - kwargs: Dict[str, Any] = {"message": d["message"], "list": d["list"]} + kwargs: Dict[str, Any] = { + 'message': d['message'], + 'list': d['list'] + } return CollectionOfErrors(**kwargs) def __repr__(self) -> str: result = "CollectionOfErrors(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"list={self.list}" + result += f'list={self.list}' result += ")" return result @@ -144,15 +144,22 @@ def __eq__(self, other: Any) -> bool: return False if not (self.list == other.list): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OpaqueError(ApiError[Literal["OpaqueError"]]): code: Literal["OpaqueError"] = "OpaqueError" obj: Any # As an OpaqueError, type of obj is unknown - def __init__(self, *, obj, alt_text): + def __init__( + self, + *, + obj, + alt_text + ): super().__init__("") self.obj = obj self.alt_text = alt_text @@ -160,38 +167,37 @@ def __init__(self, *, obj, alt_text): def as_dict(self) -> Dict[str, Any]: """Converts the OpaqueError to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "obj": self.obj, - "alt_text": self.alt_text, + 'message': self.message, + 'code': self.code, + 'obj': self.obj, + 'alt_text': self.alt_text, } @staticmethod def from_dict(d: Dict[str, Any]) -> "OpaqueError": """Creates a OpaqueError from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ kwargs: Dict[str, Any] = { - "message": d["message"], - "obj": d["obj"], - "alt_text": d["alt_text"], + 'message': d['message'], + 'obj': d['obj'], + 'alt_text': d['alt_text'] } return OpaqueError(**kwargs) def __repr__(self) -> str: result = "OpaqueError(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"obj={self.alt_text}" + result += f'obj={self.alt_text}' result += ")" return result @@ -200,53 +206,42 @@ def __eq__(self, other: Any) -> bool: return False if not (self.obj == other.obj): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) def _smithy_error_to_dafny_error(e: ServiceError): - """Converts the provided native Smithy-modeled error into the corresponding - Dafny error.""" - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.errors.KeyStoreException, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_KeyStoreException( - message=_dafny.Seq(e.message) - ) + """ + Converts the provided native Smithy-modeled error + into the corresponding Dafny error. + """ + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.errors.KeyStoreException): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_KeyStoreException(message=_dafny.Seq(e.message)) if isinstance(e, ComAmazonawsDynamodb): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_ComAmazonawsDynamodb( - com_amazonaws_dynamodb_sdk_error_to_dafny_error(e.message) - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_ComAmazonawsDynamodb(com_amazonaws_dynamodb_sdk_error_to_dafny_error(e.message)) if isinstance(e, ComAmazonawsKms): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_ComAmazonawsKms( - com_amazonaws_kms_sdk_error_to_dafny_error(e.message) - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_ComAmazonawsKms(com_amazonaws_kms_sdk_error_to_dafny_error(e.message)) if isinstance(e, CollectionOfErrors): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_CollectionOfErrors( - message=_dafny.Seq(e.message), - list=_dafny.Seq( - _smithy_error_to_dafny_error(native_err) for native_err in e.list - ), - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_CollectionOfErrors(message=_dafny.Seq(e.message), list=_dafny.Seq( + _smithy_error_to_dafny_error(native_err) for native_err in e.list + )) if isinstance(e, OpaqueError): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_Opaque( - obj=e.obj, alt__text=e.alt_text - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_Opaque(obj=e.obj, alt__text=e.alt_text) else: - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_Opaque( - obj=e, - alt__text=_dafny.Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip(*[iter(repr(e).encode("utf-16-be"))] * 2) - ] - ) - ), - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyKeyStoreTypes.Error_Opaque(obj=e, alt__text=_dafny.Seq( + "".join( + [ + chr(int.from_bytes(pair, "big")) + for pair in zip( + *[iter(repr(e).encode("utf-16-be"))] * 2 + ) + ] + ) + )) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/models.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/models.py index aa4095773..1ca9d03b9 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/models.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/models.py @@ -10,7 +10,6 @@ class BeaconKeyMaterials: encryption_context: dict[str, str] beacon_key: Optional[bytes | bytearray] hmac_keys: Optional[dict[str, bytes | bytearray]] - def __init__( self, *, @@ -25,7 +24,9 @@ def __init__( self.hmac_keys = hmac_keys def as_dict(self) -> Dict[str, Any]: - """Converts the BeaconKeyMaterials to a dictionary.""" + """Converts the BeaconKeyMaterials to a dictionary. + + """ d: Dict[str, Any] = { "beacon_key_identifier": self.beacon_key_identifier, "encryption_context": self.encryption_context, @@ -41,7 +42,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "BeaconKeyMaterials": - """Creates a BeaconKeyMaterials from a dictionary.""" + """Creates a BeaconKeyMaterials from a dictionary. + + """ kwargs: Dict[str, Any] = { "beacon_key_identifier": d["beacon_key_identifier"], "encryption_context": d["encryption_context"], @@ -74,21 +77,17 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, BeaconKeyMaterials): return False - attributes: list[str] = [ - "beacon_key_identifier", - "encryption_context", - "beacon_key", - "hmac_keys", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['beacon_key_identifier','encryption_context','beacon_key','hmac_keys',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class BranchKeyMaterials: branch_key_identifier: str branch_key_version: str encryption_context: dict[str, str] branch_key: bytes | bytearray - def __init__( self, *, @@ -103,7 +102,9 @@ def __init__( self.branch_key = branch_key def as_dict(self) -> Dict[str, Any]: - """Converts the BranchKeyMaterials to a dictionary.""" + """Converts the BranchKeyMaterials to a dictionary. + + """ return { "branch_key_identifier": self.branch_key_identifier, "branch_key_version": self.branch_key_version, @@ -113,7 +114,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "BranchKeyMaterials": - """Creates a BranchKeyMaterials from a dictionary.""" + """Creates a BranchKeyMaterials from a dictionary. + + """ kwargs: Dict[str, Any] = { "branch_key_identifier": d["branch_key_identifier"], "branch_key_version": d["branch_key_version"], @@ -142,19 +145,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, BranchKeyMaterials): return False - attributes: list[str] = [ - "branch_key_identifier", - "branch_key_version", - "encryption_context", - "branch_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_identifier','branch_key_version','encryption_context','branch_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateKeyInput: branch_key_identifier: Optional[str] encryption_context: Optional[dict[str, str]] - def __init__( self, *, @@ -170,7 +169,9 @@ def __init__( self.encryption_context = encryption_context def as_dict(self) -> Dict[str, Any]: - """Converts the CreateKeyInput to a dictionary.""" + """Converts the CreateKeyInput to a dictionary. + + """ d: Dict[str, Any] = {} if self.branch_key_identifier is not None: @@ -183,7 +184,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateKeyInput": - """Creates a CreateKeyInput from a dictionary.""" + """Creates a CreateKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "branch_key_identifier" in d: @@ -207,16 +210,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateKeyInput): return False - attributes: list[str] = [ - "branch_key_identifier", - "encryption_context", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_identifier','encryption_context',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateKeyOutput: branch_key_identifier: str - def __init__( self, *, @@ -224,20 +225,23 @@ def __init__( ): """Outputs for Branch Key creation. - :param branch_key_identifier: A identifier for the created - Branch Key. + :param branch_key_identifier: A identifier for the created Branch Key. """ self.branch_key_identifier = branch_key_identifier def as_dict(self) -> Dict[str, Any]: - """Converts the CreateKeyOutput to a dictionary.""" + """Converts the CreateKeyOutput to a dictionary. + + """ return { "branch_key_identifier": self.branch_key_identifier, } @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateKeyOutput": - """Creates a CreateKeyOutput from a dictionary.""" + """Creates a CreateKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "branch_key_identifier": d["branch_key_identifier"], } @@ -254,20 +258,24 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateKeyOutput): return False - attributes: list[str] = [ - "branch_key_identifier", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_identifier',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateKeyStoreInput: def as_dict(self) -> Dict[str, Any]: - """Converts the CreateKeyStoreInput to a dictionary.""" + """Converts the CreateKeyStoreInput to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateKeyStoreInput": - """Creates a CreateKeyStoreInput from a dictionary.""" + """Creates a CreateKeyStoreInput from a dictionary. + + """ return CreateKeyStoreInput() def __repr__(self) -> str: @@ -278,10 +286,8 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, CreateKeyStoreInput) - class CreateKeyStoreOutput: table_arn: str - def __init__( self, *, @@ -289,20 +295,29 @@ def __init__( ): """Outputs for Key Store DynamoDB table creation. - :param table_arn: The ARN of the DynamoDB table that backs this - Key Store. + :param table_arn: The ARN of the DynamoDB table that backs this Key Store. """ + if (table_arn is not None) and (len(table_arn) < 1): + raise ValueError("The size of table_arn must be greater than or equal to 1") + + if (table_arn is not None) and (len(table_arn) > 1024): + raise ValueError("The size of table_arn must be less than or equal to 1024") + self.table_arn = table_arn def as_dict(self) -> Dict[str, Any]: - """Converts the CreateKeyStoreOutput to a dictionary.""" + """Converts the CreateKeyStoreOutput to a dictionary. + + """ return { "table_arn": self.table_arn, } @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateKeyStoreOutput": - """Creates a CreateKeyStoreOutput from a dictionary.""" + """Creates a CreateKeyStoreOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "table_arn": d["table_arn"], } @@ -319,20 +334,24 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateKeyStoreOutput): return False - attributes: list[str] = [ - "table_arn", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['table_arn',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class Discovery: def as_dict(self) -> Dict[str, Any]: - """Converts the Discovery to a dictionary.""" + """Converts the Discovery to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "Discovery": - """Creates a Discovery from a dictionary.""" + """Creates a Discovery from a dictionary. + + """ return Discovery() def __repr__(self) -> str: @@ -343,10 +362,8 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, Discovery) - class GetActiveBranchKeyInput: branch_key_identifier: str - def __init__( self, *, @@ -354,20 +371,24 @@ def __init__( ): """Inputs for getting a Branch Key's ACTIVE version. - :param branch_key_identifier: The identifier for the Branch Key - to get the ACTIVE version for. + :param branch_key_identifier: The identifier for the Branch Key to get the + ACTIVE version for. """ self.branch_key_identifier = branch_key_identifier def as_dict(self) -> Dict[str, Any]: - """Converts the GetActiveBranchKeyInput to a dictionary.""" + """Converts the GetActiveBranchKeyInput to a dictionary. + + """ return { "branch_key_identifier": self.branch_key_identifier, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetActiveBranchKeyInput": - """Creates a GetActiveBranchKeyInput from a dictionary.""" + """Creates a GetActiveBranchKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "branch_key_identifier": d["branch_key_identifier"], } @@ -384,15 +405,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetActiveBranchKeyInput): return False - attributes: list[str] = [ - "branch_key_identifier", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_identifier',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetActiveBranchKeyOutput: branch_key_materials: BranchKeyMaterials - def __init__( self, *, @@ -405,18 +425,20 @@ def __init__( self.branch_key_materials = branch_key_materials def as_dict(self) -> Dict[str, Any]: - """Converts the GetActiveBranchKeyOutput to a dictionary.""" + """Converts the GetActiveBranchKeyOutput to a dictionary. + + """ return { "branch_key_materials": self.branch_key_materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetActiveBranchKeyOutput": - """Creates a GetActiveBranchKeyOutput from a dictionary.""" + """Creates a GetActiveBranchKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "branch_key_materials": BranchKeyMaterials.from_dict( - d["branch_key_materials"] - ), + "branch_key_materials": BranchKeyMaterials.from_dict(d["branch_key_materials"]), } return GetActiveBranchKeyOutput(**kwargs) @@ -431,36 +453,39 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetActiveBranchKeyOutput): return False - attributes: list[str] = [ - "branch_key_materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetBeaconKeyInput: branch_key_identifier: str - def __init__( self, *, branch_key_identifier: str, ): - """Inputs for getting a Beacon Key. + """Inputs for getting a Beacon Key - :param branch_key_identifier: The identifier of the Branch Key - the Beacon Key is associated with. + :param branch_key_identifier: The identifier of the Branch Key the Beacon Key is + associated with. """ self.branch_key_identifier = branch_key_identifier def as_dict(self) -> Dict[str, Any]: - """Converts the GetBeaconKeyInput to a dictionary.""" + """Converts the GetBeaconKeyInput to a dictionary. + + """ return { "branch_key_identifier": self.branch_key_identifier, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetBeaconKeyInput": - """Creates a GetBeaconKeyInput from a dictionary.""" + """Creates a GetBeaconKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "branch_key_identifier": d["branch_key_identifier"], } @@ -477,39 +502,40 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetBeaconKeyInput): return False - attributes: list[str] = [ - "branch_key_identifier", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_identifier',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetBeaconKeyOutput: beacon_key_materials: BeaconKeyMaterials - def __init__( self, *, beacon_key_materials: BeaconKeyMaterials, ): - """Outputs for getting a Beacon Key. + """Outputs for getting a Beacon Key :param beacon_key_materials: The materials for the Beacon Key. """ self.beacon_key_materials = beacon_key_materials def as_dict(self) -> Dict[str, Any]: - """Converts the GetBeaconKeyOutput to a dictionary.""" + """Converts the GetBeaconKeyOutput to a dictionary. + + """ return { "beacon_key_materials": self.beacon_key_materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetBeaconKeyOutput": - """Creates a GetBeaconKeyOutput from a dictionary.""" + """Creates a GetBeaconKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "beacon_key_materials": BeaconKeyMaterials.from_dict( - d["beacon_key_materials"] - ), + "beacon_key_materials": BeaconKeyMaterials.from_dict(d["beacon_key_materials"]), } return GetBeaconKeyOutput(**kwargs) @@ -524,16 +550,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetBeaconKeyOutput): return False - attributes: list[str] = [ - "beacon_key_materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['beacon_key_materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetBranchKeyVersionInput: branch_key_identifier: str branch_key_version: str - def __init__( self, *, @@ -542,15 +567,17 @@ def __init__( ): """Inputs for getting a version of a Branch Key. - :param branch_key_identifier: The identifier for the Branch Key - to get a particular version for. + :param branch_key_identifier: The identifier for the Branch Key to get a + particular version for. :param branch_key_version: The version to get. """ self.branch_key_identifier = branch_key_identifier self.branch_key_version = branch_key_version def as_dict(self) -> Dict[str, Any]: - """Converts the GetBranchKeyVersionInput to a dictionary.""" + """Converts the GetBranchKeyVersionInput to a dictionary. + + """ return { "branch_key_identifier": self.branch_key_identifier, "branch_key_version": self.branch_key_version, @@ -558,7 +585,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GetBranchKeyVersionInput": - """Creates a GetBranchKeyVersionInput from a dictionary.""" + """Creates a GetBranchKeyVersionInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "branch_key_identifier": d["branch_key_identifier"], "branch_key_version": d["branch_key_version"], @@ -579,16 +608,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetBranchKeyVersionInput): return False - attributes: list[str] = [ - "branch_key_identifier", - "branch_key_version", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_identifier','branch_key_version',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetBranchKeyVersionOutput: branch_key_materials: BranchKeyMaterials - def __init__( self, *, @@ -601,18 +628,20 @@ def __init__( self.branch_key_materials = branch_key_materials def as_dict(self) -> Dict[str, Any]: - """Converts the GetBranchKeyVersionOutput to a dictionary.""" + """Converts the GetBranchKeyVersionOutput to a dictionary. + + """ return { "branch_key_materials": self.branch_key_materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetBranchKeyVersionOutput": - """Creates a GetBranchKeyVersionOutput from a dictionary.""" + """Creates a GetBranchKeyVersionOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "branch_key_materials": BranchKeyMaterials.from_dict( - d["branch_key_materials"] - ), + "branch_key_materials": BranchKeyMaterials.from_dict(d["branch_key_materials"]), } return GetBranchKeyVersionOutput(**kwargs) @@ -627,15 +656,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetBranchKeyVersionOutput): return False - attributes: list[str] = [ - "branch_key_materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class MRDiscovery: region: str - def __init__( self, *, @@ -653,14 +681,18 @@ def __init__( self.region = region def as_dict(self) -> Dict[str, Any]: - """Converts the MRDiscovery to a dictionary.""" + """Converts the MRDiscovery to a dictionary. + + """ return { "region": self.region, } @staticmethod def from_dict(d: Dict[str, Any]) -> "MRDiscovery": - """Creates a MRDiscovery from a dictionary.""" + """Creates a MRDiscovery from a dictionary. + + """ kwargs: Dict[str, Any] = { "region": d["region"], } @@ -677,22 +709,19 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, MRDiscovery): return False - attributes: list[str] = [ - "region", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class KMSConfigurationKmsKeyArn: - """Key Store is restricted to only this KMS Key ARN. - - If a different KMS Key ARN is encountered when creating, versioning, - or getting a Branch Key or Beacon Key, KMS is never called and an - exception is thrown. While a Multi-Region Key (MKR) may be provided, - the whole ARN, including the Region, is persisted in Branch Keys and - MUST strictly equal this value to be considered valid. + attributes: list[str] = ['region',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) + +class KMSConfigurationKmsKeyArn(): + """Key Store is restricted to only this KMS Key ARN. If a different KMS Key ARN is + encountered when creating, versioning, or getting a Branch Key or Beacon Key, + KMS is never called and an exception is thrown. While a Multi-Region Key (MKR) + may be provided, the whole ARN, including the Region, is persisted in Branch + Keys and MUST strictly equal this value to be considered valid. """ - def __init__(self, value: str): if (value is not None) and (len(value) < 1): raise ValueError("The size of value must be greater than or equal to 1") @@ -707,7 +736,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KMSConfigurationKmsKeyArn": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KMSConfigurationKmsKeyArn(d["kmsKeyArn"]) @@ -720,16 +749,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KMSConfigurationKmsMRKeyArn: - """If an MRK ARN is provided, and the Key Store table holds an MRK ARN, - then those two ARNs may differ in region, although they must be otherwise - equal. - - If either ARN is not an MRK ARN, then mrkKmsKeyArn behaves exactly - as kmsKeyArn. +class KMSConfigurationKmsMRKeyArn(): + """If an MRK ARN is provided, and the Key Store table holds an MRK ARN, then those + two ARNs may differ in region, although they must be otherwise equal. If either + ARN is not an MRK ARN, then mrkKmsKeyArn behaves exactly as kmsKeyArn. """ - def __init__(self, value: str): if (value is not None) and (len(value) < 1): raise ValueError("The size of value must be greater than or equal to 1") @@ -744,7 +768,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KMSConfigurationKmsMRKeyArn": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KMSConfigurationKmsMRKeyArn(d["kmsMRKeyArn"]) @@ -757,18 +781,13 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KMSConfigurationDiscovery: - """The Key Store can use the KMS Key ARNs already persisted in the Backing - Table. - - The VersionKey and CreateKey Operations are NOT supported and will - fail with a runtime exception. There is no Multi-Region logic with - this configuration; if a Multi-Region Key is encountered, and the - region in the ARN is not the region of the KMS Client, requests will - Fail with KMS Exceptions. +class KMSConfigurationDiscovery(): + """The Key Store can use the KMS Key ARNs already persisted in the Backing Table. + The VersionKey and CreateKey Operations are NOT supported and will fail with a + runtime exception. There is no Multi-Region logic with this configuration; if a + Multi-Region Key is encountered, and the region in the ARN is not the region of + the KMS Client, requests will Fail with KMS Exceptions. """ - def __init__(self, value: Discovery): self.value = value @@ -777,7 +796,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KMSConfigurationDiscovery": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KMSConfigurationDiscovery(Discovery.from_dict(d["discovery"])) @@ -790,16 +809,12 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KMSConfigurationMrDiscovery: - """The Key Store can use the KMS Key ARNs already persisted in the Backing - Table. - - The VersionKey and CreateKey Operations are NOT supported and will - fail with a runtime exception. If a Multi-Region Key is encountered, - the region in the ARN is changed to the configured region. +class KMSConfigurationMrDiscovery(): + """The Key Store can use the KMS Key ARNs already persisted in the Backing Table. + The VersionKey and CreateKey Operations are NOT supported and will fail with a + runtime exception. If a Multi-Region Key is encountered, the region in the ARN + is changed to the configured region. """ - def __init__(self, value: MRDiscovery): self.value = value @@ -808,7 +823,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KMSConfigurationMrDiscovery": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KMSConfigurationMrDiscovery(MRDiscovery.from_dict(d["mrDiscovery"])) @@ -821,12 +836,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KMSConfigurationUnknown: +class KMSConfigurationUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -839,24 +853,15 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KMSConfigurationUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KMSConfigurationUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"KMSConfigurationUnknown(tag={self.tag})" - # Configures Key Store's KMS Key ARN restrictions. -KMSConfiguration = Union[ - KMSConfigurationKmsKeyArn, - KMSConfigurationKmsMRKeyArn, - KMSConfigurationDiscovery, - KMSConfigurationMrDiscovery, - KMSConfigurationUnknown, -] - - +KMSConfiguration = Union[KMSConfigurationKmsKeyArn, KMSConfigurationKmsMRKeyArn, KMSConfigurationDiscovery, KMSConfigurationMrDiscovery, KMSConfigurationUnknown] def _kms_configuration_from_dict(d: Dict[str, Any]) -> KMSConfiguration: if "kmsKeyArn" in d: return KMSConfigurationKmsKeyArn.from_dict(d) @@ -870,8 +875,7 @@ def _kms_configuration_from_dict(d: Dict[str, Any]) -> KMSConfiguration: if "mrDiscovery" in d: return KMSConfigurationMrDiscovery.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class GetKeyStoreInfoOutput: key_store_id: str @@ -879,7 +883,6 @@ class GetKeyStoreInfoOutput: logical_key_store_name: str grant_tokens: list[str] kms_configuration: KMSConfiguration - def __init__( self, *, @@ -892,26 +895,19 @@ def __init__( """The configuration information for a Key Store. :param key_store_id: An identifier for this Key Store. - :param key_store_name: The DynamoDB table name that backs this - Key Store. - :param logical_key_store_name: The logical name for this Key - Store, which is cryptographically bound to the keys it - holds. - :param grant_tokens: The AWS KMS grant tokens that are used when - this Key Store calls to AWS KMS. - :param kms_configuration: Configures Key Store's KMS Key ARN - restrictions. + :param key_store_name: The DynamoDB table name that backs this Key Store. + :param logical_key_store_name: The logical name for this Key Store, which is + cryptographically bound to the keys it holds. + :param grant_tokens: The AWS KMS grant tokens that are used when this Key Store + calls to AWS KMS. + :param kms_configuration: Configures Key Store's KMS Key ARN restrictions. """ self.key_store_id = key_store_id if (key_store_name is not None) and (len(key_store_name) < 3): - raise ValueError( - "The size of key_store_name must be greater than or equal to 3" - ) + raise ValueError("The size of key_store_name must be greater than or equal to 3") if (key_store_name is not None) and (len(key_store_name) > 255): - raise ValueError( - "The size of key_store_name must be less than or equal to 255" - ) + raise ValueError("The size of key_store_name must be less than or equal to 255") self.key_store_name = key_store_name self.logical_key_store_name = logical_key_store_name @@ -919,7 +915,9 @@ def __init__( self.kms_configuration = kms_configuration def as_dict(self) -> Dict[str, Any]: - """Converts the GetKeyStoreInfoOutput to a dictionary.""" + """Converts the GetKeyStoreInfoOutput to a dictionary. + + """ return { "key_store_id": self.key_store_id, "key_store_name": self.key_store_name, @@ -930,7 +928,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GetKeyStoreInfoOutput": - """Creates a GetKeyStoreInfoOutput from a dictionary.""" + """Creates a GetKeyStoreInfoOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_store_id": d["key_store_id"], "key_store_name": d["key_store_name"], @@ -963,19 +963,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetKeyStoreInfoOutput): return False - attributes: list[str] = [ - "key_store_id", - "key_store_name", - "logical_key_store_name", - "grant_tokens", - "kms_configuration", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_store_id','key_store_name','logical_key_store_name','grant_tokens','kms_configuration',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class VersionKeyInput: branch_key_identifier: str - def __init__( self, *, @@ -983,20 +978,23 @@ def __init__( ): """Inputs for versioning a Branch Key. - :param branch_key_identifier: The identifier for the Branch Key - to be versioned. + :param branch_key_identifier: The identifier for the Branch Key to be versioned. """ self.branch_key_identifier = branch_key_identifier def as_dict(self) -> Dict[str, Any]: - """Converts the VersionKeyInput to a dictionary.""" + """Converts the VersionKeyInput to a dictionary. + + """ return { "branch_key_identifier": self.branch_key_identifier, } @staticmethod def from_dict(d: Dict[str, Any]) -> "VersionKeyInput": - """Creates a VersionKeyInput from a dictionary.""" + """Creates a VersionKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "branch_key_identifier": d["branch_key_identifier"], } @@ -1013,22 +1011,26 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, VersionKeyInput): return False - attributes: list[str] = [ - "branch_key_identifier", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_identifier',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class VersionKeyOutput: - """Outputs for versioning a Branch Key.""" - + """Outputs for versioning a Branch Key. + """ def as_dict(self) -> Dict[str, Any]: - """Converts the VersionKeyOutput to a dictionary.""" + """Converts the VersionKeyOutput to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "VersionKeyOutput": - """Creates a VersionKeyOutput from a dictionary.""" + """Creates a VersionKeyOutput from a dictionary. + + """ return VersionKeyOutput() def __repr__(self) -> str: @@ -1039,6 +1041,5 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, VersionKeyOutput) - class Unit: pass diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/plugin.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/plugin.py index 206e81b1a..1128dabef 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/plugin.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/plugin.py @@ -7,37 +7,29 @@ from smithy_python.exceptions import SmithyRetryException from .dafnyImplInterface import DafnyImplInterface - def set_config_impl(config: Config): - """Set the Dafny-compiled implementation in the Smithy-Python client Config - and load our custom NoRetriesStrategy.""" + """ + Set the Dafny-compiled implementation in the Smithy-Python client Config + and load our custom NoRetriesStrategy. + """ config.dafnyImplInterface = DafnyImplInterface() if isinstance(config, KeyStoreConfig): - from aws_cryptographic_material_providers.internaldafny.generated.KeyStore import ( - default__, - ) - - config.dafnyImplInterface.impl = default__.KeyStore( - smithy_config_to_dafny_config(config) - ).value + from aws_cryptographic_material_providers.internaldafny.generated.KeyStore import default__ + config.dafnyImplInterface.impl = default__.KeyStore(smithy_config_to_dafny_config(config)).value config.retry_strategy = NoRetriesStrategy() - class ZeroRetryDelayToken: - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not wait to retry. """ - retry_delay = 0 - class NoRetriesStrategy(RetryStrategy): - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not retry calling Dafny code. """ - def acquire_initial_retry_token(self): return ZeroRetryDelayToken() diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/serialize.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/serialize.py index 19adcfc2c..f783d3100 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/serialize.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/serialize.py @@ -12,56 +12,20 @@ def _serialize_get_key_store_info(input, config: Config) -> DafnyRequest: return DafnyRequest(operation_name="GetKeyStoreInfo", dafny_operation_input=None) - def _serialize_create_key_store(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateKeyStore", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_CreateKeyStoreInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateKeyStore", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_CreateKeyStoreInput(input)) def _serialize_create_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateKey", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_CreateKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateKey", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_CreateKeyInput(input)) def _serialize_version_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="VersionKey", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_VersionKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="VersionKey", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_VersionKeyInput(input)) def _serialize_get_active_branch_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GetActiveBranchKey", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_GetActiveBranchKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="GetActiveBranchKey", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_GetActiveBranchKeyInput(input)) def _serialize_get_branch_key_version(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GetBranchKeyVersion", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_GetBranchKeyVersionInput( - input - ), - ) - + return DafnyRequest(operation_name="GetBranchKeyVersion", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_GetBranchKeyVersionInput(input)) def _serialize_get_beacon_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GetBeaconKey", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_GetBeaconKeyInput( - input - ), - ) + return DafnyRequest(operation_name="GetBeaconKey", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_GetBeaconKeyInput(input)) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/smithy_to_dafny.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/smithy_to_dafny.py index fb600a8ae..a1c12bb8f 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/smithy_to_dafny.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_keystore/smithy_to_dafny.py @@ -47,518 +47,133 @@ def smithy_api_Unit(native_input): return None - def aws_cryptography_keystore_CreateKeyStoreInput(native_input): - return DafnyCreateKeyStoreInput() - + return DafnyCreateKeyStoreInput( + ) def aws_cryptography_keystore_CreateKeyInput(native_input): return DafnyCreateKeyInput( - branchKeyIdentifier=( - ( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input.branch_key_identifier.encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - ) - if (native_input.branch_key_identifier is not None) - else (Option_None()) - ), - encryptionContext=( - ( - Option_Some( - Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ) - ) - ) - if (native_input.encryption_context is not None) - else (Option_None()) - ), + branchKeyIdentifier=((Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_identifier.encode('utf-16-be'))]*2)])))) if (native_input.branch_key_identifier is not None) else (Option_None())), + encryptionContext=((Option_Some(Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }))) if (native_input.encryption_context is not None) else (Option_None())), ) - def aws_cryptography_keystore_VersionKeyInput(native_input): return DafnyVersionKeyInput( - branchKeyIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + branchKeyIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_identifier.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_keystore_GetActiveBranchKeyInput(native_input): return DafnyGetActiveBranchKeyInput( - branchKeyIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + branchKeyIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_identifier.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_keystore_GetBranchKeyVersionInput(native_input): return DafnyGetBranchKeyVersionInput( - branchKeyIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - branchKeyVersion=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_version.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + branchKeyIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_identifier.encode('utf-16-be'))]*2)])), + branchKeyVersion=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_version.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_keystore_GetBeaconKeyInput(native_input): return DafnyGetBeaconKeyInput( - branchKeyIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + branchKeyIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_identifier.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_keystore_GetKeyStoreInfoOutput(native_input): return DafnyGetKeyStoreInfoOutput( - keyStoreId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_store_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - keyStoreName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_store_name.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - logicalKeyStoreName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.logical_key_store_name.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - grantTokens=Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ), - kmsConfiguration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KMSConfiguration( - native_input.kms_configuration - ), + keyStoreId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_store_id.encode('utf-16-be'))]*2)])), + keyStoreName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_store_name.encode('utf-16-be'))]*2)])), + logicalKeyStoreName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.logical_key_store_name.encode('utf-16-be'))]*2)])), + grantTokens=Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]), + kmsConfiguration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KMSConfiguration(native_input.kms_configuration), ) - def aws_cryptography_keystore_KMSConfiguration(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsKeyArn, - ): - KMSConfiguration_union_value = KMSConfiguration_kmsKeyArn( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsMRKeyArn, - ): - KMSConfiguration_union_value = KMSConfiguration_kmsMRKeyArn( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationDiscovery, - ): - KMSConfiguration_union_value = KMSConfiguration_discovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_Discovery( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationMrDiscovery, - ): - KMSConfiguration_union_value = KMSConfiguration_mrDiscovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_MRDiscovery( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsKeyArn): + KMSConfiguration_union_value = KMSConfiguration_kmsKeyArn(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.value.encode('utf-16-be'))]*2)]))) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationKmsMRKeyArn): + KMSConfiguration_union_value = KMSConfiguration_kmsMRKeyArn(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.value.encode('utf-16-be'))]*2)]))) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationDiscovery): + KMSConfiguration_union_value = KMSConfiguration_discovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_Discovery(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.models.KMSConfigurationMrDiscovery): + KMSConfiguration_union_value = KMSConfiguration_mrDiscovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_MRDiscovery(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return KMSConfiguration_union_value - def aws_cryptography_keystore_Discovery(native_input): - return DafnyDiscovery() - + return DafnyDiscovery( + ) def aws_cryptography_keystore_MRDiscovery(native_input): return DafnyMRDiscovery( - region=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.region.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + region=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.region.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_keystore_CreateKeyStoreOutput(native_input): return DafnyCreateKeyStoreOutput( - tableArn=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.table_arn.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + tableArn=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.table_arn.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_keystore_CreateKeyOutput(native_input): return DafnyCreateKeyOutput( - branchKeyIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + branchKeyIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_identifier.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_keystore_VersionKeyOutput(native_input): - return DafnyVersionKeyOutput() - + return DafnyVersionKeyOutput( + ) def aws_cryptography_keystore_GetActiveBranchKeyOutput(native_input): return DafnyGetActiveBranchKeyOutput( - branchKeyMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BranchKeyMaterials( - native_input.branch_key_materials - ), + branchKeyMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BranchKeyMaterials(native_input.branch_key_materials), ) - def aws_cryptography_keystore_BranchKeyMaterials(native_input): return DafnyBranchKeyMaterials( - branchKeyIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - branchKeyVersion=Seq(native_input.branch_key_version.encode("utf-8")), - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), + branchKeyIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_identifier.encode('utf-16-be'))]*2)])), + branchKeyVersion=Seq(native_input.branch_key_version.encode('utf-8')), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), branchKey=Seq(native_input.branch_key), ) - def aws_cryptography_keystore_GetBranchKeyVersionOutput(native_input): return DafnyGetBranchKeyVersionOutput( - branchKeyMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BranchKeyMaterials( - native_input.branch_key_materials - ), + branchKeyMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BranchKeyMaterials(native_input.branch_key_materials), ) - def aws_cryptography_keystore_GetBeaconKeyOutput(native_input): return DafnyGetBeaconKeyOutput( - beaconKeyMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BeaconKeyMaterials( - native_input.beacon_key_materials - ), + beaconKeyMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BeaconKeyMaterials(native_input.beacon_key_materials), ) - def aws_cryptography_keystore_BeaconKeyMaterials(native_input): return DafnyBeaconKeyMaterials( - beaconKeyIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.beacon_key_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), - beaconKey=( - (Option_Some(Seq(native_input.beacon_key))) - if (native_input.beacon_key is not None) - else (Option_None()) - ), - hmacKeys=( - ( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq(value) - for (key, value) in native_input.hmac_keys.items() - } - ) - ) - ) - if (native_input.hmac_keys is not None) - else (Option_None()) - ), + beaconKeyIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.beacon_key_identifier.encode('utf-16-be'))]*2)])), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), + beaconKey=((Option_Some(Seq(native_input.beacon_key))) if (native_input.beacon_key is not None) else (Option_None())), + hmacKeys=((Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(value) for (key, value) in native_input.hmac_keys.items() }))) if (native_input.hmac_keys is not None) else (Option_None())), ) - def aws_cryptography_keystore_KeyStoreConfig(native_input): return DafnyKeyStoreConfig( - ddbTableName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.ddb_table_name.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - kmsConfiguration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KMSConfiguration( - native_input.kms_configuration - ), - logicalKeyStoreName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.logical_key_store_name.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - id=( - ( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.id.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - ) - if (native_input.id is not None) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), - ddbClient=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_DdbClientReference( - native_input.ddb_client - ) - ) - ) - if ( - (native_input.ddb_client is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_DdbClientReference( - native_input.ddb_client - ) - is not None - ) - ) - else (Option_None()) - ), - kmsClient=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KmsClientReference( - native_input.kms_client - ) - ) - ) - if ( - (native_input.kms_client is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KmsClientReference( - native_input.kms_client - ) - is not None - ) - ) - else (Option_None()) - ), + ddbTableName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.ddb_table_name.encode('utf-16-be'))]*2)])), + kmsConfiguration=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KMSConfiguration(native_input.kms_configuration), + logicalKeyStoreName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.logical_key_store_name.encode('utf-16-be'))]*2)])), + id=((Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.id.encode('utf-16-be'))]*2)])))) if (native_input.id is not None) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), + ddbClient=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_DdbClientReference(native_input.ddb_client))) if ((native_input.ddb_client is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_DdbClientReference(native_input.ddb_client) is not None)) else (Option_None())), + kmsClient=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KmsClientReference(native_input.kms_client))) if ((native_input.kms_client is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_KmsClientReference(native_input.kms_client) is not None)) else (Option_None())), ) - def aws_cryptography_keystore_DdbClientReference(native_input): import aws_cryptography_internal_dynamodb.internaldafny.generated.Com_Amazonaws_Dynamodb - - client = aws_cryptography_internal_dynamodb.internaldafny.generated.Com_Amazonaws_Dynamodb.default__.DynamoDBClient( - boto_client=native_input - ) + client = aws_cryptography_internal_dynamodb.internaldafny.generated.Com_Amazonaws_Dynamodb.default__.DynamoDBClient(boto_client = native_input) client.value.impl = native_input return client.value - def aws_cryptography_keystore_KmsClientReference(native_input): import aws_cryptography_internal_kms.internaldafny.generated.Com_Amazonaws_Kms - - client = aws_cryptography_internal_kms.internaldafny.generated.Com_Amazonaws_Kms.default__.KMSClient( - boto_client=native_input - ) + client = aws_cryptography_internal_kms.internaldafny.generated.Com_Amazonaws_Kms.default__.KMSClient(boto_client = native_input) client.value.impl = native_input return client.value diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/__init__.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/__init__.py index 09be6133b..89d64801a 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/__init__.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/__init__.py @@ -1,3 +1,4 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. + diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/client.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/client.py index 866be9750..5a45a3d19 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/client.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/client.py @@ -115,17 +115,15 @@ Input = TypeVar("Input") Output = TypeVar("Output") - class AwsCryptographicMaterialProviders: - """Client for AwsCryptographicMaterialProviders. + """Client for AwsCryptographicMaterialProviders :param config: Configuration for the client. """ - def __init__( self, config: MaterialProvidersConfig | None = None, - dafny_client: IAwsCryptographicMaterialProvidersClient | None = None, + dafny_client: IAwsCryptographicMaterialProvidersClient | None = None ): if config is None: self._config = Config() @@ -142,11 +140,8 @@ def __init__( if dafny_client is not None: self._config.dafnyImplInterface.impl = dafny_client - def create_aws_kms_keyring( - self, input: CreateAwsKmsKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS Keyring, which wraps and unwraps data keys using - single symmetric AWS KMS Key. + def create_aws_kms_keyring(self, input: CreateAwsKmsKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS Keyring, which wraps and unwraps data keys using single symmetric AWS KMS Key. :param input: Inputs for for creating a AWS KMS Keyring. """ @@ -159,14 +154,10 @@ def create_aws_kms_keyring( operation_name="CreateAwsKmsKeyring", ) - def create_aws_kms_discovery_keyring( - self, input: CreateAwsKmsDiscoveryKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS Discovery Keyring, which supports unwrapping data - keys wrapped by a symmetric AWS KMS Key for a single region. + def create_aws_kms_discovery_keyring(self, input: CreateAwsKmsDiscoveryKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS Discovery Keyring, which supports unwrapping data keys wrapped by a symmetric AWS KMS Key for a single region. - :param input: Inputs for for creating a AWS KMS Discovery - Keyring. + :param input: Inputs for for creating a AWS KMS Discovery Keyring. """ return self._execute_operation( input=input, @@ -177,11 +168,8 @@ def create_aws_kms_discovery_keyring( operation_name="CreateAwsKmsDiscoveryKeyring", ) - def create_aws_kms_multi_keyring( - self, input: CreateAwsKmsMultiKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS Multi-Keyring, which wraps and unwraps data keys - using one or more symmetric AWS KMS Keys. + def create_aws_kms_multi_keyring(self, input: CreateAwsKmsMultiKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS Multi-Keyring, which wraps and unwraps data keys using one or more symmetric AWS KMS Keys. :param input: Inputs for for creating a AWS KMS Multi-Keyring. """ @@ -194,15 +182,10 @@ def create_aws_kms_multi_keyring( operation_name="CreateAwsKmsMultiKeyring", ) - def create_aws_kms_discovery_multi_keyring( - self, input: CreateAwsKmsDiscoveryMultiKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS Discovery Multi-Keyring, which supports - unwrapping data keys wrapped by a symmetric AWS KMS Key, for multiple - regions. + def create_aws_kms_discovery_multi_keyring(self, input: CreateAwsKmsDiscoveryMultiKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS Discovery Multi-Keyring, which supports unwrapping data keys wrapped by a symmetric AWS KMS Key, for multiple regions. - :param input: Inputs for for creating an AWS KMS Discovery - Multi-Keyring. + :param input: Inputs for for creating an AWS KMS Discovery Multi-Keyring. """ return self._execute_operation( input=input, @@ -213,11 +196,8 @@ def create_aws_kms_discovery_multi_keyring( operation_name="CreateAwsKmsDiscoveryMultiKeyring", ) - def create_aws_kms_mrk_keyring( - self, input: CreateAwsKmsMrkKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS MRK Keyring, which wraps and unwraps data keys - using single symmetric AWS KMS Key or AWS KMS Multi-Region Key. + def create_aws_kms_mrk_keyring(self, input: CreateAwsKmsMrkKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS MRK Keyring, which wraps and unwraps data keys using single symmetric AWS KMS Key or AWS KMS Multi-Region Key. :param input: Inputs for for creating an AWS KMS MRK Keyring. """ @@ -230,15 +210,10 @@ def create_aws_kms_mrk_keyring( operation_name="CreateAwsKmsMrkKeyring", ) - def create_aws_kms_mrk_multi_keyring( - self, input: CreateAwsKmsMrkMultiKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS MRK Multi-Keyring, which wraps and unwraps data - keys using one or more symmetric AWS KMS Keys or AWS KMS Multi-Region - Keys. + def create_aws_kms_mrk_multi_keyring(self, input: CreateAwsKmsMrkMultiKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS MRK Multi-Keyring, which wraps and unwraps data keys using one or more symmetric AWS KMS Keys or AWS KMS Multi-Region Keys. - :param input: Inputs for for creating a AWS KMS MRK Multi- - Keyring. + :param input: Inputs for for creating a AWS KMS MRK Multi-Keyring. """ return self._execute_operation( input=input, @@ -249,15 +224,10 @@ def create_aws_kms_mrk_multi_keyring( operation_name="CreateAwsKmsMrkMultiKeyring", ) - def create_aws_kms_mrk_discovery_keyring( - self, input: CreateAwsKmsMrkDiscoveryKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS MRK Discovery Keyring, which supports unwrapping - data keys wrapped by a symmetric AWS KMS Key or AWS KMS Multi-Region - Key in a particular region. + def create_aws_kms_mrk_discovery_keyring(self, input: CreateAwsKmsMrkDiscoveryKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS MRK Discovery Keyring, which supports unwrapping data keys wrapped by a symmetric AWS KMS Key or AWS KMS Multi-Region Key in a particular region. - :param input: Inputs for for creating a AWS KMS MRK Discovery - Keyring. + :param input: Inputs for for creating a AWS KMS MRK Discovery Keyring. """ return self._execute_operation( input=input, @@ -268,15 +238,10 @@ def create_aws_kms_mrk_discovery_keyring( operation_name="CreateAwsKmsMrkDiscoveryKeyring", ) - def create_aws_kms_mrk_discovery_multi_keyring( - self, input: CreateAwsKmsMrkDiscoveryMultiKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS MRK Discovery Multi-Keyring that supports - unwrapping data keys wrapped by a symmetric AWS KMS Key or AWS KMS - Multi-Region Key, for a single region. + def create_aws_kms_mrk_discovery_multi_keyring(self, input: CreateAwsKmsMrkDiscoveryMultiKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS MRK Discovery Multi-Keyring that supports unwrapping data keys wrapped by a symmetric AWS KMS Key or AWS KMS Multi-Region Key, for a single region. - :param input: Inputs for for creating a AWS KMS MRK Discovery - Multi-Keyring. + :param input: Inputs for for creating a AWS KMS MRK Discovery Multi-Keyring. """ return self._execute_operation( input=input, @@ -287,12 +252,8 @@ def create_aws_kms_mrk_discovery_multi_keyring( operation_name="CreateAwsKmsMrkDiscoveryMultiKeyring", ) - def create_aws_kms_hierarchical_keyring( - self, input: CreateAwsKmsHierarchicalKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates a Hierarchical Keyring, which supports wrapping and - unwrapping data keys using Branch Keys persisted in DynamoDB and - protected by a symmetric AWS KMS Key or AWS KMS Multi-Region Key. + def create_aws_kms_hierarchical_keyring(self, input: CreateAwsKmsHierarchicalKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates a Hierarchical Keyring, which supports wrapping and unwrapping data keys using Branch Keys persisted in DynamoDB and protected by a symmetric AWS KMS Key or AWS KMS Multi-Region Key. :param input: Inputs for creating a Hierarchical Keyring. """ @@ -305,11 +266,8 @@ def create_aws_kms_hierarchical_keyring( operation_name="CreateAwsKmsHierarchicalKeyring", ) - def create_aws_kms_rsa_keyring( - self, input: CreateAwsKmsRsaKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS RSA Keyring, which wraps and unwraps data keys - using a single asymmetric AWS KMS Key for RSA. + def create_aws_kms_rsa_keyring(self, input: CreateAwsKmsRsaKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS RSA Keyring, which wraps and unwraps data keys using a single asymmetric AWS KMS Key for RSA. :param input: Inputs for creating a AWS KMS RSA Keyring. """ @@ -322,12 +280,8 @@ def create_aws_kms_rsa_keyring( operation_name="CreateAwsKmsRsaKeyring", ) - def create_aws_kms_ecdh_keyring( - self, input: CreateAwsKmsEcdhKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates an AWS KMS ECDH Keyring, which wraps and unwraps data keys - by deriving a shared data key from the established shared secret - between parties through the ECDH protocol. + def create_aws_kms_ecdh_keyring(self, input: CreateAwsKmsEcdhKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates an AWS KMS ECDH Keyring, which wraps and unwraps data keys by deriving a shared data key from the established shared secret between parties through the ECDH protocol. :param input: Inputs for creating an AWS KMS ECDH Keyring. """ @@ -340,9 +294,7 @@ def create_aws_kms_ecdh_keyring( operation_name="CreateAwsKmsEcdhKeyring", ) - def create_multi_keyring( - self, input: CreateMultiKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": + def create_multi_keyring(self, input: CreateMultiKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': """Creates a Multi-Keyring comprised of one or more other Keyrings. :param input: Inputs for creating a Multi-Keyring. @@ -356,11 +308,8 @@ def create_multi_keyring( operation_name="CreateMultiKeyring", ) - def create_raw_aes_keyring( - self, input: CreateRawAesKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates a Raw AES Keyring, which wraps and unwraps data keys locally - using AES_GCM. + def create_raw_aes_keyring(self, input: CreateRawAesKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates a Raw AES Keyring, which wraps and unwraps data keys locally using AES_GCM. :param input: Inputs for creating a Raw AES Keyring. """ @@ -373,11 +322,8 @@ def create_raw_aes_keyring( operation_name="CreateRawAesKeyring", ) - def create_raw_rsa_keyring( - self, input: CreateRawRsaKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates a Raw RSA Keyring, which wraps and unwraps data keys locally - using RSA. + def create_raw_rsa_keyring(self, input: CreateRawRsaKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates a Raw RSA Keyring, which wraps and unwraps data keys locally using RSA. :param input: Inputs for creating a Raw RAW Keyring. """ @@ -390,12 +336,8 @@ def create_raw_rsa_keyring( operation_name="CreateRawRsaKeyring", ) - def create_raw_ecdh_keyring( - self, input: CreateRawEcdhKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": - """Creates a Raw ECDH Keyring, which wraps and unwraps data keys by - deriving a shared data key from the established shared secret between - parties through the ECDH protocol. + def create_raw_ecdh_keyring(self, input: CreateRawEcdhKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': + """Creates a Raw ECDH Keyring, which wraps and unwraps data keys by deriving a shared data key from the established shared secret between parties through the ECDH protocol. :param input: Inputs for creating a raw ECDH Keyring. """ @@ -408,13 +350,10 @@ def create_raw_ecdh_keyring( operation_name="CreateRawEcdhKeyring", ) - def create_default_cryptographic_materials_manager( - self, input: CreateDefaultCryptographicMaterialsManagerInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager": + def create_default_cryptographic_materials_manager(self, input: CreateDefaultCryptographicMaterialsManagerInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager': """Creates a Default Cryptographic Materials Manager. - :param input: Inputs for creating a Default Cryptographic - Materials Manager. + :param input: Inputs for creating a Default Cryptographic Materials Manager. """ return self._execute_operation( input=input, @@ -425,14 +364,10 @@ def create_default_cryptographic_materials_manager( operation_name="CreateDefaultCryptographicMaterialsManager", ) - def create_required_encryption_context_cmm( - self, input: CreateRequiredEncryptionContextCMMInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager": - """Creates an Required Encryption Context Cryptographic Materials - Manager. + def create_required_encryption_context_cmm(self, input: CreateRequiredEncryptionContextCMMInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager': + """Creates an Required Encryption Context Cryptographic Materials Manager. - :param input: Inputs for creating an Required Encryption Context - Cryptographic Materials Manager. + :param input: Inputs for creating an Required Encryption Context Cryptographic Materials Manager. """ return self._execute_operation( input=input, @@ -443,9 +378,7 @@ def create_required_encryption_context_cmm( operation_name="CreateRequiredEncryptionContextCMM", ) - def create_cryptographic_materials_cache( - self, input: CreateCryptographicMaterialsCacheInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsCache": + def create_cryptographic_materials_cache(self, input: CreateCryptographicMaterialsCacheInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsCache': """Invokes the CreateCryptographicMaterialsCache operation. :param input: The operation's input. @@ -459,9 +392,7 @@ def create_cryptographic_materials_cache( operation_name="CreateCryptographicMaterialsCache", ) - def create_default_client_supplier( - self, input: CreateDefaultClientSupplierInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier": + def create_default_client_supplier(self, input: CreateDefaultClientSupplierInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier': """Invokes the CreateDefaultClientSupplier operation. :param input: The operation's input. @@ -475,9 +406,7 @@ def create_default_client_supplier( operation_name="CreateDefaultClientSupplier", ) - def initialize_encryption_materials( - self, input: InitializeEncryptionMaterialsInput - ) -> EncryptionMaterials: + def initialize_encryption_materials(self, input: InitializeEncryptionMaterialsInput) -> EncryptionMaterials: """Invokes the InitializeEncryptionMaterials operation. :param input: The operation's input. @@ -491,9 +420,7 @@ def initialize_encryption_materials( operation_name="InitializeEncryptionMaterials", ) - def initialize_decryption_materials( - self, input: InitializeDecryptionMaterialsInput - ) -> DecryptionMaterials: + def initialize_decryption_materials(self, input: InitializeDecryptionMaterialsInput) -> DecryptionMaterials: """Invokes the InitializeDecryptionMaterials operation. :param input: The operation's input. @@ -507,9 +434,7 @@ def initialize_decryption_materials( operation_name="InitializeDecryptionMaterials", ) - def valid_encryption_materials_transition( - self, input: ValidEncryptionMaterialsTransitionInput - ) -> Unit: + def valid_encryption_materials_transition(self, input: ValidEncryptionMaterialsTransitionInput) -> Unit: """Invokes the ValidEncryptionMaterialsTransition operation. :param input: The operation's input. @@ -523,9 +448,7 @@ def valid_encryption_materials_transition( operation_name="ValidEncryptionMaterialsTransition", ) - def valid_decryption_materials_transition( - self, input: ValidDecryptionMaterialsTransitionInput - ) -> Unit: + def valid_decryption_materials_transition(self, input: ValidDecryptionMaterialsTransitionInput) -> Unit: """Invokes the ValidDecryptionMaterialsTransition operation. :param input: The operation's input. @@ -539,9 +462,7 @@ def valid_decryption_materials_transition( operation_name="ValidDecryptionMaterialsTransition", ) - def encryption_materials_has_plaintext_data_key( - self, input: EncryptionMaterials - ) -> Unit: + def encryption_materials_has_plaintext_data_key(self, input: EncryptionMaterials) -> Unit: """Invokes the EncryptionMaterialsHasPlaintextDataKey operation. :param input: The operation's input. @@ -555,9 +476,7 @@ def encryption_materials_has_plaintext_data_key( operation_name="EncryptionMaterialsHasPlaintextDataKey", ) - def decryption_materials_with_plaintext_data_key( - self, input: DecryptionMaterials - ) -> Unit: + def decryption_materials_with_plaintext_data_key(self, input: DecryptionMaterials) -> Unit: """Invokes the DecryptionMaterialsWithPlaintextDataKey operation. :param input: The operation's input. @@ -599,9 +518,7 @@ def valid_algorithm_suite_info(self, input: AlgorithmSuiteInfo) -> Unit: operation_name="ValidAlgorithmSuiteInfo", ) - def validate_commitment_policy_on_encrypt( - self, input: ValidateCommitmentPolicyOnEncryptInput - ) -> Unit: + def validate_commitment_policy_on_encrypt(self, input: ValidateCommitmentPolicyOnEncryptInput) -> Unit: """Invokes the ValidateCommitmentPolicyOnEncrypt operation. :param input: The operation's input. @@ -615,9 +532,7 @@ def validate_commitment_policy_on_encrypt( operation_name="ValidateCommitmentPolicyOnEncrypt", ) - def validate_commitment_policy_on_decrypt( - self, input: ValidateCommitmentPolicyOnDecryptInput - ) -> Unit: + def validate_commitment_policy_on_decrypt(self, input: ValidateCommitmentPolicyOnDecryptInput) -> Unit: """Invokes the ValidateCommitmentPolicyOnDecrypt operation. :param input: The operation's input. @@ -668,8 +583,7 @@ def _handle_execution( ) _client_interceptors = config.interceptors client_interceptors = cast( - list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - _client_interceptors, + list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], _client_interceptors ) interceptors = client_interceptors @@ -752,7 +666,7 @@ def _handle_execution( error_info=RetryErrorInfo( # TODO: Determine the error type. error_type=RetryErrorType.CLIENT_ERROR, - ), + ) ) except SmithyRetryException: raise context_with_response.response @@ -767,10 +681,7 @@ def _handle_execution( # The response will be set either with the modeled output or an exception. The # transport_request and transport_response may be set or None. execution_context = cast( - InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], - context, + InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], context ) return self._finalize_execution(interceptors, execution_context) @@ -795,10 +706,8 @@ def _handle_attempt( InterceptorContext[Input, None, DafnyRequest, DafnyResponse], context ) - context_with_response._transport_response = ( - config.dafnyImplInterface.handle_request( - input=context_with_response.transport_request - ) + context_with_response._transport_response = config.dafnyImplInterface.handle_request( + input=context_with_response.transport_request ) # Step 7n: Invoke read_after_transmit @@ -835,8 +744,7 @@ def _handle_attempt( # None. This will also be true after _finalize_attempt because there is no opportunity # there to set the transport_response. attempt_context = cast( - InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], - context, + InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], context ) return self._finalize_attempt(interceptors, attempt_context) @@ -866,9 +774,7 @@ def _finalize_attempt( def _finalize_execution( self, interceptors: list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - context: InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], + context: InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], ) -> Output: try: # Step 9: Invoke modify_before_completion diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/config.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/config.py index cf708be4f..e8cc865ed 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/config.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/config.py @@ -17,8 +17,6 @@ _ServiceInterceptor = Any - - @dataclass(init=False) class Config: """Configuration for AwsCryptographicMaterialProviders.""" @@ -36,35 +34,40 @@ def __init__( ): """Constructor. - :param interceptors: The list of interceptors, which are hooks - that are called during the execution of a request. - :param retry_strategy: The retry strategy for issuing retry - tokens and computing retry delays. + :param interceptors: The list of interceptors, which are hooks that are called + during the execution of a request. + + :param retry_strategy: The retry strategy for issuing retry tokens and computing + retry delays. + :param dafnyImplInterface: """ self.interceptors = interceptors or [] self.retry_strategy = retry_strategy or SimpleRetryStrategy() self.dafnyImplInterface = dafnyImplInterface - # A callable that allows customizing the config object on each request. Plugin: TypeAlias = Callable[[Config], None] - class MaterialProvidersConfig(Config): def __init__( self, ): - """Constructor for MaterialProvidersConfig.""" + """Constructor for MaterialProvidersConfig + """ super().__init__() def as_dict(self) -> Dict[str, Any]: - """Converts the MaterialProvidersConfig to a dictionary.""" + """Converts the MaterialProvidersConfig to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "MaterialProvidersConfig": - """Creates a MaterialProvidersConfig from a dictionary.""" + """Creates a MaterialProvidersConfig from a dictionary. + + """ return MaterialProvidersConfig() def __repr__(self) -> str: @@ -75,18 +78,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, MaterialProvidersConfig) - def dafny_config_to_smithy_config(dafny_config) -> MaterialProvidersConfig: - """Converts the provided Dafny shape for this localService's config into - the corresponding Smithy-modelled shape.""" - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_MaterialProvidersConfig( - dafny_config - ) - + """ + Converts the provided Dafny shape for this localService's config + into the corresponding Smithy-modelled shape. + """ + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_MaterialProvidersConfig(dafny_config) def smithy_config_to_dafny_config(smithy_config) -> DafnyMaterialProvidersConfig: - """Converts the provided Smithy-modelled shape for this localService's - config into the corresponding Dafny shape.""" - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_MaterialProvidersConfig( - smithy_config - ) + """ + Converts the provided Smithy-modelled shape for this localService's config + into the corresponding Dafny shape. + """ + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_MaterialProvidersConfig(smithy_config) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafnyImplInterface.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafnyImplInterface.py index e580f3538..9b869d0be 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafnyImplInterface.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafnyImplInterface.py @@ -2,12 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. -from aws_cryptographic_material_providers.internaldafny.generated.MaterialProviders import ( - MaterialProvidersClient, -) +from aws_cryptographic_material_providers.internaldafny.generated.MaterialProviders import MaterialProvidersClient from .dafny_protocol import DafnyRequest - class DafnyImplInterface: impl: MaterialProvidersClient | None = None @@ -52,9 +49,9 @@ def handle_request(self, input: DafnyRequest): "ValidateCommitmentPolicyOnDecrypt": self.impl.ValidateCommitmentPolicyOnDecrypt, } - # This logic is where a typical Smithy client would expect the "server" to be. - # This code can be thought of as logic our Dafny "server" uses - # to route incoming client requests to the correct request handler code. + # This logic is where a typical Smithy client would expect the "server" to be. + # This code can be thought of as logic our Dafny "server" uses + # to route incoming client requests to the correct request handler code. if input.dafny_operation_input is None: return self.operation_map[input.operation_name]() else: diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_protocol.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_protocol.py index a714528c5..77d75d1d4 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_protocol.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_protocol.py @@ -38,7 +38,6 @@ import smithy_dafny_standard_library.internaldafny.generated.Wrappers as Wrappers from typing import Union - class DafnyRequest: operation_name: str @@ -79,7 +78,6 @@ def __init__(self, operation_name, dafny_operation_input): self.operation_name = operation_name self.dafny_operation_input = dafny_operation_input - class DafnyResponse(Wrappers.Result): def __init__(self): super().__init__(self) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_to_smithy.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_to_smithy.py index ec9b4821f..cf0d7c2eb 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_to_smithy.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/dafny_to_smithy.py @@ -68,1106 +68,477 @@ def aws_cryptography_materialproviders_GetBranchKeyIdInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdInput( - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, ) - def aws_cryptography_materialproviders_GetBranchKeyIdOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdOutput( - branch_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyId - ).decode("utf-16-be"), + branch_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyId).decode('utf-16-be'), ) - def aws_cryptography_materialproviders_GetClientInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetClientInput( - region=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.region).decode( - "utf-16-be" - ), + region=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.region).decode('utf-16-be'), ) - def aws_cryptography_materialproviders_KmsClientReference(dafny_input): return dafny_input._impl - def aws_cryptography_materialproviders_GetClientOutput(dafny_input): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference( - dafny_input - ) - + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference(dafny_input) def aws_cryptography_materialproviders_Materials(dafny_input): # Convert Materials if isinstance(dafny_input, Materials_Encryption): - Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsEncryption( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - dafny_input.Encryption - ) - ) + Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsEncryption(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(dafny_input.Encryption)) elif isinstance(dafny_input, Materials_Decryption): - Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsDecryption( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - dafny_input.Decryption - ) - ) + Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsDecryption(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(dafny_input.Decryption)) elif isinstance(dafny_input, Materials_BranchKey): - Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBranchKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BranchKeyMaterials( - dafny_input.BranchKey - ) - ) + Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBranchKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BranchKeyMaterials(dafny_input.BranchKey)) elif isinstance(dafny_input, Materials_BeaconKey): - Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBeaconKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BeaconKeyMaterials( - dafny_input.BeaconKey - ) - ) + Materials_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBeaconKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.dafny_to_smithy.aws_cryptography_keystore_BeaconKeyMaterials(dafny_input.BeaconKey)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return Materials_union_value - def aws_cryptography_materialproviders_EncryptionMaterials(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptionMaterials( - algorithm_suite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - dafny_input.algorithmSuite - ), - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, - encrypted_data_keys=[ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptedDataKey( - list_element - ) - for list_element in dafny_input.encryptedDataKeys - ], - required_encryption_context_keys=[ - bytes(list_element.Elements).decode("utf-8") - for list_element in dafny_input.requiredEncryptionContextKeys - ], - plaintext_data_key=( - (bytes(dafny_input.plaintextDataKey.value)) - if (dafny_input.plaintextDataKey.is_Some) - else None - ), - signing_key=( - (bytes(dafny_input.signingKey.value)) - if (dafny_input.signingKey.is_Some) - else None - ), - symmetric_signing_keys=( - ( - [ - bytes(list_element) - for list_element in dafny_input.symmetricSigningKeys.value - ] - ) - if (dafny_input.symmetricSigningKeys.is_Some) - else None - ), + algorithm_suite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo(dafny_input.algorithmSuite), + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, + encrypted_data_keys=[aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptedDataKey(list_element) for list_element in dafny_input.encryptedDataKeys], + required_encryption_context_keys=[bytes(list_element.Elements).decode('utf-8') for list_element in dafny_input.requiredEncryptionContextKeys], + plaintext_data_key=(bytes(dafny_input.plaintextDataKey.value)) if (dafny_input.plaintextDataKey.is_Some) else None, + signing_key=(bytes(dafny_input.signingKey.value)) if (dafny_input.signingKey.is_Some) else None, + symmetric_signing_keys=([bytes(list_element) for list_element in dafny_input.symmetricSigningKeys.value]) if (dafny_input.symmetricSigningKeys.is_Some) else None, ) - def aws_cryptography_materialproviders_DecryptionMaterials(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptionMaterials( - algorithm_suite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - dafny_input.algorithmSuite - ), - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, - required_encryption_context_keys=[ - bytes(list_element.Elements).decode("utf-8") - for list_element in dafny_input.requiredEncryptionContextKeys - ], - plaintext_data_key=( - (bytes(dafny_input.plaintextDataKey.value)) - if (dafny_input.plaintextDataKey.is_Some) - else None - ), - verification_key=( - (bytes(dafny_input.verificationKey.value)) - if (dafny_input.verificationKey.is_Some) - else None - ), - symmetric_signing_key=( - (bytes(dafny_input.symmetricSigningKey.value)) - if (dafny_input.symmetricSigningKey.is_Some) - else None - ), + algorithm_suite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo(dafny_input.algorithmSuite), + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, + required_encryption_context_keys=[bytes(list_element.Elements).decode('utf-8') for list_element in dafny_input.requiredEncryptionContextKeys], + plaintext_data_key=(bytes(dafny_input.plaintextDataKey.value)) if (dafny_input.plaintextDataKey.is_Some) else None, + verification_key=(bytes(dafny_input.verificationKey.value)) if (dafny_input.verificationKey.is_Some) else None, + symmetric_signing_key=(bytes(dafny_input.symmetricSigningKey.value)) if (dafny_input.symmetricSigningKey.is_Some) else None, ) - def aws_cryptography_materialproviders_AlgorithmSuiteInfo(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteInfo( - id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId( - dafny_input.id - ), + id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input.id), binary_id=bytes(dafny_input.binaryId), message_version=dafny_input.messageVersion, - encrypt=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Encrypt( - dafny_input.encrypt - ), - kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm( - dafny_input.kdf - ), - commitment=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm( - dafny_input.commitment - ), - signature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_SignatureAlgorithm( - dafny_input.signature - ), - symmetric_signature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_SymmetricSignatureAlgorithm( - dafny_input.symmetricSignature - ), - edk_wrapping=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EdkWrappingAlgorithm( - dafny_input.edkWrapping - ), + encrypt=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Encrypt(dafny_input.encrypt), + kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm(dafny_input.kdf), + commitment=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm(dafny_input.commitment), + signature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_SignatureAlgorithm(dafny_input.signature), + symmetric_signature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_SymmetricSignatureAlgorithm(dafny_input.symmetricSignature), + edk_wrapping=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EdkWrappingAlgorithm(dafny_input.edkWrapping), ) - def aws_cryptography_materialproviders_EncryptedDataKey(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptedDataKey( - key_provider_id=bytes(dafny_input.keyProviderId.Elements).decode("utf-8"), + key_provider_id=bytes(dafny_input.keyProviderId.Elements).decode('utf-8'), key_provider_info=bytes(dafny_input.keyProviderInfo), ciphertext=bytes(dafny_input.ciphertext), ) - def aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input): # Convert AlgorithmSuiteId if isinstance(dafny_input, AlgorithmSuiteId_ESDK): - AlgorithmSuiteId_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdESDK( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ESDKAlgorithmSuiteId( - dafny_input.ESDK - ) - ) + AlgorithmSuiteId_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdESDK(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ESDKAlgorithmSuiteId(dafny_input.ESDK)) elif isinstance(dafny_input, AlgorithmSuiteId_DBE): - AlgorithmSuiteId_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdDBE( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DBEAlgorithmSuiteId( - dafny_input.DBE - ) - ) + AlgorithmSuiteId_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdDBE(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DBEAlgorithmSuiteId(dafny_input.DBE)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return AlgorithmSuiteId_union_value - def aws_cryptography_materialproviders_Encrypt(dafny_input): # Convert Encrypt if isinstance(dafny_input, Encrypt_AES__GCM): - Encrypt_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptAES_GCM( - aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AES_GCM( - dafny_input.AES__GCM - ) - ) + Encrypt_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptAES_GCM(aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AES_GCM(dafny_input.AES__GCM)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return Encrypt_union_value - def aws_cryptography_materialproviders_DerivationAlgorithm(dafny_input): # Convert DerivationAlgorithm if isinstance(dafny_input, DerivationAlgorithm_HKDF): - DerivationAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmHKDF( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_HKDF( - dafny_input.HKDF - ) - ) + DerivationAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmHKDF(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_HKDF(dafny_input.HKDF)) elif isinstance(dafny_input, DerivationAlgorithm_IDENTITY): - DerivationAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmIDENTITY( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_IDENTITY( - dafny_input.IDENTITY - ) - ) + DerivationAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmIDENTITY(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_IDENTITY(dafny_input.IDENTITY)) elif isinstance(dafny_input, DerivationAlgorithm_None): - DerivationAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmNone( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_None( - dafny_input.None_ - ) - ) + DerivationAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmNone(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_None(dafny_input.None_)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return DerivationAlgorithm_union_value - def aws_cryptography_materialproviders_SignatureAlgorithm(dafny_input): # Convert SignatureAlgorithm if isinstance(dafny_input, SignatureAlgorithm_ECDSA): - SignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmECDSA( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ECDSA( - dafny_input.ECDSA - ) - ) + SignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmECDSA(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ECDSA(dafny_input.ECDSA)) elif isinstance(dafny_input, SignatureAlgorithm_None): - SignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmNone( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_None( - dafny_input.None_ - ) - ) + SignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmNone(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_None(dafny_input.None_)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return SignatureAlgorithm_union_value - def aws_cryptography_materialproviders_SymmetricSignatureAlgorithm(dafny_input): # Convert SymmetricSignatureAlgorithm if isinstance(dafny_input, SymmetricSignatureAlgorithm_HMAC): - SymmetricSignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmHMAC( - aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.HMAC - ) - ) + SymmetricSignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmHMAC(aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.HMAC)) elif isinstance(dafny_input, SymmetricSignatureAlgorithm_None): - SymmetricSignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmNone( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_None( - dafny_input.None_ - ) - ) + SymmetricSignatureAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmNone(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_None(dafny_input.None_)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return SymmetricSignatureAlgorithm_union_value - def aws_cryptography_materialproviders_EdkWrappingAlgorithm(dafny_input): # Convert EdkWrappingAlgorithm if isinstance(dafny_input, EdkWrappingAlgorithm_DIRECT__KEY__WRAPPING): - EdkWrappingAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmDIRECT_KEY_WRAPPING( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DIRECT_KEY_WRAPPING( - dafny_input.DIRECT__KEY__WRAPPING - ) - ) + EdkWrappingAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmDIRECT_KEY_WRAPPING(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DIRECT_KEY_WRAPPING(dafny_input.DIRECT__KEY__WRAPPING)) elif isinstance(dafny_input, EdkWrappingAlgorithm_IntermediateKeyWrapping): - EdkWrappingAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmIntermediateKeyWrapping( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_IntermediateKeyWrapping( - dafny_input.IntermediateKeyWrapping - ) - ) + EdkWrappingAlgorithm_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmIntermediateKeyWrapping(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_IntermediateKeyWrapping(dafny_input.IntermediateKeyWrapping)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return EdkWrappingAlgorithm_union_value - def aws_cryptography_materialproviders_ESDKAlgorithmSuiteId(dafny_input): - if isinstance( - dafny_input, ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__NO__KDF - ): - return "0x0014" - - elif isinstance( - dafny_input, ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__NO__KDF - ): - return "0x0046" - - elif isinstance( - dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__NO__KDF - ): - return "0x0078" - - elif isinstance( - dafny_input, ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256 - ): - return "0x0114" - - elif isinstance( - dafny_input, ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA256 - ): - return "0x0146" - - elif isinstance( - dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA256 - ): - return "0x0178" - - elif isinstance( - dafny_input, - ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256__ECDSA__P256, - ): - return "0x0214" - - elif isinstance( - dafny_input, - ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384, - ): - return "0x0346" - - elif isinstance( - dafny_input, - ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384, - ): - return "0x0378" - - elif isinstance( - dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY - ): - return "0x0478" - - elif isinstance( - dafny_input, - ESDKAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384, - ): - return "0x0578" + if isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__NO__KDF): + return '0x0014' - else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__NO__KDF): + return '0x0046' + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__NO__KDF): + return '0x0078' -def aws_cryptography_materialproviders_DBEAlgorithmSuiteId(dafny_input): - if isinstance( - dafny_input, - DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__SYMSIG__HMAC__SHA384, - ): - return "0x6700" - - elif isinstance( - dafny_input, - DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384__SYMSIG__HMAC__SHA384, - ): - return "0x6701" + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256): + return '0x0114' + + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA256): + return '0x0146' + + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA256): + return '0x0178' + + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256__ECDSA__P256): + return '0x0214' + + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384): + return '0x0346' + + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384): + return '0x0378' + + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY): + return '0x0478' + + elif isinstance(dafny_input, ESDKAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384): + return '0x0578' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') + +def aws_cryptography_materialproviders_DBEAlgorithmSuiteId(dafny_input): + if isinstance(dafny_input, DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__SYMSIG__HMAC__SHA384): + return '0x6700' + elif isinstance(dafny_input, DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384__SYMSIG__HMAC__SHA384): + return '0x6701' + + else: + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_materialproviders_HKDF(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.HKDF( - hmac=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.hmac - ), + hmac=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.hmac), salt_length=dafny_input.saltLength, input_key_length=dafny_input.inputKeyLength, output_key_length=dafny_input.outputKeyLength, ) - def aws_cryptography_materialproviders_IDENTITY(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.IDENTITY() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.IDENTITY( ) - def aws_cryptography_materialproviders_None(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.None_() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.None_( ) - def aws_cryptography_materialproviders_ECDSA(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ECDSA( - curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm( - dafny_input.curve - ), + curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm(dafny_input.curve), ) - def aws_cryptography_materialproviders_DIRECT_KEY_WRAPPING(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DIRECT_KEY_WRAPPING() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DIRECT_KEY_WRAPPING( ) - def aws_cryptography_materialproviders_IntermediateKeyWrapping(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.IntermediateKeyWrapping( - key_encryption_key_kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm( - dafny_input.keyEncryptionKeyKdf - ), - mac_key_kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm( - dafny_input.macKeyKdf - ), - pdk_encrypt_algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Encrypt( - dafny_input.pdkEncryptAlgorithm - ), + key_encryption_key_kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm(dafny_input.keyEncryptionKeyKdf), + mac_key_kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DerivationAlgorithm(dafny_input.macKeyKdf), + pdk_encrypt_algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Encrypt(dafny_input.pdkEncryptAlgorithm), ) - def aws_cryptography_materialproviders_PutCacheEntryInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.PutCacheEntryInput( identifier=bytes(dafny_input.identifier), - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Materials( - dafny_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Materials(dafny_input.materials), creation_time=dafny_input.creationTime, expiry_time=dafny_input.expiryTime, - messages_used=( - (dafny_input.messagesUsed.value) - if (dafny_input.messagesUsed.is_Some) - else None - ), - bytes_used=( - (dafny_input.bytesUsed.value) if (dafny_input.bytesUsed.is_Some) else None - ), + messages_used=(dafny_input.messagesUsed.value) if (dafny_input.messagesUsed.is_Some) else None, + bytes_used=(dafny_input.bytesUsed.value) if (dafny_input.bytesUsed.is_Some) else None, ) - def smithy_api_Unit(): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit( ) - def aws_cryptography_materialproviders_GetCacheEntryInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryInput( identifier=bytes(dafny_input.identifier), - bytes_used=( - (dafny_input.bytesUsed.value) if (dafny_input.bytesUsed.is_Some) else None - ), + bytes_used=(dafny_input.bytesUsed.value) if (dafny_input.bytesUsed.is_Some) else None, ) - def aws_cryptography_materialproviders_GetCacheEntryOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryOutput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Materials( - dafny_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_Materials(dafny_input.materials), creation_time=dafny_input.creationTime, expiry_time=dafny_input.expiryTime, messages_used=dafny_input.messagesUsed, bytes_used=dafny_input.bytesUsed, ) - def aws_cryptography_materialproviders_UpdateUsageMetadataInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.UpdateUsageMetadataInput( identifier=bytes(dafny_input.identifier), bytes_used=dafny_input.bytesUsed, ) - def aws_cryptography_materialproviders_DeleteCacheEntryInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DeleteCacheEntryInput( identifier=bytes(dafny_input.identifier), ) - def aws_cryptography_materialproviders_CommitmentPolicy(dafny_input): # Convert CommitmentPolicy if isinstance(dafny_input, CommitmentPolicy_ESDK): - CommitmentPolicy_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyESDK( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ESDKCommitmentPolicy( - dafny_input.ESDK - ) - ) + CommitmentPolicy_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyESDK(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ESDKCommitmentPolicy(dafny_input.ESDK)) elif isinstance(dafny_input, CommitmentPolicy_DBE): - CommitmentPolicy_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyDBE( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DBECommitmentPolicy( - dafny_input.DBE - ) - ) + CommitmentPolicy_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyDBE(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DBECommitmentPolicy(dafny_input.DBE)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return CommitmentPolicy_union_value - def aws_cryptography_materialproviders_ESDKCommitmentPolicy(dafny_input): if isinstance(dafny_input, ESDKCommitmentPolicy_FORBID__ENCRYPT__ALLOW__DECRYPT): - return "FORBID_ENCRYPT_ALLOW_DECRYPT" + return 'FORBID_ENCRYPT_ALLOW_DECRYPT' elif isinstance(dafny_input, ESDKCommitmentPolicy_REQUIRE__ENCRYPT__ALLOW__DECRYPT): - return "REQUIRE_ENCRYPT_ALLOW_DECRYPT" + return 'REQUIRE_ENCRYPT_ALLOW_DECRYPT' - elif isinstance( - dafny_input, ESDKCommitmentPolicy_REQUIRE__ENCRYPT__REQUIRE__DECRYPT - ): - return "REQUIRE_ENCRYPT_REQUIRE_DECRYPT" + elif isinstance(dafny_input, ESDKCommitmentPolicy_REQUIRE__ENCRYPT__REQUIRE__DECRYPT): + return 'REQUIRE_ENCRYPT_REQUIRE_DECRYPT' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_materialproviders_DBECommitmentPolicy(dafny_input): if isinstance(dafny_input, DBECommitmentPolicy_REQUIRE__ENCRYPT__REQUIRE__DECRYPT): - return "REQUIRE_ENCRYPT_REQUIRE_DECRYPT" + return 'REQUIRE_ENCRYPT_REQUIRE_DECRYPT' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_materialproviders_GetEncryptionMaterialsInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsInput( - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, - commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy( - dafny_input.commitmentPolicy - ), - algorithm_suite_id=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId( - dafny_input.algorithmSuiteId.value - ) - ) - if (dafny_input.algorithmSuiteId.is_Some) - else None - ), - max_plaintext_length=( - (dafny_input.maxPlaintextLength.value) - if (dafny_input.maxPlaintextLength.is_Some) - else None - ), - required_encryption_context_keys=( - ( - [ - bytes(list_element.Elements).decode("utf-8") - for list_element in dafny_input.requiredEncryptionContextKeys.value - ] - ) - if (dafny_input.requiredEncryptionContextKeys.is_Some) - else None - ), + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, + commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy(dafny_input.commitmentPolicy), + algorithm_suite_id=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input.algorithmSuiteId.value)) if (dafny_input.algorithmSuiteId.is_Some) else None, + max_plaintext_length=(dafny_input.maxPlaintextLength.value) if (dafny_input.maxPlaintextLength.is_Some) else None, + required_encryption_context_keys=([bytes(list_element.Elements).decode('utf-8') for list_element in dafny_input.requiredEncryptionContextKeys.value]) if (dafny_input.requiredEncryptionContextKeys.is_Some) else None, ) - def aws_cryptography_materialproviders_GetEncryptionMaterialsOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsOutput( - encryption_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - dafny_input.encryptionMaterials - ), + encryption_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(dafny_input.encryptionMaterials), ) - def aws_cryptography_materialproviders_DecryptMaterialsInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsInput( - algorithm_suite_id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId( - dafny_input.algorithmSuiteId - ), - commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy( - dafny_input.commitmentPolicy - ), - encrypted_data_keys=[ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptedDataKey( - list_element - ) - for list_element in dafny_input.encryptedDataKeys - ], - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, - reproduced_encryption_context=( - ( - { - bytes(key.Elements) - .decode("utf-8"): bytes(value.Elements) - .decode("utf-8") - for ( - key, - value, - ) in dafny_input.reproducedEncryptionContext.value.items - } - ) - if (dafny_input.reproducedEncryptionContext.is_Some) - else None - ), + algorithm_suite_id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input.algorithmSuiteId), + commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy(dafny_input.commitmentPolicy), + encrypted_data_keys=[aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptedDataKey(list_element) for list_element in dafny_input.encryptedDataKeys], + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, + reproduced_encryption_context=({bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.reproducedEncryptionContext.value.items }) if (dafny_input.reproducedEncryptionContext.is_Some) else None, ) - def aws_cryptography_materialproviders_DecryptMaterialsOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsOutput( - decryption_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - dafny_input.decryptionMaterials - ), + decryption_materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(dafny_input.decryptionMaterials), ) - def aws_cryptography_materialproviders_OnEncryptInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptInput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - dafny_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(dafny_input.materials), ) - def aws_cryptography_materialproviders_OnEncryptOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptOutput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - dafny_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(dafny_input.materials), ) - def aws_cryptography_materialproviders_OnDecryptInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptInput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - dafny_input.materials - ), - encrypted_data_keys=[ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptedDataKey( - list_element - ) - for list_element in dafny_input.encryptedDataKeys - ], + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(dafny_input.materials), + encrypted_data_keys=[aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptedDataKey(list_element) for list_element in dafny_input.encryptedDataKeys], ) - def aws_cryptography_materialproviders_OnDecryptOutput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptOutput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - dafny_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(dafny_input.materials), ) - def aws_cryptography_materialproviders_CreateAwsKmsKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsKeyringInput( - kms_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.kmsKeyId - ).decode("utf-16-be"), - kms_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference( - dafny_input.kmsClient - ) - ) - if (dafny_input.kmsClient is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), + kms_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.kmsKeyId).decode('utf-16-be'), + kms_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference(dafny_input.kmsClient)) if (dafny_input.kmsClient is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, ) - def aws_cryptography_materialproviders_DiscoveryFilter(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DiscoveryFilter( - account_ids=[ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.accountIds - ], - partition=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.partition - ).decode("utf-16-be"), + account_ids=[b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.accountIds], + partition=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.partition).decode('utf-16-be'), ) - def aws_cryptography_materialproviders_CreateAwsKmsDiscoveryKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsDiscoveryKeyringInput( - kms_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference( - dafny_input.kmsClient - ) - ) - if (dafny_input.kmsClient is not None) - else None - ), - discovery_filter=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter( - dafny_input.discoveryFilter.value - ) - ) - if (dafny_input.discoveryFilter.is_Some) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), + kms_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference(dafny_input.kmsClient)) if (dafny_input.kmsClient is not None) else None, + discovery_filter=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter(dafny_input.discoveryFilter.value)) if (dafny_input.discoveryFilter.is_Some) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, ) - def aws_cryptography_materialproviders_ClientSupplierReference(dafny_input): - if hasattr(dafny_input, "_native_impl"): + if hasattr(dafny_input, '_native_impl'): return dafny_input._native_impl else: - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - ClientSupplier, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ClientSupplier return ClientSupplier(_impl=dafny_input) - def aws_cryptography_materialproviders_CreateAwsKmsMultiKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMultiKeyringInput( - generator=( - ( - b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.generator.value - ).decode("utf-16-be") - ) - if (dafny_input.generator.is_Some) - else None - ), - kms_key_ids=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.kmsKeyIds.value - ] - ) - if (dafny_input.kmsKeyIds.is_Some) - else None - ), - client_supplier=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference( - dafny_input.clientSupplier.UnwrapOr(None) - ) - ) - if (dafny_input.clientSupplier.UnwrapOr(None) is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), - ) - - -def aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsDiscoveryMultiKeyringInput( - regions=[ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.regions - ], - discovery_filter=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter( - dafny_input.discoveryFilter.value - ) - ) - if (dafny_input.discoveryFilter.is_Some) - else None - ), - client_supplier=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference( - dafny_input.clientSupplier.UnwrapOr(None) - ) - ) - if (dafny_input.clientSupplier.UnwrapOr(None) is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), + generator=(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.generator.value).decode('utf-16-be')) if (dafny_input.generator.is_Some) else None, + kms_key_ids=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.kmsKeyIds.value]) if (dafny_input.kmsKeyIds.is_Some) else None, + client_supplier=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference(dafny_input.clientSupplier.UnwrapOr(None))) if (dafny_input.clientSupplier.UnwrapOr(None) is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, ) +def aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsDiscoveryMultiKeyringInput( + regions=[b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.regions], + discovery_filter=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter(dafny_input.discoveryFilter.value)) if (dafny_input.discoveryFilter.is_Some) else None, + client_supplier=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference(dafny_input.clientSupplier.UnwrapOr(None))) if (dafny_input.clientSupplier.UnwrapOr(None) is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, + ) def aws_cryptography_materialproviders_CreateAwsKmsMrkKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkKeyringInput( - kms_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.kmsKeyId - ).decode("utf-16-be"), - kms_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference( - dafny_input.kmsClient - ) - ) - if (dafny_input.kmsClient is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), + kms_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.kmsKeyId).decode('utf-16-be'), + kms_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference(dafny_input.kmsClient)) if (dafny_input.kmsClient is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, ) - def aws_cryptography_materialproviders_CreateAwsKmsMrkMultiKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkMultiKeyringInput( - generator=( - ( - b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.generator.value - ).decode("utf-16-be") - ) - if (dafny_input.generator.is_Some) - else None - ), - kms_key_ids=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.kmsKeyIds.value - ] - ) - if (dafny_input.kmsKeyIds.is_Some) - else None - ), - client_supplier=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference( - dafny_input.clientSupplier.UnwrapOr(None) - ) - ) - if (dafny_input.clientSupplier.UnwrapOr(None) is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), - ) - - -def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput( - dafny_input, -): + generator=(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.generator.value).decode('utf-16-be')) if (dafny_input.generator.is_Some) else None, + kms_key_ids=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.kmsKeyIds.value]) if (dafny_input.kmsKeyIds.is_Some) else None, + client_supplier=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference(dafny_input.clientSupplier.UnwrapOr(None))) if (dafny_input.clientSupplier.UnwrapOr(None) is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, + ) + +def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkDiscoveryKeyringInput( - kms_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference( - dafny_input.kmsClient - ) - ) - if (dafny_input.kmsClient is not None) - else None - ), - discovery_filter=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter( - dafny_input.discoveryFilter.value - ) - ) - if (dafny_input.discoveryFilter.is_Some) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), - region=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.region).decode( - "utf-16-be" - ), - ) - - -def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkDiscoveryMultiKeyringInput( - regions=[ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.regions - ], - discovery_filter=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter( - dafny_input.discoveryFilter.value - ) - ) - if (dafny_input.discoveryFilter.is_Some) - else None - ), - client_supplier=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference( - dafny_input.clientSupplier.UnwrapOr(None) - ) - ) - if (dafny_input.clientSupplier.UnwrapOr(None) is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), + kms_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference(dafny_input.kmsClient)) if (dafny_input.kmsClient is not None) else None, + discovery_filter=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter(dafny_input.discoveryFilter.value)) if (dafny_input.discoveryFilter.is_Some) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, + region=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.region).decode('utf-16-be'), ) +def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkDiscoveryMultiKeyringInput( + regions=[b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.regions], + discovery_filter=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter(dafny_input.discoveryFilter.value)) if (dafny_input.discoveryFilter.is_Some) else None, + client_supplier=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference(dafny_input.clientSupplier.UnwrapOr(None))) if (dafny_input.clientSupplier.UnwrapOr(None) is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, + ) def aws_cryptography_materialproviders_BranchKeyIdSupplierReference(dafny_input): - if hasattr(dafny_input, "_native_impl"): + if hasattr(dafny_input, '_native_impl'): return dafny_input._native_impl else: - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - BranchKeyIdSupplier, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import BranchKeyIdSupplier return BranchKeyIdSupplier(_impl=dafny_input) - def aws_cryptography_materialproviders_KeyStoreReference(dafny_input): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client import ( - KeyStore, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client import KeyStore return KeyStore(config=None, dafny_client=dafny_input) - def aws_cryptography_materialproviders_CacheType(dafny_input): # Convert CacheType if isinstance(dafny_input, CacheType_Default): - CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeDefault( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DefaultCache( - dafny_input.Default - ) - ) + CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeDefault(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DefaultCache(dafny_input.Default)) elif isinstance(dafny_input, CacheType_No): - CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeNo( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_NoCache( - dafny_input.No - ) - ) + CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeNo(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_NoCache(dafny_input.No)) elif isinstance(dafny_input, CacheType_SingleThreaded): - CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeSingleThreaded( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_SingleThreadedCache( - dafny_input.SingleThreaded - ) - ) + CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeSingleThreaded(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_SingleThreadedCache(dafny_input.SingleThreaded)) elif isinstance(dafny_input, CacheType_MultiThreaded): - CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeMultiThreaded( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_MultiThreadedCache( - dafny_input.MultiThreaded - ) - ) + CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeMultiThreaded(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_MultiThreadedCache(dafny_input.MultiThreaded)) elif isinstance(dafny_input, CacheType_StormTracking): - CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeStormTracking( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_StormTrackingCache( - dafny_input.StormTracking - ) - ) + CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeStormTracking(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_StormTrackingCache(dafny_input.StormTracking)) elif isinstance(dafny_input, CacheType_Shared): - CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeShared( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference( - dafny_input.Shared - ) - ) + CacheType_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeShared(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference(dafny_input.Shared)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return CacheType_union_value - def aws_cryptography_materialproviders_DefaultCache(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DefaultCache( entry_capacity=dafny_input.entryCapacity, ) - def aws_cryptography_materialproviders_NoCache(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.NoCache() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.NoCache( ) - def aws_cryptography_materialproviders_SingleThreadedCache(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SingleThreadedCache( entry_capacity=dafny_input.entryCapacity, - entry_pruning_tail_size=( - (dafny_input.entryPruningTailSize.value) - if (dafny_input.entryPruningTailSize.is_Some) - else None - ), + entry_pruning_tail_size=(dafny_input.entryPruningTailSize.value) if (dafny_input.entryPruningTailSize.is_Some) else None, ) - def aws_cryptography_materialproviders_MultiThreadedCache(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MultiThreadedCache( entry_capacity=dafny_input.entryCapacity, - entry_pruning_tail_size=( - (dafny_input.entryPruningTailSize.value) - if (dafny_input.entryPruningTailSize.is_Some) - else None - ), + entry_pruning_tail_size=(dafny_input.entryPruningTailSize.value) if (dafny_input.entryPruningTailSize.is_Some) else None, ) - def aws_cryptography_materialproviders_StormTrackingCache(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.StormTrackingCache( entry_capacity=dafny_input.entryCapacity, - entry_pruning_tail_size=( - (dafny_input.entryPruningTailSize.value) - if (dafny_input.entryPruningTailSize.is_Some) - else None - ), + entry_pruning_tail_size=(dafny_input.entryPruningTailSize.value) if (dafny_input.entryPruningTailSize.is_Some) else None, grace_period=dafny_input.gracePeriod, grace_interval=dafny_input.graceInterval, fan_out=dafny_input.fanOut, @@ -1175,567 +546,251 @@ def aws_cryptography_materialproviders_StormTrackingCache(dafny_input): sleep_milli=dafny_input.sleepMilli, ) - -def aws_cryptography_materialproviders_CryptographicMaterialsCacheReference( - dafny_input, -): - if hasattr(dafny_input, "_native_impl"): +def aws_cryptography_materialproviders_CryptographicMaterialsCacheReference(dafny_input): + if hasattr(dafny_input, '_native_impl'): return dafny_input._native_impl else: - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - CryptographicMaterialsCache, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import CryptographicMaterialsCache return CryptographicMaterialsCache(_impl=dafny_input) - -def aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput( - dafny_input, -): +def aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsHierarchicalKeyringInput( - branch_key_id=( - ( - b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.branchKeyId.value - ).decode("utf-16-be") - ) - if (dafny_input.branchKeyId.is_Some) - else None - ), - branch_key_id_supplier=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_BranchKeyIdSupplierReference( - dafny_input.branchKeyIdSupplier.UnwrapOr(None) - ) - ) - if (dafny_input.branchKeyIdSupplier.UnwrapOr(None) is not None) - else None - ), - key_store=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyStoreReference( - dafny_input.keyStore - ) - ) - if (dafny_input.keyStore is not None) - else None - ), + branch_key_id=(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.branchKeyId.value).decode('utf-16-be')) if (dafny_input.branchKeyId.is_Some) else None, + branch_key_id_supplier=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_BranchKeyIdSupplierReference(dafny_input.branchKeyIdSupplier.UnwrapOr(None))) if (dafny_input.branchKeyIdSupplier.UnwrapOr(None) is not None) else None, + key_store=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyStoreReference(dafny_input.keyStore)) if (dafny_input.keyStore is not None) else None, ttl_seconds=dafny_input.ttlSeconds, - cache=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CacheType( - dafny_input.cache.value - ) - ) - if (dafny_input.cache.is_Some) - else None - ), - partition_id=( - ( - b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.partitionId.value - ).decode("utf-16-be") - ) - if (dafny_input.partitionId.is_Some) - else None - ), + cache=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CacheType(dafny_input.cache.value)) if (dafny_input.cache.is_Some) else None, + partition_id=(b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.partitionId.value).decode('utf-16-be')) if (dafny_input.partitionId.is_Some) else None, ) - def aws_cryptography_materialproviders_CreateAwsKmsRsaKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsRsaKeyringInput( - public_key=( - (bytes(dafny_input.publicKey.value)) - if (dafny_input.publicKey.is_Some) - else None - ), - kms_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.kmsKeyId - ).decode("utf-16-be"), - encryption_algorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.encryptionAlgorithm - ), - kms_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference( - dafny_input.kmsClient.UnwrapOr(None) - ) - ) - if (dafny_input.kmsClient.UnwrapOr(None) is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), + public_key=(bytes(dafny_input.publicKey.value)) if (dafny_input.publicKey.is_Some) else None, + kms_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.kmsKeyId).decode('utf-16-be'), + encryption_algorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.encryptionAlgorithm), + kms_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference(dafny_input.kmsClient.UnwrapOr(None))) if (dafny_input.kmsClient.UnwrapOr(None) is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, ) - def aws_cryptography_materialproviders_KmsEcdhStaticConfigurations(dafny_input): # Convert KmsEcdhStaticConfigurations if isinstance(dafny_input, KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery): - KmsEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsPublicKeyDiscoveryInput( - dafny_input.KmsPublicKeyDiscovery - ) - ) - elif isinstance( - dafny_input, KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey - ): - KmsEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsPrivateKeyToStaticPublicKeyInput( - dafny_input.KmsPrivateKeyToStaticPublicKey - ) - ) + KmsEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsPublicKeyDiscoveryInput(dafny_input.KmsPublicKeyDiscovery)) + elif isinstance(dafny_input, KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey): + KmsEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsPrivateKeyToStaticPublicKeyInput(dafny_input.KmsPrivateKeyToStaticPublicKey)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return KmsEcdhStaticConfigurations_union_value - def aws_cryptography_materialproviders_KmsPublicKeyDiscoveryInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsPublicKeyDiscoveryInput( - recipient_kms_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.recipientKmsIdentifier - ).decode("utf-16-be"), + recipient_kms_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.recipientKmsIdentifier).decode('utf-16-be'), ) - def aws_cryptography_materialproviders_KmsPrivateKeyToStaticPublicKeyInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsPrivateKeyToStaticPublicKeyInput( - sender_kms_identifier=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.senderKmsIdentifier - ).decode("utf-16-be"), - sender_public_key=( - (bytes(dafny_input.senderPublicKey.value)) - if (dafny_input.senderPublicKey.is_Some) - else None - ), + sender_kms_identifier=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.senderKmsIdentifier).decode('utf-16-be'), + sender_public_key=(bytes(dafny_input.senderPublicKey.value)) if (dafny_input.senderPublicKey.is_Some) else None, recipient_public_key=bytes(dafny_input.recipientPublicKey), ) - def aws_cryptography_materialproviders_CreateAwsKmsEcdhKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsEcdhKeyringInput( - key_agreement_scheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsEcdhStaticConfigurations( - dafny_input.KeyAgreementScheme - ), - curve_spec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.curveSpec - ), - kms_client=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference( - dafny_input.kmsClient - ) - ) - if (dafny_input.kmsClient is not None) - else None - ), - grant_tokens=( - ( - [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.grantTokens.value - ] - ) - if (dafny_input.grantTokens.is_Some) - else None - ), + key_agreement_scheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsEcdhStaticConfigurations(dafny_input.KeyAgreementScheme), + curve_spec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.curveSpec), + kms_client=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KmsClientReference(dafny_input.kmsClient)) if (dafny_input.kmsClient is not None) else None, + grant_tokens=([b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.grantTokens.value]) if (dafny_input.grantTokens.is_Some) else None, ) - def aws_cryptography_materialproviders_KeyringReference(dafny_input): - if hasattr(dafny_input, "_native_impl"): + if hasattr(dafny_input, '_native_impl'): return dafny_input._native_impl else: - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - Keyring, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import Keyring return Keyring(_impl=dafny_input) - def aws_cryptography_materialproviders_CreateMultiKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateMultiKeyringInput( - generator=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference( - dafny_input.generator.UnwrapOr(None) - ) - ) - if (dafny_input.generator.UnwrapOr(None) is not None) - else None - ), - child_keyrings=[ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference( - list_element - ) - for list_element in dafny_input.childKeyrings - ], + generator=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference(dafny_input.generator.UnwrapOr(None))) if (dafny_input.generator.UnwrapOr(None) is not None) else None, + child_keyrings=[aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference(list_element) for list_element in dafny_input.childKeyrings], ) - def aws_cryptography_materialproviders_AesWrappingAlg(dafny_input): if isinstance(dafny_input, AesWrappingAlg_ALG__AES128__GCM__IV12__TAG16): - return "ALG_AES128_GCM_IV12_TAG16" + return 'ALG_AES128_GCM_IV12_TAG16' elif isinstance(dafny_input, AesWrappingAlg_ALG__AES192__GCM__IV12__TAG16): - return "ALG_AES192_GCM_IV12_TAG16" + return 'ALG_AES192_GCM_IV12_TAG16' elif isinstance(dafny_input, AesWrappingAlg_ALG__AES256__GCM__IV12__TAG16): - return "ALG_AES256_GCM_IV12_TAG16" + return 'ALG_AES256_GCM_IV12_TAG16' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_materialproviders_CreateRawAesKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawAesKeyringInput( - key_namespace=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyNamespace - ).decode("utf-16-be"), - key_name=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyName - ).decode("utf-16-be"), + key_namespace=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyNamespace).decode('utf-16-be'), + key_name=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyName).decode('utf-16-be'), wrapping_key=bytes(dafny_input.wrappingKey), - wrapping_alg=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AesWrappingAlg( - dafny_input.wrappingAlg - ), + wrapping_alg=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AesWrappingAlg(dafny_input.wrappingAlg), ) - def aws_cryptography_materialproviders_PaddingScheme(dafny_input): if isinstance(dafny_input, PaddingScheme_PKCS1): - return "PKCS1" + return 'PKCS1' elif isinstance(dafny_input, PaddingScheme_OAEP__SHA1__MGF1): - return "OAEP_SHA1_MGF1" + return 'OAEP_SHA1_MGF1' elif isinstance(dafny_input, PaddingScheme_OAEP__SHA256__MGF1): - return "OAEP_SHA256_MGF1" + return 'OAEP_SHA256_MGF1' elif isinstance(dafny_input, PaddingScheme_OAEP__SHA384__MGF1): - return "OAEP_SHA384_MGF1" + return 'OAEP_SHA384_MGF1' elif isinstance(dafny_input, PaddingScheme_OAEP__SHA512__MGF1): - return "OAEP_SHA512_MGF1" + return 'OAEP_SHA512_MGF1' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_materialproviders_CreateRawRsaKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawRsaKeyringInput( - key_namespace=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyNamespace - ).decode("utf-16-be"), - key_name=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyName - ).decode("utf-16-be"), - padding_scheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_PaddingScheme( - dafny_input.paddingScheme - ), - public_key=( - (bytes(dafny_input.publicKey.value)) - if (dafny_input.publicKey.is_Some) - else None - ), - private_key=( - (bytes(dafny_input.privateKey.value)) - if (dafny_input.privateKey.is_Some) - else None - ), + key_namespace=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyNamespace).decode('utf-16-be'), + key_name=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyName).decode('utf-16-be'), + padding_scheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_PaddingScheme(dafny_input.paddingScheme), + public_key=(bytes(dafny_input.publicKey.value)) if (dafny_input.publicKey.is_Some) else None, + private_key=(bytes(dafny_input.privateKey.value)) if (dafny_input.privateKey.is_Some) else None, ) - def aws_cryptography_materialproviders_RawEcdhStaticConfigurations(dafny_input): # Convert RawEcdhStaticConfigurations if isinstance(dafny_input, RawEcdhStaticConfigurations_PublicKeyDiscovery): - RawEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsPublicKeyDiscovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_PublicKeyDiscoveryInput( - dafny_input.PublicKeyDiscovery - ) - ) - elif isinstance( - dafny_input, RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey - ): - RawEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_RawPrivateKeyToStaticPublicKeyInput( - dafny_input.RawPrivateKeyToStaticPublicKey - ) - ) - elif isinstance( - dafny_input, RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey - ): - RawEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput( - dafny_input.EphemeralPrivateKeyToStaticPublicKey - ) - ) + RawEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsPublicKeyDiscovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_PublicKeyDiscoveryInput(dafny_input.PublicKeyDiscovery)) + elif isinstance(dafny_input, RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey): + RawEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_RawPrivateKeyToStaticPublicKeyInput(dafny_input.RawPrivateKeyToStaticPublicKey)) + elif isinstance(dafny_input, RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey): + RawEcdhStaticConfigurations_union_value = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput(dafny_input.EphemeralPrivateKeyToStaticPublicKey)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return RawEcdhStaticConfigurations_union_value - def aws_cryptography_materialproviders_PublicKeyDiscoveryInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.PublicKeyDiscoveryInput( recipient_static_private_key=bytes(dafny_input.recipientStaticPrivateKey), ) - def aws_cryptography_materialproviders_RawPrivateKeyToStaticPublicKeyInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawPrivateKeyToStaticPublicKeyInput( sender_static_private_key=bytes(dafny_input.senderStaticPrivateKey), recipient_public_key=bytes(dafny_input.recipientPublicKey), ) - -def aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput( - dafny_input, -): +def aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EphemeralPrivateKeyToStaticPublicKeyInput( recipient_public_key=bytes(dafny_input.recipientPublicKey), ) - def aws_cryptography_materialproviders_CreateRawEcdhKeyringInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawEcdhKeyringInput( - key_agreement_scheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_RawEcdhStaticConfigurations( - dafny_input.KeyAgreementScheme - ), - curve_spec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.curveSpec - ), + key_agreement_scheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_RawEcdhStaticConfigurations(dafny_input.KeyAgreementScheme), + curve_spec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.curveSpec), ) - -def aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput( - dafny_input, -): +def aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateDefaultCryptographicMaterialsManagerInput( - keyring=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference( - dafny_input.keyring - ) - ) - if (dafny_input.keyring is not None) - else None - ), - ) - - -def aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - dafny_input, -): - if hasattr(dafny_input, "_native_impl"): + keyring=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference(dafny_input.keyring)) if (dafny_input.keyring is not None) else None, + ) + +def aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(dafny_input): + if hasattr(dafny_input, '_native_impl'): return dafny_input._native_impl else: - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - CryptographicMaterialsManager, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import CryptographicMaterialsManager return CryptographicMaterialsManager(_impl=dafny_input) - -def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput( - dafny_input, -): +def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRequiredEncryptionContextCMMInput( - underlying_cmm=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - dafny_input.underlyingCMM.UnwrapOr(None) - ) - ) - if (dafny_input.underlyingCMM.UnwrapOr(None) is not None) - else None - ), - keyring=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference( - dafny_input.keyring.UnwrapOr(None) - ) - ) - if (dafny_input.keyring.UnwrapOr(None) is not None) - else None - ), - required_encryption_context_keys=[ - bytes(list_element.Elements).decode("utf-8") - for list_element in dafny_input.requiredEncryptionContextKeys - ], - ) - - -def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateCryptographicMaterialsCacheInput( - cache=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CacheType( - dafny_input.cache - ), + underlying_cmm=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(dafny_input.underlyingCMM.UnwrapOr(None))) if (dafny_input.underlyingCMM.UnwrapOr(None) is not None) else None, + keyring=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference(dafny_input.keyring.UnwrapOr(None))) if (dafny_input.keyring.UnwrapOr(None) is not None) else None, + required_encryption_context_keys=[bytes(list_element.Elements).decode('utf-8') for list_element in dafny_input.requiredEncryptionContextKeys], ) +def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateCryptographicMaterialsCacheInput( + cache=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CacheType(dafny_input.cache), + ) def aws_cryptography_materialproviders_CreateDefaultClientSupplierInput(dafny_input): - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateDefaultClientSupplierInput() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateDefaultClientSupplierInput( ) - def aws_cryptography_materialproviders_InitializeEncryptionMaterialsInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.InitializeEncryptionMaterialsInput( - algorithm_suite_id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId( - dafny_input.algorithmSuiteId - ), - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, - required_encryption_context_keys=[ - bytes(list_element.Elements).decode("utf-8") - for list_element in dafny_input.requiredEncryptionContextKeys - ], - signing_key=( - (bytes(dafny_input.signingKey.value)) - if (dafny_input.signingKey.is_Some) - else None - ), - verification_key=( - (bytes(dafny_input.verificationKey.value)) - if (dafny_input.verificationKey.is_Some) - else None - ), + algorithm_suite_id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input.algorithmSuiteId), + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, + required_encryption_context_keys=[bytes(list_element.Elements).decode('utf-8') for list_element in dafny_input.requiredEncryptionContextKeys], + signing_key=(bytes(dafny_input.signingKey.value)) if (dafny_input.signingKey.is_Some) else None, + verification_key=(bytes(dafny_input.verificationKey.value)) if (dafny_input.verificationKey.is_Some) else None, ) - def aws_cryptography_materialproviders_InitializeDecryptionMaterialsInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.InitializeDecryptionMaterialsInput( - algorithm_suite_id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId( - dafny_input.algorithmSuiteId - ), - encryption_context={ - bytes(key.Elements).decode("utf-8"): bytes(value.Elements).decode("utf-8") - for (key, value) in dafny_input.encryptionContext.items - }, - required_encryption_context_keys=[ - bytes(list_element.Elements).decode("utf-8") - for list_element in dafny_input.requiredEncryptionContextKeys - ], - ) - - -def aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidEncryptionMaterialsTransitionInput( - start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - dafny_input.start - ), - stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - dafny_input.stop - ), + algorithm_suite_id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input.algorithmSuiteId), + encryption_context={bytes(key.Elements).decode('utf-8'): bytes(value.Elements).decode('utf-8') for (key, value) in dafny_input.encryptionContext.items }, + required_encryption_context_keys=[bytes(list_element.Elements).decode('utf-8') for list_element in dafny_input.requiredEncryptionContextKeys], ) +def aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidEncryptionMaterialsTransitionInput( + start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(dafny_input.start), + stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(dafny_input.stop), + ) -def aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput( - dafny_input, -): +def aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidDecryptionMaterialsTransitionInput( - start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - dafny_input.start - ), - stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - dafny_input.stop - ), + start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(dafny_input.start), + stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(dafny_input.stop), ) - def aws_cryptography_materialproviders_GetAlgorithmSuiteInfoInput(dafny_input): return bytes(dafny_input) - -def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput( - dafny_input, -): +def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidateCommitmentPolicyOnEncryptInput( - algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId( - dafny_input.algorithm - ), - commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy( - dafny_input.commitmentPolicy - ), + algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input.algorithm), + commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy(dafny_input.commitmentPolicy), ) - -def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput( - dafny_input, -): +def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput(dafny_input): return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidateCommitmentPolicyOnDecryptInput( - algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId( - dafny_input.algorithm - ), - commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy( - dafny_input.commitmentPolicy - ), + algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteId(dafny_input.algorithm), + commitment_policy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CommitmentPolicy(dafny_input.commitmentPolicy), ) - def aws_cryptography_materialproviders_CreateKeyringOutput(dafny_input): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference( - dafny_input - ) - + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_KeyringReference(dafny_input) -def aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - dafny_input - ) +def aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(dafny_input) +def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(dafny_input) -def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - dafny_input - ) - - -def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference( - dafny_input - ) - +def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference(dafny_input) def aws_cryptography_materialproviders_CreateDefaultClientSupplierOutput(dafny_input): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference( - dafny_input - ) - + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ClientSupplierReference(dafny_input) def aws_cryptography_materialproviders_MaterialProvidersConfig(dafny_input): # Deferred import of .config to avoid circular dependency import aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.config - - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.config.MaterialProvidersConfig() + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.config.MaterialProvidersConfig( ) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/deserialize.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/deserialize.py index a2953d32e..9ec3ab524 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/deserialize.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/deserialize.py @@ -60,262 +60,163 @@ def _deserialize_create_aws_kms_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_aws_kms_discovery_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_aws_kms_multi_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) -def _deserialize_create_aws_kms_discovery_multi_keyring( - input: DafnyResponse, config: Config -): - - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) +def _deserialize_create_aws_kms_discovery_multi_keyring(input: DafnyResponse, config: Config): + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_aws_kms_mrk_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_aws_kms_mrk_multi_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) +def _deserialize_create_aws_kms_mrk_discovery_keyring(input: DafnyResponse, config: Config): -def _deserialize_create_aws_kms_mrk_discovery_keyring( - input: DafnyResponse, config: Config -): + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) +def _deserialize_create_aws_kms_mrk_discovery_multi_keyring(input: DafnyResponse, config: Config): + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) -def _deserialize_create_aws_kms_mrk_discovery_multi_keyring( - input: DafnyResponse, config: Config -): - - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - - -def _deserialize_create_aws_kms_hierarchical_keyring( - input: DafnyResponse, config: Config -): - - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) +def _deserialize_create_aws_kms_hierarchical_keyring(input: DafnyResponse, config: Config): + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_aws_kms_rsa_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_aws_kms_ecdh_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_multi_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_raw_aes_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_raw_rsa_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_raw_ecdh_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) -def _deserialize_create_default_cryptographic_materials_manager( - input: DafnyResponse, config: Config -): +def _deserialize_create_default_cryptographic_materials_manager(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput( - input.value - ) + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput(input.value) +def _deserialize_create_required_encryption_context_cmm(input: DafnyResponse, config: Config): -def _deserialize_create_required_encryption_context_cmm( - input: DafnyResponse, config: Config -): + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput(input.value) - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput( - input.value - ) - - -def _deserialize_create_cryptographic_materials_cache( - input: DafnyResponse, config: Config -): - - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput( - input.value - ) +def _deserialize_create_cryptographic_materials_cache(input: DafnyResponse, config: Config): + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput(input.value) def _deserialize_create_default_client_supplier(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateDefaultClientSupplierOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateDefaultClientSupplierOutput(input.value) def _deserialize_initialize_encryption_materials(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(input.value) def _deserialize_initialize_decryption_materials(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - input.value - ) - - -def _deserialize_valid_encryption_materials_transition( - input: DafnyResponse, config: Config -): - - return None - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(input.value) -def _deserialize_valid_decryption_materials_transition( - input: DafnyResponse, config: Config -): +def _deserialize_valid_encryption_materials_transition(input: DafnyResponse, config: Config): - return None + return None +def _deserialize_valid_decryption_materials_transition(input: DafnyResponse, config: Config): -def _deserialize_encryption_materials_has_plaintext_data_key( - input: DafnyResponse, config: Config -): + return None - return None +def _deserialize_encryption_materials_has_plaintext_data_key(input: DafnyResponse, config: Config): + return None -def _deserialize_decryption_materials_with_plaintext_data_key( - input: DafnyResponse, config: Config -): - - return None +def _deserialize_decryption_materials_with_plaintext_data_key(input: DafnyResponse, config: Config): + return None def _deserialize_get_algorithm_suite_info(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo(input.value) def _deserialize_valid_algorithm_suite_info(input: DafnyResponse, config: Config): - return None - - -def _deserialize_validate_commitment_policy_on_encrypt( - input: DafnyResponse, config: Config -): + return None - return None +def _deserialize_validate_commitment_policy_on_encrypt(input: DafnyResponse, config: Config): + return None -def _deserialize_validate_commitment_policy_on_decrypt( - input: DafnyResponse, config: Config -): - - return None +def _deserialize_validate_commitment_policy_on_decrypt(input: DafnyResponse, config: Config): + return None def _deserialize_error(error: Error) -> ServiceError: if error.is_Opaque: @@ -326,50 +227,32 @@ def _deserialize_error(error: Error) -> ServiceError: list=[_deserialize_error(dafny_e) for dafny_e in error.list], ) elif error.is_AwsCryptographicMaterialProvidersException: - return AwsCryptographicMaterialProvidersException( - message=_dafny.string_of(error.message) - ) + return AwsCryptographicMaterialProvidersException(message=_dafny.string_of(error.message)) elif error.is_EntryAlreadyExists: - return EntryAlreadyExists(message=_dafny.string_of(error.message)) + return EntryAlreadyExists(message=_dafny.string_of(error.message)) elif error.is_EntryDoesNotExist: - return EntryDoesNotExist(message=_dafny.string_of(error.message)) + return EntryDoesNotExist(message=_dafny.string_of(error.message)) elif error.is_InvalidAlgorithmSuiteInfo: - return InvalidAlgorithmSuiteInfo(message=_dafny.string_of(error.message)) + return InvalidAlgorithmSuiteInfo(message=_dafny.string_of(error.message)) elif error.is_InvalidAlgorithmSuiteInfoOnDecrypt: - return InvalidAlgorithmSuiteInfoOnDecrypt( - message=_dafny.string_of(error.message) - ) + return InvalidAlgorithmSuiteInfoOnDecrypt(message=_dafny.string_of(error.message)) elif error.is_InvalidAlgorithmSuiteInfoOnEncrypt: - return InvalidAlgorithmSuiteInfoOnEncrypt( - message=_dafny.string_of(error.message) - ) + return InvalidAlgorithmSuiteInfoOnEncrypt(message=_dafny.string_of(error.message)) elif error.is_InvalidDecryptionMaterials: - return InvalidDecryptionMaterials(message=_dafny.string_of(error.message)) + return InvalidDecryptionMaterials(message=_dafny.string_of(error.message)) elif error.is_InvalidDecryptionMaterialsTransition: - return InvalidDecryptionMaterialsTransition( - message=_dafny.string_of(error.message) - ) + return InvalidDecryptionMaterialsTransition(message=_dafny.string_of(error.message)) elif error.is_InvalidEncryptionMaterials: - return InvalidEncryptionMaterials(message=_dafny.string_of(error.message)) + return InvalidEncryptionMaterials(message=_dafny.string_of(error.message)) elif error.is_InvalidEncryptionMaterialsTransition: - return InvalidEncryptionMaterialsTransition( - message=_dafny.string_of(error.message) - ) + return InvalidEncryptionMaterialsTransition(message=_dafny.string_of(error.message)) elif error.is_AwsCryptographyPrimitives: - return AwsCryptographicPrimitives( - aws_cryptography_primitives_deserialize_error( - error.AwsCryptographyPrimitives - ) - ) + return AwsCryptographicPrimitives(aws_cryptography_primitives_deserialize_error(error.AwsCryptographyPrimitives)) elif error.is_AwsCryptographyKeyStore: - return KeyStore( - aws_cryptography_keystore_deserialize_error(error.AwsCryptographyKeyStore) - ) + return KeyStore(aws_cryptography_keystore_deserialize_error(error.AwsCryptographyKeyStore)) elif error.is_ComAmazonawsKms: return ComAmazonawsKms(message=_dafny.string_of(error.ComAmazonawsKms.message)) elif error.is_ComAmazonawsDynamodb: - return ComAmazonawsDynamodb( - message=_dafny.string_of(error.ComAmazonawsDynamodb.message) - ) + return ComAmazonawsDynamodb(message=_dafny.string_of(error.ComAmazonawsDynamodb.message)) else: return OpaqueError(obj=error, alt_text=repr(error)) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/errors.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/errors.py index a87c7d6ae..253576006 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/errors.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/errors.py @@ -22,38 +22,27 @@ class ServiceError(Exception): - """Base error for all errors in the service.""" - + """Base error for all errors in the service. + """ pass - -T = TypeVar("T") - - +T = TypeVar('T') class ApiError(ServiceError, Generic[T]): - """Base error for all api errors in the service.""" - + """Base error for all api errors in the service. + """ code: T - def __init__(self, message: str): super().__init__(message) self.message = message +class UnknownApiError(ApiError[Literal['Unknown']]): + """Error representing any unknown api errors + """ + code: Literal['Unknown'] = 'Unknown' -class UnknownApiError(ApiError[Literal["Unknown"]]): - """Error representing any unknown api errors.""" - - code: Literal["Unknown"] = "Unknown" - - -class AwsCryptographicMaterialProvidersException( - ApiError[Literal["AwsCryptographicMaterialProvidersException"]] -): - code: Literal["AwsCryptographicMaterialProvidersException"] = ( - "AwsCryptographicMaterialProvidersException" - ) +class AwsCryptographicMaterialProvidersException(ApiError[Literal["AwsCryptographicMaterialProvidersException"]]): + code: Literal["AwsCryptographicMaterialProvidersException"] = "AwsCryptographicMaterialProvidersException" message: str - def __init__( self, *, @@ -62,19 +51,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the AwsCryptographicMaterialProvidersException to a - dictionary.""" + """Converts the AwsCryptographicMaterialProvidersException to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "AwsCryptographicMaterialProvidersException": - """Creates a AwsCryptographicMaterialProvidersException from a - dictionary.""" + """Creates a AwsCryptographicMaterialProvidersException from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return AwsCryptographicMaterialProvidersException(**kwargs) @@ -89,17 +80,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AwsCryptographicMaterialProvidersException): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class InvalidDecryptionMaterials(ApiError[Literal["InvalidDecryptionMaterials"]]): code: Literal["InvalidDecryptionMaterials"] = "InvalidDecryptionMaterials" message: str - def __init__( self, *, @@ -108,17 +97,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the InvalidDecryptionMaterials to a dictionary.""" + """Converts the InvalidDecryptionMaterials to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "InvalidDecryptionMaterials": - """Creates a InvalidDecryptionMaterials from a dictionary.""" + """Creates a InvalidDecryptionMaterials from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return InvalidDecryptionMaterials(**kwargs) @@ -133,17 +126,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InvalidDecryptionMaterials): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class InvalidEncryptionMaterials(ApiError[Literal["InvalidEncryptionMaterials"]]): code: Literal["InvalidEncryptionMaterials"] = "InvalidEncryptionMaterials" message: str - def __init__( self, *, @@ -152,17 +143,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the InvalidEncryptionMaterials to a dictionary.""" + """Converts the InvalidEncryptionMaterials to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "InvalidEncryptionMaterials": - """Creates a InvalidEncryptionMaterials from a dictionary.""" + """Creates a InvalidEncryptionMaterials from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return InvalidEncryptionMaterials(**kwargs) @@ -177,17 +172,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InvalidEncryptionMaterials): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class InvalidAlgorithmSuiteInfo(ApiError[Literal["InvalidAlgorithmSuiteInfo"]]): code: Literal["InvalidAlgorithmSuiteInfo"] = "InvalidAlgorithmSuiteInfo" message: str - def __init__( self, *, @@ -196,17 +189,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the InvalidAlgorithmSuiteInfo to a dictionary.""" + """Converts the InvalidAlgorithmSuiteInfo to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "InvalidAlgorithmSuiteInfo": - """Creates a InvalidAlgorithmSuiteInfo from a dictionary.""" + """Creates a InvalidAlgorithmSuiteInfo from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return InvalidAlgorithmSuiteInfo(**kwargs) @@ -221,21 +218,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InvalidAlgorithmSuiteInfo): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class InvalidAlgorithmSuiteInfoOnDecrypt( - ApiError[Literal["InvalidAlgorithmSuiteInfoOnDecrypt"]] -): - code: Literal["InvalidAlgorithmSuiteInfoOnDecrypt"] = ( - "InvalidAlgorithmSuiteInfoOnDecrypt" - ) - message: str + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class InvalidAlgorithmSuiteInfoOnDecrypt(ApiError[Literal["InvalidAlgorithmSuiteInfoOnDecrypt"]]): + code: Literal["InvalidAlgorithmSuiteInfoOnDecrypt"] = "InvalidAlgorithmSuiteInfoOnDecrypt" + message: str def __init__( self, *, @@ -244,17 +235,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the InvalidAlgorithmSuiteInfoOnDecrypt to a dictionary.""" + """Converts the InvalidAlgorithmSuiteInfoOnDecrypt to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "InvalidAlgorithmSuiteInfoOnDecrypt": - """Creates a InvalidAlgorithmSuiteInfoOnDecrypt from a dictionary.""" + """Creates a InvalidAlgorithmSuiteInfoOnDecrypt from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return InvalidAlgorithmSuiteInfoOnDecrypt(**kwargs) @@ -269,21 +264,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InvalidAlgorithmSuiteInfoOnDecrypt): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class InvalidAlgorithmSuiteInfoOnEncrypt( - ApiError[Literal["InvalidAlgorithmSuiteInfoOnEncrypt"]] -): - code: Literal["InvalidAlgorithmSuiteInfoOnEncrypt"] = ( - "InvalidAlgorithmSuiteInfoOnEncrypt" - ) - message: str + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class InvalidAlgorithmSuiteInfoOnEncrypt(ApiError[Literal["InvalidAlgorithmSuiteInfoOnEncrypt"]]): + code: Literal["InvalidAlgorithmSuiteInfoOnEncrypt"] = "InvalidAlgorithmSuiteInfoOnEncrypt" + message: str def __init__( self, *, @@ -292,17 +281,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the InvalidAlgorithmSuiteInfoOnEncrypt to a dictionary.""" + """Converts the InvalidAlgorithmSuiteInfoOnEncrypt to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "InvalidAlgorithmSuiteInfoOnEncrypt": - """Creates a InvalidAlgorithmSuiteInfoOnEncrypt from a dictionary.""" + """Creates a InvalidAlgorithmSuiteInfoOnEncrypt from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return InvalidAlgorithmSuiteInfoOnEncrypt(**kwargs) @@ -317,21 +310,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InvalidAlgorithmSuiteInfoOnEncrypt): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class InvalidDecryptionMaterialsTransition( - ApiError[Literal["InvalidDecryptionMaterialsTransition"]] -): - code: Literal["InvalidDecryptionMaterialsTransition"] = ( - "InvalidDecryptionMaterialsTransition" - ) - message: str + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class InvalidDecryptionMaterialsTransition(ApiError[Literal["InvalidDecryptionMaterialsTransition"]]): + code: Literal["InvalidDecryptionMaterialsTransition"] = "InvalidDecryptionMaterialsTransition" + message: str def __init__( self, *, @@ -340,18 +327,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the InvalidDecryptionMaterialsTransition to a - dictionary.""" + """Converts the InvalidDecryptionMaterialsTransition to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "InvalidDecryptionMaterialsTransition": - """Creates a InvalidDecryptionMaterialsTransition from a dictionary.""" + """Creates a InvalidDecryptionMaterialsTransition from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return InvalidDecryptionMaterialsTransition(**kwargs) @@ -366,21 +356,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InvalidDecryptionMaterialsTransition): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class InvalidEncryptionMaterialsTransition( - ApiError[Literal["InvalidEncryptionMaterialsTransition"]] -): - code: Literal["InvalidEncryptionMaterialsTransition"] = ( - "InvalidEncryptionMaterialsTransition" - ) - message: str + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class InvalidEncryptionMaterialsTransition(ApiError[Literal["InvalidEncryptionMaterialsTransition"]]): + code: Literal["InvalidEncryptionMaterialsTransition"] = "InvalidEncryptionMaterialsTransition" + message: str def __init__( self, *, @@ -389,18 +373,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the InvalidEncryptionMaterialsTransition to a - dictionary.""" + """Converts the InvalidEncryptionMaterialsTransition to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "InvalidEncryptionMaterialsTransition": - """Creates a InvalidEncryptionMaterialsTransition from a dictionary.""" + """Creates a InvalidEncryptionMaterialsTransition from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return InvalidEncryptionMaterialsTransition(**kwargs) @@ -415,17 +402,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InvalidEncryptionMaterialsTransition): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class EntryAlreadyExists(ApiError[Literal["EntryAlreadyExists"]]): code: Literal["EntryAlreadyExists"] = "EntryAlreadyExists" message: str - def __init__( self, *, @@ -434,17 +419,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the EntryAlreadyExists to a dictionary.""" + """Converts the EntryAlreadyExists to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "EntryAlreadyExists": - """Creates a EntryAlreadyExists from a dictionary.""" + """Creates a EntryAlreadyExists from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return EntryAlreadyExists(**kwargs) @@ -459,17 +448,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, EntryAlreadyExists): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class EntryDoesNotExist(ApiError[Literal["EntryDoesNotExist"]]): code: Literal["EntryDoesNotExist"] = "EntryDoesNotExist" message: str - def __init__( self, *, @@ -478,17 +465,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the EntryDoesNotExist to a dictionary.""" + """Converts the EntryDoesNotExist to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "EntryDoesNotExist": - """Creates a EntryDoesNotExist from a dictionary.""" + """Creates a EntryDoesNotExist from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return EntryDoesNotExist(**kwargs) @@ -503,138 +494,110 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, EntryDoesNotExist): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class AwsCryptographicMaterialProvidersException( - ApiError[Literal["AwsCryptographicMaterialProvidersException"]] -): - code: Literal["AwsCryptographicMaterialProvidersException"] = ( - "AwsCryptographicMaterialProvidersException" - ) - message: str + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class AwsCryptographicMaterialProvidersException(ApiError[Literal["AwsCryptographicMaterialProvidersException"]]): + code: Literal["AwsCryptographicMaterialProvidersException"] = "AwsCryptographicMaterialProvidersException" + message: str class EntryAlreadyExists(ApiError[Literal["EntryAlreadyExists"]]): code: Literal["EntryAlreadyExists"] = "EntryAlreadyExists" message: str - class EntryDoesNotExist(ApiError[Literal["EntryDoesNotExist"]]): code: Literal["EntryDoesNotExist"] = "EntryDoesNotExist" message: str - class InvalidAlgorithmSuiteInfo(ApiError[Literal["InvalidAlgorithmSuiteInfo"]]): code: Literal["InvalidAlgorithmSuiteInfo"] = "InvalidAlgorithmSuiteInfo" message: str - -class InvalidAlgorithmSuiteInfoOnDecrypt( - ApiError[Literal["InvalidAlgorithmSuiteInfoOnDecrypt"]] -): - code: Literal["InvalidAlgorithmSuiteInfoOnDecrypt"] = ( - "InvalidAlgorithmSuiteInfoOnDecrypt" - ) +class InvalidAlgorithmSuiteInfoOnDecrypt(ApiError[Literal["InvalidAlgorithmSuiteInfoOnDecrypt"]]): + code: Literal["InvalidAlgorithmSuiteInfoOnDecrypt"] = "InvalidAlgorithmSuiteInfoOnDecrypt" message: str - -class InvalidAlgorithmSuiteInfoOnEncrypt( - ApiError[Literal["InvalidAlgorithmSuiteInfoOnEncrypt"]] -): - code: Literal["InvalidAlgorithmSuiteInfoOnEncrypt"] = ( - "InvalidAlgorithmSuiteInfoOnEncrypt" - ) +class InvalidAlgorithmSuiteInfoOnEncrypt(ApiError[Literal["InvalidAlgorithmSuiteInfoOnEncrypt"]]): + code: Literal["InvalidAlgorithmSuiteInfoOnEncrypt"] = "InvalidAlgorithmSuiteInfoOnEncrypt" message: str - class InvalidDecryptionMaterials(ApiError[Literal["InvalidDecryptionMaterials"]]): code: Literal["InvalidDecryptionMaterials"] = "InvalidDecryptionMaterials" message: str - -class InvalidDecryptionMaterialsTransition( - ApiError[Literal["InvalidDecryptionMaterialsTransition"]] -): - code: Literal["InvalidDecryptionMaterialsTransition"] = ( - "InvalidDecryptionMaterialsTransition" - ) +class InvalidDecryptionMaterialsTransition(ApiError[Literal["InvalidDecryptionMaterialsTransition"]]): + code: Literal["InvalidDecryptionMaterialsTransition"] = "InvalidDecryptionMaterialsTransition" message: str - class InvalidEncryptionMaterials(ApiError[Literal["InvalidEncryptionMaterials"]]): code: Literal["InvalidEncryptionMaterials"] = "InvalidEncryptionMaterials" message: str - -class InvalidEncryptionMaterialsTransition( - ApiError[Literal["InvalidEncryptionMaterialsTransition"]] -): - code: Literal["InvalidEncryptionMaterialsTransition"] = ( - "InvalidEncryptionMaterialsTransition" - ) +class InvalidEncryptionMaterialsTransition(ApiError[Literal["InvalidEncryptionMaterialsTransition"]]): + code: Literal["InvalidEncryptionMaterialsTransition"] = "InvalidEncryptionMaterialsTransition" message: str - class AwsCryptographicPrimitives(ApiError[Literal["AwsCryptographicPrimitives"]]): AwsCryptographicPrimitives: Any - class ComAmazonawsDynamodb(ApiError[Literal["ComAmazonawsDynamodb"]]): ComAmazonawsDynamodb: Any - class ComAmazonawsKms(ApiError[Literal["ComAmazonawsKms"]]): ComAmazonawsKms: Any - class KeyStore(ApiError[Literal["KeyStore"]]): KeyStore: Any - class CollectionOfErrors(ApiError[Literal["CollectionOfErrors"]]): code: Literal["CollectionOfErrors"] = "CollectionOfErrors" message: str list: List[ServiceError] - def __init__(self, *, message: str, list): + def __init__( + self, + *, + message: str, + list + ): super().__init__(message) self.list = list def as_dict(self) -> Dict[str, Any]: """Converts the CollectionOfErrors to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "list": self.list, + 'message': self.message, + 'code': self.code, + 'list': self.list, } @staticmethod def from_dict(d: Dict[str, Any]) -> "CollectionOfErrors": """Creates a CollectionOfErrors from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ - kwargs: Dict[str, Any] = {"message": d["message"], "list": d["list"]} + kwargs: Dict[str, Any] = { + 'message': d['message'], + 'list': d['list'] + } return CollectionOfErrors(**kwargs) def __repr__(self) -> str: result = "CollectionOfErrors(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"list={self.list}" + result += f'list={self.list}' result += ")" return result @@ -643,15 +606,22 @@ def __eq__(self, other: Any) -> bool: return False if not (self.list == other.list): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OpaqueError(ApiError[Literal["OpaqueError"]]): code: Literal["OpaqueError"] = "OpaqueError" obj: Any # As an OpaqueError, type of obj is unknown - def __init__(self, *, obj, alt_text): + def __init__( + self, + *, + obj, + alt_text + ): super().__init__("") self.obj = obj self.alt_text = alt_text @@ -659,38 +629,37 @@ def __init__(self, *, obj, alt_text): def as_dict(self) -> Dict[str, Any]: """Converts the OpaqueError to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "obj": self.obj, - "alt_text": self.alt_text, + 'message': self.message, + 'code': self.code, + 'obj': self.obj, + 'alt_text': self.alt_text, } @staticmethod def from_dict(d: Dict[str, Any]) -> "OpaqueError": """Creates a OpaqueError from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ kwargs: Dict[str, Any] = { - "message": d["message"], - "obj": d["obj"], - "alt_text": d["alt_text"], + 'message': d['message'], + 'obj': d['obj'], + 'alt_text': d['alt_text'] } return OpaqueError(**kwargs) def __repr__(self) -> str: result = "OpaqueError(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"obj={self.alt_text}" + result += f'obj={self.alt_text}' result += ")" return result @@ -699,135 +668,75 @@ def __eq__(self, other: Any) -> bool: return False if not (self.obj == other.obj): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) def _smithy_error_to_dafny_error(e: ServiceError): - """Converts the provided native Smithy-modeled error into the corresponding - Dafny error.""" - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.AwsCryptographicMaterialProvidersException, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_AwsCryptographicMaterialProvidersException( - message=_dafny.Seq(e.message) - ) + """ + Converts the provided native Smithy-modeled error + into the corresponding Dafny error. + """ + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.AwsCryptographicMaterialProvidersException): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_AwsCryptographicMaterialProvidersException(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.EntryAlreadyExists, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_EntryAlreadyExists( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.EntryAlreadyExists): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_EntryAlreadyExists(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.EntryDoesNotExist, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_EntryDoesNotExist( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.EntryDoesNotExist): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_EntryDoesNotExist(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidAlgorithmSuiteInfo, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidAlgorithmSuiteInfo( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidAlgorithmSuiteInfo): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidAlgorithmSuiteInfo(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidAlgorithmSuiteInfoOnDecrypt, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidAlgorithmSuiteInfoOnDecrypt( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidAlgorithmSuiteInfoOnDecrypt): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidAlgorithmSuiteInfoOnDecrypt(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidAlgorithmSuiteInfoOnEncrypt, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidAlgorithmSuiteInfoOnEncrypt( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidAlgorithmSuiteInfoOnEncrypt): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidAlgorithmSuiteInfoOnEncrypt(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidDecryptionMaterials, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidDecryptionMaterials( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidDecryptionMaterials): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidDecryptionMaterials(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidDecryptionMaterialsTransition, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidDecryptionMaterialsTransition( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidDecryptionMaterialsTransition): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidDecryptionMaterialsTransition(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidEncryptionMaterials, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidEncryptionMaterials( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidEncryptionMaterials): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidEncryptionMaterials(message=_dafny.Seq(e.message)) - if isinstance( - e, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidEncryptionMaterialsTransition, - ): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidEncryptionMaterialsTransition( - message=_dafny.Seq(e.message) - ) + if isinstance(e, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.errors.InvalidEncryptionMaterialsTransition): + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_InvalidEncryptionMaterialsTransition(message=_dafny.Seq(e.message)) if isinstance(e, AwsCryptographicPrimitives): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_AwsCryptographyPrimitives( - aws_cryptography_primitives_smithy_error_to_dafny_error(e.message) - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_AwsCryptographyPrimitives(aws_cryptography_primitives_smithy_error_to_dafny_error(e.message)) if isinstance(e, ComAmazonawsDynamodb): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_ComAmazonawsDynamodb( - com_amazonaws_dynamodb_sdk_error_to_dafny_error(e.message) - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_ComAmazonawsDynamodb(com_amazonaws_dynamodb_sdk_error_to_dafny_error(e.message)) if isinstance(e, ComAmazonawsKms): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_ComAmazonawsKms( - com_amazonaws_kms_sdk_error_to_dafny_error(e.message) - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_ComAmazonawsKms(com_amazonaws_kms_sdk_error_to_dafny_error(e.message)) if isinstance(e, KeyStore): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_AwsCryptographyKeyStore( - aws_cryptography_keystore_smithy_error_to_dafny_error(e.message) - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_AwsCryptographyKeyStore(aws_cryptography_keystore_smithy_error_to_dafny_error(e.message)) if isinstance(e, CollectionOfErrors): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_CollectionOfErrors( - message=_dafny.Seq(e.message), - list=_dafny.Seq( - _smithy_error_to_dafny_error(native_err) for native_err in e.list - ), - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_CollectionOfErrors(message=_dafny.Seq(e.message), list=_dafny.Seq( + _smithy_error_to_dafny_error(native_err) for native_err in e.list + )) if isinstance(e, OpaqueError): - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_Opaque( - obj=e.obj, alt__text=e.alt_text - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_Opaque(obj=e.obj, alt__text=e.alt_text) else: - return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_Opaque( - obj=e, - alt__text=_dafny.Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip(*[iter(repr(e).encode("utf-16-be"))] * 2) - ] - ) - ), - ) + return aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.Error_Opaque(obj=e, alt__text=_dafny.Seq( + "".join( + [ + chr(int.from_bytes(pair, "big")) + for pair in zip( + *[iter(repr(e).encode("utf-16-be"))] * 2 + ) + ] + ) + )) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/models.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/models.py index 12b8bf9ea..6fa3d4395 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/models.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/models.py @@ -23,14 +23,7 @@ class AesWrappingAlg: # This set contains every possible value known at the time this was generated. New # values may be added in the future. - values = frozenset( - { - "ALG_AES128_GCM_IV12_TAG16", - "ALG_AES192_GCM_IV12_TAG16", - "ALG_AES256_GCM_IV12_TAG16", - } - ) - + values = frozenset({"ALG_AES128_GCM_IV12_TAG16", "ALG_AES192_GCM_IV12_TAG16", "ALG_AES256_GCM_IV12_TAG16"}) class DBEAlgorithmSuiteId: ALG_AES_256_GCM_HKDF_SHA512_COMMIT_KEY_SYMSIG_HMAC_SHA384 = "0x6700" @@ -41,7 +34,6 @@ class DBEAlgorithmSuiteId: # values may be added in the future. values = frozenset({"0x6700", "0x6701"}) - class ESDKAlgorithmSuiteId: ALG_AES_128_GCM_IV12_TAG16_NO_KDF = "0x0014" @@ -67,24 +59,9 @@ class ESDKAlgorithmSuiteId: # This set contains every possible value known at the time this was generated. New # values may be added in the future. - values = frozenset( - { - "0x0014", - "0x0046", - "0x0078", - "0x0114", - "0x0146", - "0x0178", - "0x0214", - "0x0346", - "0x0378", - "0x0478", - "0x0578", - } - ) + values = frozenset({"0x0014", "0x0046", "0x0078", "0x0114", "0x0146", "0x0178", "0x0214", "0x0346", "0x0378", "0x0478", "0x0578"}) - -class AlgorithmSuiteIdESDK: +class AlgorithmSuiteIdESDK(): def __init__(self, value: str): self.value = value @@ -93,7 +70,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AlgorithmSuiteIdESDK": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return AlgorithmSuiteIdESDK(d["ESDK"]) @@ -106,8 +83,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class AlgorithmSuiteIdDBE: +class AlgorithmSuiteIdDBE(): def __init__(self, value: str): self.value = value @@ -116,7 +92,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AlgorithmSuiteIdDBE": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return AlgorithmSuiteIdDBE(d["DBE"]) @@ -129,12 +105,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class AlgorithmSuiteIdUnknown: +class AlgorithmSuiteIdUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -147,19 +122,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AlgorithmSuiteIdUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return AlgorithmSuiteIdUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"AlgorithmSuiteIdUnknown(tag={self.tag})" - -AlgorithmSuiteId = Union[ - AlgorithmSuiteIdESDK, AlgorithmSuiteIdDBE, AlgorithmSuiteIdUnknown -] - - +AlgorithmSuiteId = Union[AlgorithmSuiteIdESDK, AlgorithmSuiteIdDBE, AlgorithmSuiteIdUnknown] def _algorithm_suite_id_from_dict(d: Dict[str, Any]) -> AlgorithmSuiteId: if "ESDK" in d: return AlgorithmSuiteIdESDK.from_dict(d) @@ -167,15 +137,13 @@ def _algorithm_suite_id_from_dict(d: Dict[str, Any]) -> AlgorithmSuiteId: if "DBE" in d: return AlgorithmSuiteIdDBE.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class HKDF: hmac: str salt_length: int input_key_length: int output_key_length: int - def __init__( self, *, @@ -205,7 +173,9 @@ def __init__( self.output_key_length = output_key_length def as_dict(self) -> Dict[str, Any]: - """Converts the HKDF to a dictionary.""" + """Converts the HKDF to a dictionary. + + """ d: Dict[str, Any] = { "hmac": self.hmac, } @@ -223,7 +193,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "HKDF": - """Creates a HKDF from a dictionary.""" + """Creates a HKDF from a dictionary. + + """ kwargs: Dict[str, Any] = { "hmac": d["hmac"], } @@ -258,23 +230,24 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, HKDF): return False - attributes: list[str] = [ - "hmac", - "salt_length", - "input_key_length", - "output_key_length", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['hmac','salt_length','input_key_length','output_key_length',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class IDENTITY: def as_dict(self) -> Dict[str, Any]: - """Converts the IDENTITY to a dictionary.""" + """Converts the IDENTITY to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "IDENTITY": - """Creates a IDENTITY from a dictionary.""" + """Creates a IDENTITY from a dictionary. + + """ return IDENTITY() def __repr__(self) -> str: @@ -285,15 +258,18 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, IDENTITY) - class None_: def as_dict(self) -> Dict[str, Any]: - """Converts the None_ to a dictionary.""" + """Converts the None_ to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "None_": - """Creates a None_ from a dictionary.""" + """Creates a None_ from a dictionary. + + """ return None_() def __repr__(self) -> str: @@ -304,8 +280,7 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, None_) - -class DerivationAlgorithmHKDF: +class DerivationAlgorithmHKDF(): def __init__(self, value: HKDF): self.value = value @@ -314,7 +289,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DerivationAlgorithmHKDF": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return DerivationAlgorithmHKDF(HKDF.from_dict(d["HKDF"])) @@ -327,8 +302,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class DerivationAlgorithmIDENTITY: +class DerivationAlgorithmIDENTITY(): def __init__(self, value: IDENTITY): self.value = value @@ -337,7 +311,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DerivationAlgorithmIDENTITY": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return DerivationAlgorithmIDENTITY(IDENTITY.from_dict(d["IDENTITY"])) @@ -350,8 +324,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class DerivationAlgorithmNone: +class DerivationAlgorithmNone(): def __init__(self, value: None_): self.value = value @@ -360,7 +333,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DerivationAlgorithmNone": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return DerivationAlgorithmNone(None_.from_dict(d["None"])) @@ -373,12 +346,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class DerivationAlgorithmUnknown: +class DerivationAlgorithmUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -391,22 +363,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DerivationAlgorithmUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return DerivationAlgorithmUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"DerivationAlgorithmUnknown(tag={self.tag})" - -DerivationAlgorithm = Union[ - DerivationAlgorithmHKDF, - DerivationAlgorithmIDENTITY, - DerivationAlgorithmNone, - DerivationAlgorithmUnknown, -] - - +DerivationAlgorithm = Union[DerivationAlgorithmHKDF, DerivationAlgorithmIDENTITY, DerivationAlgorithmNone, DerivationAlgorithmUnknown] def _derivation_algorithm_from_dict(d: Dict[str, Any]) -> DerivationAlgorithm: if "HKDF" in d: return DerivationAlgorithmHKDF.from_dict(d) @@ -417,17 +381,20 @@ def _derivation_algorithm_from_dict(d: Dict[str, Any]) -> DerivationAlgorithm: if "None" in d: return DerivationAlgorithmNone.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class DIRECT_KEY_WRAPPING: def as_dict(self) -> Dict[str, Any]: - """Converts the DIRECT_KEY_WRAPPING to a dictionary.""" + """Converts the DIRECT_KEY_WRAPPING to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "DIRECT_KEY_WRAPPING": - """Creates a DIRECT_KEY_WRAPPING from a dictionary.""" + """Creates a DIRECT_KEY_WRAPPING from a dictionary. + + """ return DIRECT_KEY_WRAPPING() def __repr__(self) -> str: @@ -438,8 +405,7 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, DIRECT_KEY_WRAPPING) - -class EncryptAES_GCM: +class EncryptAES_GCM(): def __init__(self, value: AES_GCM): self.value = value @@ -448,7 +414,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "EncryptAES_GCM": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return EncryptAES_GCM(AES_GCM.from_dict(d["AES_GCM"])) @@ -461,12 +427,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class EncryptUnknown: +class EncryptUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -479,29 +444,24 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "EncryptUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return EncryptUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"EncryptUnknown(tag={self.tag})" - Encrypt = Union[EncryptAES_GCM, EncryptUnknown] - - def _encrypt_from_dict(d: Dict[str, Any]) -> Encrypt: if "AES_GCM" in d: return EncryptAES_GCM.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class IntermediateKeyWrapping: key_encryption_key_kdf: DerivationAlgorithm mac_key_kdf: DerivationAlgorithm pdk_encrypt_algorithm: Encrypt - def __init__( self, *, @@ -514,7 +474,9 @@ def __init__( self.pdk_encrypt_algorithm = pdk_encrypt_algorithm def as_dict(self) -> Dict[str, Any]: - """Converts the IntermediateKeyWrapping to a dictionary.""" + """Converts the IntermediateKeyWrapping to a dictionary. + + """ return { "key_encryption_key_kdf": self.key_encryption_key_kdf.as_dict(), "mac_key_kdf": self.mac_key_kdf.as_dict(), @@ -523,11 +485,11 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "IntermediateKeyWrapping": - """Creates a IntermediateKeyWrapping from a dictionary.""" + """Creates a IntermediateKeyWrapping from a dictionary. + + """ kwargs: Dict[str, Any] = { - "key_encryption_key_kdf": _derivation_algorithm_from_dict( - d["key_encryption_key_kdf"] - ), + "key_encryption_key_kdf": _derivation_algorithm_from_dict(d["key_encryption_key_kdf"]), "mac_key_kdf": _derivation_algorithm_from_dict(d["mac_key_kdf"]), "pdk_encrypt_algorithm": _encrypt_from_dict(d["pdk_encrypt_algorithm"]), } @@ -550,15 +512,13 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, IntermediateKeyWrapping): return False - attributes: list[str] = [ - "key_encryption_key_kdf", - "mac_key_kdf", - "pdk_encrypt_algorithm", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_encryption_key_kdf','mac_key_kdf','pdk_encrypt_algorithm',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) -class EdkWrappingAlgorithmDIRECT_KEY_WRAPPING: +class EdkWrappingAlgorithmDIRECT_KEY_WRAPPING(): def __init__(self, value: DIRECT_KEY_WRAPPING): self.value = value @@ -567,12 +527,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "EdkWrappingAlgorithmDIRECT_KEY_WRAPPING": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return EdkWrappingAlgorithmDIRECT_KEY_WRAPPING( - DIRECT_KEY_WRAPPING.from_dict(d["DIRECT_KEY_WRAPPING"]) - ) + return EdkWrappingAlgorithmDIRECT_KEY_WRAPPING(DIRECT_KEY_WRAPPING.from_dict(d["DIRECT_KEY_WRAPPING"])) def __repr__(self) -> str: return f"EdkWrappingAlgorithmDIRECT_KEY_WRAPPING(value=repr(self.value))" @@ -582,8 +540,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class EdkWrappingAlgorithmIntermediateKeyWrapping: +class EdkWrappingAlgorithmIntermediateKeyWrapping(): def __init__(self, value: IntermediateKeyWrapping): self.value = value @@ -592,12 +549,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "EdkWrappingAlgorithmIntermediateKeyWrapping": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return EdkWrappingAlgorithmIntermediateKeyWrapping( - IntermediateKeyWrapping.from_dict(d["IntermediateKeyWrapping"]) - ) + return EdkWrappingAlgorithmIntermediateKeyWrapping(IntermediateKeyWrapping.from_dict(d["IntermediateKeyWrapping"])) def __repr__(self) -> str: return f"EdkWrappingAlgorithmIntermediateKeyWrapping(value=repr(self.value))" @@ -607,12 +562,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class EdkWrappingAlgorithmUnknown: +class EdkWrappingAlgorithmUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -625,21 +579,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "EdkWrappingAlgorithmUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return EdkWrappingAlgorithmUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"EdkWrappingAlgorithmUnknown(tag={self.tag})" - -EdkWrappingAlgorithm = Union[ - EdkWrappingAlgorithmDIRECT_KEY_WRAPPING, - EdkWrappingAlgorithmIntermediateKeyWrapping, - EdkWrappingAlgorithmUnknown, -] - - +EdkWrappingAlgorithm = Union[EdkWrappingAlgorithmDIRECT_KEY_WRAPPING, EdkWrappingAlgorithmIntermediateKeyWrapping, EdkWrappingAlgorithmUnknown] def _edk_wrapping_algorithm_from_dict(d: Dict[str, Any]) -> EdkWrappingAlgorithm: if "DIRECT_KEY_WRAPPING" in d: return EdkWrappingAlgorithmDIRECT_KEY_WRAPPING.from_dict(d) @@ -647,12 +594,10 @@ def _edk_wrapping_algorithm_from_dict(d: Dict[str, Any]) -> EdkWrappingAlgorithm if "IntermediateKeyWrapping" in d: return EdkWrappingAlgorithmIntermediateKeyWrapping.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class ECDSA: curve: str - def __init__( self, *, @@ -661,14 +606,18 @@ def __init__( self.curve = curve def as_dict(self) -> Dict[str, Any]: - """Converts the ECDSA to a dictionary.""" + """Converts the ECDSA to a dictionary. + + """ return { "curve": self.curve, } @staticmethod def from_dict(d: Dict[str, Any]) -> "ECDSA": - """Creates a ECDSA from a dictionary.""" + """Creates a ECDSA from a dictionary. + + """ kwargs: Dict[str, Any] = { "curve": d["curve"], } @@ -685,13 +634,13 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ECDSA): return False - attributes: list[str] = [ - "curve", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['curve',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) -class SignatureAlgorithmECDSA: +class SignatureAlgorithmECDSA(): def __init__(self, value: ECDSA): self.value = value @@ -700,7 +649,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "SignatureAlgorithmECDSA": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return SignatureAlgorithmECDSA(ECDSA.from_dict(d["ECDSA"])) @@ -713,8 +662,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class SignatureAlgorithmNone: +class SignatureAlgorithmNone(): def __init__(self, value: None_): self.value = value @@ -723,7 +671,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "SignatureAlgorithmNone": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return SignatureAlgorithmNone(None_.from_dict(d["None"])) @@ -736,12 +684,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class SignatureAlgorithmUnknown: +class SignatureAlgorithmUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -754,19 +701,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "SignatureAlgorithmUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return SignatureAlgorithmUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"SignatureAlgorithmUnknown(tag={self.tag})" - -SignatureAlgorithm = Union[ - SignatureAlgorithmECDSA, SignatureAlgorithmNone, SignatureAlgorithmUnknown -] - - +SignatureAlgorithm = Union[SignatureAlgorithmECDSA, SignatureAlgorithmNone, SignatureAlgorithmUnknown] def _signature_algorithm_from_dict(d: Dict[str, Any]) -> SignatureAlgorithm: if "ECDSA" in d: return SignatureAlgorithmECDSA.from_dict(d) @@ -774,10 +716,9 @@ def _signature_algorithm_from_dict(d: Dict[str, Any]) -> SignatureAlgorithm: if "None" in d: return SignatureAlgorithmNone.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') - -class SymmetricSignatureAlgorithmHMAC: +class SymmetricSignatureAlgorithmHMAC(): def __init__(self, value: str): self.value = value @@ -786,7 +727,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "SymmetricSignatureAlgorithmHMAC": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return SymmetricSignatureAlgorithmHMAC(d["HMAC"]) @@ -799,8 +740,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class SymmetricSignatureAlgorithmNone: +class SymmetricSignatureAlgorithmNone(): def __init__(self, value: None_): self.value = value @@ -809,7 +749,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "SymmetricSignatureAlgorithmNone": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return SymmetricSignatureAlgorithmNone(None_.from_dict(d["None"])) @@ -822,12 +762,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class SymmetricSignatureAlgorithmUnknown: +class SymmetricSignatureAlgorithmUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -840,32 +779,22 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "SymmetricSignatureAlgorithmUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return SymmetricSignatureAlgorithmUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"SymmetricSignatureAlgorithmUnknown(tag={self.tag})" - -SymmetricSignatureAlgorithm = Union[ - SymmetricSignatureAlgorithmHMAC, - SymmetricSignatureAlgorithmNone, - SymmetricSignatureAlgorithmUnknown, -] - - -def _symmetric_signature_algorithm_from_dict( - d: Dict[str, Any] -) -> SymmetricSignatureAlgorithm: +SymmetricSignatureAlgorithm = Union[SymmetricSignatureAlgorithmHMAC, SymmetricSignatureAlgorithmNone, SymmetricSignatureAlgorithmUnknown] +def _symmetric_signature_algorithm_from_dict(d: Dict[str, Any]) -> SymmetricSignatureAlgorithm: if "HMAC" in d: return SymmetricSignatureAlgorithmHMAC.from_dict(d) if "None" in d: return SymmetricSignatureAlgorithmNone.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class AlgorithmSuiteInfo: id: AlgorithmSuiteId @@ -877,7 +806,6 @@ class AlgorithmSuiteInfo: signature: SignatureAlgorithm symmetric_signature: SymmetricSignatureAlgorithm edk_wrapping: EdkWrappingAlgorithm - def __init__( self, *, @@ -902,7 +830,9 @@ def __init__( self.edk_wrapping = edk_wrapping def as_dict(self) -> Dict[str, Any]: - """Converts the AlgorithmSuiteInfo to a dictionary.""" + """Converts the AlgorithmSuiteInfo to a dictionary. + + """ return { "id": self.id.as_dict(), "binary_id": self.binary_id, @@ -917,7 +847,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AlgorithmSuiteInfo": - """Creates a AlgorithmSuiteInfo from a dictionary.""" + """Creates a AlgorithmSuiteInfo from a dictionary. + + """ kwargs: Dict[str, Any] = { "id": _algorithm_suite_id_from_dict(d["id"]), "binary_id": d["binary_id"], @@ -926,9 +858,7 @@ def from_dict(d: Dict[str, Any]) -> "AlgorithmSuiteInfo": "kdf": _derivation_algorithm_from_dict(d["kdf"]), "commitment": _derivation_algorithm_from_dict(d["commitment"]), "signature": _signature_algorithm_from_dict(d["signature"]), - "symmetric_signature": _symmetric_signature_algorithm_from_dict( - d["symmetric_signature"] - ), + "symmetric_signature": _symmetric_signature_algorithm_from_dict(d["symmetric_signature"]), "edk_wrapping": _edk_wrapping_algorithm_from_dict(d["edk_wrapping"]), } @@ -968,45 +898,40 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AlgorithmSuiteInfo): return False - attributes: list[str] = [ - "id", - "binary_id", - "message_version", - "encrypt", - "kdf", - "commitment", - "signature", - "symmetric_signature", - "edk_wrapping", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['id','binary_id','message_version','encrypt','kdf','commitment','signature','symmetric_signature','edk_wrapping',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetBranchKeyIdInput: encryption_context: dict[str, str] - def __init__( self, *, encryption_context: dict[str, str], ): - """Inputs for determining the Branch Key which should be used to wrap - or unwrap the data key for this encryption or decryption. + """Inputs for determining the Branch Key which should be used to wrap or unwrap the + data key for this encryption or decryption - :param encryption_context: The Encryption Context used with this - encryption or decryption. + :param encryption_context: The Encryption Context used with this encryption or + decryption. """ self.encryption_context = encryption_context def as_dict(self) -> Dict[str, Any]: - """Converts the GetBranchKeyIdInput to a dictionary.""" + """Converts the GetBranchKeyIdInput to a dictionary. + + """ return { "encryption_context": self.encryption_context, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetBranchKeyIdInput": - """Creates a GetBranchKeyIdInput from a dictionary.""" + """Creates a GetBranchKeyIdInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "encryption_context": d["encryption_context"], } @@ -1023,38 +948,41 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetBranchKeyIdInput): return False - attributes: list[str] = [ - "encryption_context", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['encryption_context',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetBranchKeyIdOutput: branch_key_id: str - def __init__( self, *, branch_key_id: str, ): - """Outputs for the Branch Key responsible for wrapping or unwrapping - the data key in this encryption or decryption. + """Outputs for the Branch Key responsible for wrapping or unwrapping the data key + in this encryption or decryption. - :param branch_key_id: The identifier of the Branch Key that - should be responsible for wrapping or unwrapping the data - key in this encryption or decryption. + :param branch_key_id: The identifier of the Branch Key that should be + responsible for wrapping or unwrapping the data key in this encryption or + decryption. """ self.branch_key_id = branch_key_id def as_dict(self) -> Dict[str, Any]: - """Converts the GetBranchKeyIdOutput to a dictionary.""" + """Converts the GetBranchKeyIdOutput to a dictionary. + + """ return { "branch_key_id": self.branch_key_id, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetBranchKeyIdOutput": - """Creates a GetBranchKeyIdOutput from a dictionary.""" + """Creates a GetBranchKeyIdOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "branch_key_id": d["branch_key_id"], } @@ -1071,15 +999,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetBranchKeyIdOutput): return False - attributes: list[str] = [ - "branch_key_id", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_id',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetClientInput: region: str - def __init__( self, *, @@ -1092,14 +1019,18 @@ def __init__( self.region = region def as_dict(self) -> Dict[str, Any]: - """Converts the GetClientInput to a dictionary.""" + """Converts the GetClientInput to a dictionary. + + """ return { "region": self.region, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetClientInput": - """Creates a GetClientInput from a dictionary.""" + """Creates a GetClientInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "region": d["region"], } @@ -1116,24 +1047,23 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetClientInput): return False - attributes: list[str] = [ - "region", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['region',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DiscoveryFilter: account_ids: list[str] partition: str - def __init__( self, *, account_ids: list[str], partition: str, ): - """A filter which defines what AWS partition and AWS accounts a KMS Key - may be in for a Keyring to be allowed to attempt to decrypt it. + """A filter which defines what AWS partition and AWS accounts a KMS Key may be in + for a Keyring to be allowed to attempt to decrypt it. :param account_ids: A list of allowed AWS account IDs. :param partition: The AWS partition which is allowed. @@ -1142,7 +1072,9 @@ def __init__( self.partition = partition def as_dict(self) -> Dict[str, Any]: - """Converts the DiscoveryFilter to a dictionary.""" + """Converts the DiscoveryFilter to a dictionary. + + """ return { "account_ids": self.account_ids, "partition": self.partition, @@ -1150,7 +1082,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DiscoveryFilter": - """Creates a DiscoveryFilter from a dictionary.""" + """Creates a DiscoveryFilter from a dictionary. + + """ kwargs: Dict[str, Any] = { "account_ids": d["account_ids"], "partition": d["partition"], @@ -1171,18 +1105,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DiscoveryFilter): return False - attributes: list[str] = [ - "account_ids", - "partition", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['account_ids','partition',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsDiscoveryKeyringInput: kms_client: BaseClient discovery_filter: Optional[DiscoveryFilter] grant_tokens: Optional[list[str]] - def __init__( self, *, @@ -1192,20 +1124,19 @@ def __init__( ): """Inputs for for creating a AWS KMS Discovery Keyring. - :param kms_client: The KMS Client this Keyring will use to call - KMS. - :param discovery_filter: A filter which restricts which KMS Keys - this Keyring may attempt to decrypt with by AWS partition - and account. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param kms_client: The KMS Client this Keyring will use to call KMS. + :param discovery_filter: A filter which restricts which KMS Keys this Keyring + may attempt to decrypt with by AWS partition and account. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.kms_client = kms_client self.discovery_filter = discovery_filter self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsDiscoveryKeyringInput to a dictionary.""" + """Converts the CreateAwsKmsDiscoveryKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "kms_client": self.kms_client, } @@ -1220,15 +1151,15 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsDiscoveryKeyringInput": - """Creates a CreateAwsKmsDiscoveryKeyringInput from a dictionary.""" + """Creates a CreateAwsKmsDiscoveryKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "kms_client": d["kms_client"], } if "discovery_filter" in d: - kwargs["discovery_filter"] = DiscoveryFilter.from_dict( - d["discovery_filter"] - ) + kwargs["discovery_filter"] = DiscoveryFilter.from_dict(d["discovery_filter"]) if "grant_tokens" in d: kwargs["grant_tokens"] = d["grant_tokens"] @@ -1251,46 +1182,35 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsDiscoveryKeyringInput): return False - attributes: list[str] = [ - "kms_client", - "discovery_filter", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['kms_client','discovery_filter','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsDiscoveryMultiKeyringInput: regions: list[str] discovery_filter: Optional[DiscoveryFilter] - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] grant_tokens: Optional[list[str]] - def __init__( self, *, regions: list[str], discovery_filter: Optional[DiscoveryFilter] = None, - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] = None, + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] = None, grant_tokens: Optional[list[str]] = None, ): """Inputs for for creating an AWS KMS Discovery Multi-Keyring. - :param regions: The list of regions this Keyring will creates - KMS clients for. - :param discovery_filter: A filter which restricts which KMS Keys - this Keyring may attempt to decrypt with by AWS partition - and account. - :param client_supplier: The Client Supplier which will be used - to get KMS Clients for use with this Keyring. If not - specified on input, a Default Client Supplier is created - which creates a KMS Client for each region in the 'regions' - input. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param regions: The list of regions this Keyring will creates KMS clients for. + :param discovery_filter: A filter which restricts which KMS Keys this Keyring + may attempt to decrypt with by AWS partition and account. + :param client_supplier: The Client Supplier which will be used to get KMS + Clients for use with this Keyring. If not specified on input, a Default Client + Supplier is created which creates a KMS Client for each region in the 'regions' + input. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.regions = regions self.discovery_filter = discovery_filter @@ -1298,8 +1218,9 @@ def __init__( self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsDiscoveryMultiKeyringInput to a - dictionary.""" + """Converts the CreateAwsKmsDiscoveryMultiKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "regions": self.regions, } @@ -1317,20 +1238,16 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsDiscoveryMultiKeyringInput": - """Creates a CreateAwsKmsDiscoveryMultiKeyringInput from a - dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - ClientSupplier, - ) + """Creates a CreateAwsKmsDiscoveryMultiKeyringInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ClientSupplier kwargs: Dict[str, Any] = { "regions": d["regions"], } if "discovery_filter" in d: - kwargs["discovery_filter"] = DiscoveryFilter.from_dict( - d["discovery_filter"] - ) + kwargs["discovery_filter"] = DiscoveryFilter.from_dict(d["discovery_filter"]) if "client_supplier" in d: kwargs["client_supplier"] = ClientSupplier.from_dict(d["client_supplier"]) @@ -1359,20 +1276,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsDiscoveryMultiKeyringInput): return False - attributes: list[str] = [ - "regions", - "discovery_filter", - "client_supplier", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['regions','discovery_filter','client_supplier','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KmsPrivateKeyToStaticPublicKeyInput: sender_kms_identifier: str sender_public_key: Optional[bytes | bytearray] recipient_public_key: bytes | bytearray - def __init__( self, *, @@ -1382,20 +1295,20 @@ def __init__( ): """Inputs for creating a KmsPrivateKeyToStaticPublicKey Configuration. - :param sender_kms_identifier: AWS KMS Key Identifier belonging - to the sender. - :param recipient_public_key: Recipient Public Key. This MUST be - a raw public ECC key in DER format. - :param sender_public_key: Sender Public Key. This is the raw - public ECC key in DER format that belongs to the - senderKmsIdentifier. + :param sender_kms_identifier: AWS KMS Key Identifier belonging to the sender. + :param recipient_public_key: Recipient Public Key. This MUST be a raw public ECC + key in DER format. + :param sender_public_key: Sender Public Key. This is the raw public ECC key in + DER format that belongs to the senderKmsIdentifier. """ self.sender_kms_identifier = sender_kms_identifier self.recipient_public_key = recipient_public_key self.sender_public_key = sender_public_key def as_dict(self) -> Dict[str, Any]: - """Converts the KmsPrivateKeyToStaticPublicKeyInput to a dictionary.""" + """Converts the KmsPrivateKeyToStaticPublicKeyInput to a dictionary. + + """ d: Dict[str, Any] = { "sender_kms_identifier": self.sender_kms_identifier, "recipient_public_key": self.recipient_public_key, @@ -1408,7 +1321,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KmsPrivateKeyToStaticPublicKeyInput": - """Creates a KmsPrivateKeyToStaticPublicKeyInput from a dictionary.""" + """Creates a KmsPrivateKeyToStaticPublicKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "sender_kms_identifier": d["sender_kms_identifier"], "recipient_public_key": d["recipient_public_key"], @@ -1435,39 +1350,40 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KmsPrivateKeyToStaticPublicKeyInput): return False - attributes: list[str] = [ - "sender_kms_identifier", - "sender_public_key", - "recipient_public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['sender_kms_identifier','sender_public_key','recipient_public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KmsPublicKeyDiscoveryInput: recipient_kms_identifier: str - def __init__( self, *, recipient_kms_identifier: str, ): - """Inputs for creating a KmsPublicKeyDiscovery Configuration. This is a - DECRYPT ONLY configuration. + """Inputs for creating a KmsPublicKeyDiscovery Configuration. This is a DECRYPT + ONLY configuration. - :param recipient_kms_identifier: AWS KMS key identifier - belonging to the recipient. + :param recipient_kms_identifier: AWS KMS key identifier belonging to the + recipient. """ self.recipient_kms_identifier = recipient_kms_identifier def as_dict(self) -> Dict[str, Any]: - """Converts the KmsPublicKeyDiscoveryInput to a dictionary.""" + """Converts the KmsPublicKeyDiscoveryInput to a dictionary. + + """ return { "recipient_kms_identifier": self.recipient_kms_identifier, } @staticmethod def from_dict(d: Dict[str, Any]) -> "KmsPublicKeyDiscoveryInput": - """Creates a KmsPublicKeyDiscoveryInput from a dictionary.""" + """Creates a KmsPublicKeyDiscoveryInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "recipient_kms_identifier": d["recipient_kms_identifier"], } @@ -1484,18 +1400,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KmsPublicKeyDiscoveryInput): return False - attributes: list[str] = [ - "recipient_kms_identifier", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery: - """Inputs for creating a KmsPublicKeyDiscovery Configuration. + attributes: list[str] = ['recipient_kms_identifier',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) - This is a DECRYPT ONLY configuration. +class KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery(): + """Inputs for creating a KmsPublicKeyDiscovery Configuration. This is a DECRYPT + ONLY configuration. """ - def __init__(self, value: KmsPublicKeyDiscoveryInput): self.value = value @@ -1503,30 +1417,23 @@ def as_dict(self) -> Dict[str, Any]: return {"KmsPublicKeyDiscovery": self.value.as_dict()} @staticmethod - def from_dict( - d: Dict[str, Any] - ) -> "KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery": - if len(d) != 1: + def from_dict(d: Dict[str, Any]) -> "KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery": + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery( - KmsPublicKeyDiscoveryInput.from_dict(d["KmsPublicKeyDiscovery"]) - ) + return KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery(KmsPublicKeyDiscoveryInput.from_dict(d["KmsPublicKeyDiscovery"])) def __repr__(self) -> str: - return ( - f"KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery(value=repr(self.value))" - ) + return f"KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery(value=repr(self.value))" def __eq__(self, other: Any) -> bool: if not isinstance(other, KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery): return False return self.value == other.value - -class KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey: - """Inputs for creating a KmsPrivateKeyToStaticPublicKey Configuration.""" - +class KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey(): + """Inputs for creating a KmsPrivateKeyToStaticPublicKey Configuration. + """ def __init__(self, value: KmsPrivateKeyToStaticPublicKeyInput): self.value = value @@ -1534,34 +1441,25 @@ def as_dict(self) -> Dict[str, Any]: return {"KmsPrivateKeyToStaticPublicKey": self.value.as_dict()} @staticmethod - def from_dict( - d: Dict[str, Any] - ) -> "KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey": - if len(d) != 1: + def from_dict(d: Dict[str, Any]) -> "KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey": + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey( - KmsPrivateKeyToStaticPublicKeyInput.from_dict( - d["KmsPrivateKeyToStaticPublicKey"] - ) - ) + return KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey(KmsPrivateKeyToStaticPublicKeyInput.from_dict(d["KmsPrivateKeyToStaticPublicKey"])) def __repr__(self) -> str: return f"KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey(value=repr(self.value))" def __eq__(self, other: Any) -> bool: - if not isinstance( - other, KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey - ): + if not isinstance(other, KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey): return False return self.value == other.value - -class KmsEcdhStaticConfigurationsUnknown: +class KmsEcdhStaticConfigurationsUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -1574,40 +1472,29 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KmsEcdhStaticConfigurationsUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KmsEcdhStaticConfigurationsUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"KmsEcdhStaticConfigurationsUnknown(tag={self.tag})" - # Allowed configurations when using KmsEcdhStaticConfigurations. -KmsEcdhStaticConfigurations = Union[ - KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery, - KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey, - KmsEcdhStaticConfigurationsUnknown, -] - - -def _kms_ecdh_static_configurations_from_dict( - d: Dict[str, Any] -) -> KmsEcdhStaticConfigurations: +KmsEcdhStaticConfigurations = Union[KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery, KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey, KmsEcdhStaticConfigurationsUnknown] +def _kms_ecdh_static_configurations_from_dict(d: Dict[str, Any]) -> KmsEcdhStaticConfigurations: if "KmsPublicKeyDiscovery" in d: return KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery.from_dict(d) if "KmsPrivateKeyToStaticPublicKey" in d: return KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class CreateAwsKmsEcdhKeyringInput: key_agreement_scheme: KmsEcdhStaticConfigurations curve_spec: str kms_client: BaseClient grant_tokens: Optional[list[str]] - def __init__( self, *, @@ -1618,16 +1505,12 @@ def __init__( ): """Inputs for creating an AWS KMS ECDH Keyring. - :param key_agreement_scheme: The Key Agreement Scheme - configuration that is responsible for how the shared secret - is calculated. - :param curve_spec: The named curve that corresponds to the curve - on which the sender's private and recipient's public key - lie. - :param kms_client: The KMS Client this Keyring will use to call - KMS. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param key_agreement_scheme: The Key Agreement Scheme configuration that is + responsible for how the shared secret is calculated. + :param curve_spec: The named curve that corresponds to the curve on which the + sender's private and recipient's public key lie. + :param kms_client: The KMS Client this Keyring will use to call KMS. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.key_agreement_scheme = key_agreement_scheme self.curve_spec = curve_spec @@ -1635,7 +1518,9 @@ def __init__( self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsEcdhKeyringInput to a dictionary.""" + """Converts the CreateAwsKmsEcdhKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "key_agreement_scheme": self.key_agreement_scheme.as_dict(), "curve_spec": self.curve_spec, @@ -1649,11 +1534,11 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsEcdhKeyringInput": - """Creates a CreateAwsKmsEcdhKeyringInput from a dictionary.""" + """Creates a CreateAwsKmsEcdhKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "key_agreement_scheme": _kms_ecdh_static_configurations_from_dict( - d["key_agreement_scheme"] - ), + "key_agreement_scheme": _kms_ecdh_static_configurations_from_dict(d["key_agreement_scheme"]), "curve_spec": d["curve_spec"], "kms_client": d["kms_client"], } @@ -1682,18 +1567,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsEcdhKeyringInput): return False - attributes: list[str] = [ - "key_agreement_scheme", - "curve_spec", - "kms_client", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_agreement_scheme','curve_spec','kms_client','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DefaultCache: entry_capacity: int - def __init__( self, *, @@ -1709,7 +1590,9 @@ def __init__( self.entry_capacity = entry_capacity def as_dict(self) -> Dict[str, Any]: - """Converts the DefaultCache to a dictionary.""" + """Converts the DefaultCache to a dictionary. + + """ d: Dict[str, Any] = {} if self.entry_capacity is not None: @@ -1719,7 +1602,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DefaultCache": - """Creates a DefaultCache from a dictionary.""" + """Creates a DefaultCache from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "entry_capacity" in d: @@ -1737,42 +1622,40 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DefaultCache): return False - attributes: list[str] = [ - "entry_capacity", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['entry_capacity',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class MultiThreadedCache: entry_capacity: int entry_pruning_tail_size: int - def __init__( self, *, entry_capacity: int = 0, entry_pruning_tail_size: int = 0, ): - """A cache that is safe for use in a multi threaded environment, but no - extra functionality. + """A cache that is safe for use in a multi threaded environment, but no extra + functionality. :param entry_capacity: Maximum number of entries cached. - :param entry_pruning_tail_size: Number of entries to prune at a - time. + :param entry_pruning_tail_size: Number of entries to prune at a time. """ if (entry_capacity is not None) and (entry_capacity < 1): raise ValueError("entry_capacity must be greater than or equal to 1") self.entry_capacity = entry_capacity if (entry_pruning_tail_size is not None) and (entry_pruning_tail_size < 1): - raise ValueError( - "entry_pruning_tail_size must be greater than or equal to 1" - ) + raise ValueError("entry_pruning_tail_size must be greater than or equal to 1") self.entry_pruning_tail_size = entry_pruning_tail_size def as_dict(self) -> Dict[str, Any]: - """Converts the MultiThreadedCache to a dictionary.""" + """Converts the MultiThreadedCache to a dictionary. + + """ d: Dict[str, Any] = {} if self.entry_capacity is not None: @@ -1785,7 +1668,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "MultiThreadedCache": - """Creates a MultiThreadedCache from a dictionary.""" + """Creates a MultiThreadedCache from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "entry_capacity" in d: @@ -1809,23 +1694,26 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, MultiThreadedCache): return False - attributes: list[str] = [ - "entry_capacity", - "entry_pruning_tail_size", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['entry_capacity','entry_pruning_tail_size',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class NoCache: - """Nothing should ever be cached.""" - + """Nothing should ever be cached. + """ def as_dict(self) -> Dict[str, Any]: - """Converts the NoCache to a dictionary.""" + """Converts the NoCache to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "NoCache": - """Creates a NoCache from a dictionary.""" + """Creates a NoCache from a dictionary. + + """ return NoCache() def __repr__(self) -> str: @@ -1836,11 +1724,9 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, NoCache) - class SingleThreadedCache: entry_capacity: int entry_pruning_tail_size: int - def __init__( self, *, @@ -1850,22 +1736,21 @@ def __init__( """A cache that is NOT safe for use in a multi threaded environment. :param entry_capacity: Maximum number of entries cached. - :param entry_pruning_tail_size: Number of entries to prune at a - time. + :param entry_pruning_tail_size: Number of entries to prune at a time. """ if (entry_capacity is not None) and (entry_capacity < 1): raise ValueError("entry_capacity must be greater than or equal to 1") self.entry_capacity = entry_capacity if (entry_pruning_tail_size is not None) and (entry_pruning_tail_size < 1): - raise ValueError( - "entry_pruning_tail_size must be greater than or equal to 1" - ) + raise ValueError("entry_pruning_tail_size must be greater than or equal to 1") self.entry_pruning_tail_size = entry_pruning_tail_size def as_dict(self) -> Dict[str, Any]: - """Converts the SingleThreadedCache to a dictionary.""" + """Converts the SingleThreadedCache to a dictionary. + + """ d: Dict[str, Any] = {} if self.entry_capacity is not None: @@ -1878,7 +1763,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "SingleThreadedCache": - """Creates a SingleThreadedCache from a dictionary.""" + """Creates a SingleThreadedCache from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "entry_capacity" in d: @@ -1902,12 +1789,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, SingleThreadedCache): return False - attributes: list[str] = [ - "entry_capacity", - "entry_pruning_tail_size", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['entry_capacity','entry_pruning_tail_size',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class StormTrackingCache: entry_capacity: int @@ -1917,7 +1803,6 @@ class StormTrackingCache: fan_out: int in_flight_ttl: int sleep_milli: int - def __init__( self, *, @@ -1929,32 +1814,30 @@ def __init__( in_flight_ttl: int = 0, sleep_milli: int = 0, ): - """A cache that is safe for use in a multi threaded environment, and - tries to prevent redundant or overly parallel backend calls. + """A cache that is safe for use in a multi threaded environment, + and tries to + prevent redundant or overly parallel backend calls. :param entry_capacity: Maximum number of entries cached. - :param entry_pruning_tail_size: Number of entries to prune at a - time. - :param grace_period: How many seconds before expiration should - an attempt be made to refresh the materials. If zero, use a - simple cache with no storm tracking. - :param grace_interval: How many seconds between attempts to - refresh the materials. - :param fan_out: How many simultaneous attempts to refresh the - materials. - :param in_flight_ttl: How many seconds until an attempt to - refresh the materials should be forgotten. - :param sleep_milli: How many milliseconds should a thread sleep - if fanOut is exceeded. + :param entry_pruning_tail_size: Number of entries to prune at a time. + :param grace_period: How many seconds before expiration should an attempt be + made to refresh the materials. + If zero, use a simple cache with no storm + tracking. + :param grace_interval: How many seconds between attempts to refresh the + materials. + :param fan_out: How many simultaneous attempts to refresh the materials. + :param in_flight_ttl: How many seconds until an attempt to refresh the materials + should be forgotten. + :param sleep_milli: How many milliseconds should a thread sleep if fanOut is + exceeded. """ if (entry_capacity is not None) and (entry_capacity < 1): raise ValueError("entry_capacity must be greater than or equal to 1") self.entry_capacity = entry_capacity if (entry_pruning_tail_size is not None) and (entry_pruning_tail_size < 1): - raise ValueError( - "entry_pruning_tail_size must be greater than or equal to 1" - ) + raise ValueError("entry_pruning_tail_size must be greater than or equal to 1") self.entry_pruning_tail_size = entry_pruning_tail_size if (grace_period is not None) and (grace_period < 1): @@ -1979,7 +1862,9 @@ def __init__( self.sleep_milli = sleep_milli def as_dict(self) -> Dict[str, Any]: - """Converts the StormTrackingCache to a dictionary.""" + """Converts the StormTrackingCache to a dictionary. + + """ d: Dict[str, Any] = {} if self.entry_capacity is not None: @@ -2007,7 +1892,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "StormTrackingCache": - """Creates a StormTrackingCache from a dictionary.""" + """Creates a StormTrackingCache from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "entry_capacity" in d: @@ -2061,24 +1948,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, StormTrackingCache): return False - attributes: list[str] = [ - "entry_capacity", - "entry_pruning_tail_size", - "grace_period", - "grace_interval", - "fan_out", - "in_flight_ttl", - "sleep_milli", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class CacheTypeDefault: - """The best choice for most situations. - - Probably a StormTrackingCache. - """ + attributes: list[str] = ['entry_capacity','entry_pruning_tail_size','grace_period','grace_interval','fan_out','in_flight_ttl','sleep_milli',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class CacheTypeDefault(): + """The best choice for most situations. Probably a StormTrackingCache. + """ def __init__(self, value: DefaultCache): self.value = value @@ -2087,7 +1965,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CacheTypeDefault": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CacheTypeDefault(DefaultCache.from_dict(d["Default"])) @@ -2100,10 +1978,9 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CacheTypeNo: - """Nothing should ever be cached.""" - +class CacheTypeNo(): + """Nothing should ever be cached. + """ def __init__(self, value: NoCache): self.value = value @@ -2112,7 +1989,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CacheTypeNo": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CacheTypeNo(NoCache.from_dict(d["No"])) @@ -2125,10 +2002,9 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CacheTypeSingleThreaded: - """A cache that is NOT safe for use in a multi threaded environment.""" - +class CacheTypeSingleThreaded(): + """A cache that is NOT safe for use in a multi threaded environment. + """ def __init__(self, value: SingleThreadedCache): self.value = value @@ -2137,12 +2013,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CacheTypeSingleThreaded": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return CacheTypeSingleThreaded( - SingleThreadedCache.from_dict(d["SingleThreaded"]) - ) + return CacheTypeSingleThreaded(SingleThreadedCache.from_dict(d["SingleThreaded"])) def __repr__(self) -> str: return f"CacheTypeSingleThreaded(value=repr(self.value))" @@ -2152,11 +2026,10 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CacheTypeMultiThreaded: - """A cache that is safe for use in a multi threaded environment, but no - extra functionality.""" - +class CacheTypeMultiThreaded(): + """A cache that is safe for use in a multi threaded environment, but no extra + functionality. + """ def __init__(self, value: MultiThreadedCache): self.value = value @@ -2165,7 +2038,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CacheTypeMultiThreaded": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CacheTypeMultiThreaded(MultiThreadedCache.from_dict(d["MultiThreaded"])) @@ -2178,11 +2051,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CacheTypeStormTracking: - """A cache that is safe for use in a multi threaded environment, and tries - to prevent redundant or overly parallel backend calls.""" - +class CacheTypeStormTracking(): + """A cache that is safe for use in a multi threaded environment, + and tries to + prevent redundant or overly parallel backend calls. + """ def __init__(self, value: StormTrackingCache): self.value = value @@ -2191,7 +2064,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CacheTypeStormTracking": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CacheTypeStormTracking(StormTrackingCache.from_dict(d["StormTracking"])) @@ -2204,19 +2077,12 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CacheTypeShared: - """Shared cache across multiple Hierarchical Keyrings. - - For this cache type, the user should provide an already constructed - CryptographicMaterialsCache to the Hierarchical Keyring at - initialization. +class CacheTypeShared(): + """Shared cache across multiple Hierarchical Keyrings. For this cache type, the + user should provide an already constructed CryptographicMaterialsCache to the + Hierarchical Keyring at initialization. """ - - def __init__( - self, - value: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsCache", - ): + def __init__(self, value: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsCache'): self.value = value def as_dict(self) -> Dict[str, Any]: @@ -2224,11 +2090,8 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CacheTypeShared": - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - CryptographicMaterialsCache, - ) - - if len(d) != 1: + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import CryptographicMaterialsCache + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CacheTypeShared(CryptographicMaterialsCache.from_dict(d["Shared"])) @@ -2241,12 +2104,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CacheTypeUnknown: +class CacheTypeUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -2259,25 +2121,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CacheTypeUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CacheTypeUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"CacheTypeUnknown(tag={self.tag})" - -CacheType = Union[ - CacheTypeDefault, - CacheTypeNo, - CacheTypeSingleThreaded, - CacheTypeMultiThreaded, - CacheTypeStormTracking, - CacheTypeShared, - CacheTypeUnknown, -] - - +CacheType = Union[CacheTypeDefault, CacheTypeNo, CacheTypeSingleThreaded, CacheTypeMultiThreaded, CacheTypeStormTracking, CacheTypeShared, CacheTypeUnknown] def _cache_type_from_dict(d: Dict[str, Any]) -> CacheType: if "Default" in d: return CacheTypeDefault.from_dict(d) @@ -2297,62 +2148,51 @@ def _cache_type_from_dict(d: Dict[str, Any]) -> CacheType: if "Shared" in d: return CacheTypeShared.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class CreateAwsKmsHierarchicalKeyringInput: branch_key_id: Optional[str] - branch_key_id_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.BranchKeyIdSupplier" - ] - key_store: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client.KeyStore" + branch_key_id_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.BranchKeyIdSupplier'] + key_store: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client.KeyStore' ttl_seconds: int cache: Optional[CacheType] partition_id: Optional[str] - def __init__( self, *, - key_store: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client.KeyStore", + key_store: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client.KeyStore', branch_key_id: Optional[str] = None, - branch_key_id_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.BranchKeyIdSupplier" - ] = None, + branch_key_id_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.BranchKeyIdSupplier'] = None, ttl_seconds: int = 0, cache: Optional[CacheType] = None, partition_id: Optional[str] = None, ): """Inputs for creating a Hierarchical Keyring. - :param key_store: The Key Store which contains the Branch Key(s) - responsible for wrapping and unwrapping data keys. - :param branch_key_id: The identifier for the single Branch Key - responsible for wrapping and unwrapping the data key. Either - a Branch Key ID or Branch Key Supplier must be specified. - :param branch_key_id_supplier: A Branch Key Supplier which - determines what Branch Key to use to wrap and unwrap the - data key. Either a Branch Key ID or Branch Key Supplier must - be specified. - :param ttl_seconds: How many seconds the Branch Key material is - allowed to be reused within the local cache before it is re- - retrieved from Amazon DynamoDB and re-authenticated with AWS - KMS. - :param cache: Sets the type of cache for this Hierarchical - Keyring. By providing an already initialized 'Shared' cache, - users can determine the scope of the cache. That is, if the - cache is shared across other Cryptographic Material - Providers, for instance other Hierarchical Keyrings or - Caching Cryptographic Materials Managers (Caching CMMs). If - any other type of cache in the CacheType union is provided, - the Hierarchical Keyring will initialize a cache of that - type, to be used with only this Hierarchical Keyring. If not - set, a DefaultCache is initialized to be used with only this - Hierarchical Keyring with entryCapacity = 1000. - :param partition_id: Partition ID to distinguish Cryptographic - Material Providers (i.e: Keyrings) writing to a cache. If - the Partition ID is the same for two Hierarchical Keyrings - (or another Material Provider), they can share the same - cache entries in the cache. + :param key_store: The Key Store which contains the Branch Key(s) responsible for + wrapping and unwrapping data keys. + :param branch_key_id: The identifier for the single Branch Key responsible for + wrapping and unwrapping the data key. Either a Branch Key ID or Branch Key + Supplier must be specified. + :param branch_key_id_supplier: A Branch Key Supplier which determines what + Branch Key to use to wrap and unwrap the data key. Either a Branch Key ID or + Branch Key Supplier must be specified. + :param ttl_seconds: How many seconds the Branch Key material is allowed to be + reused within the local cache before it is re-retrieved from Amazon DynamoDB and + re-authenticated with AWS KMS. + :param cache: Sets the type of cache for this Hierarchical Keyring. By providing + an already initialized 'Shared' cache, users can determine the scope of the + cache. That is, if the cache is shared across other Cryptographic Material + Providers, for instance other Hierarchical Keyrings or Caching Cryptographic + Materials Managers (Caching CMMs). If any other type of cache in the CacheType + union is provided, the Hierarchical Keyring will initialize a cache of that + type, to be used with only this Hierarchical Keyring. If not set, a DefaultCache + is initialized to be used with only this Hierarchical Keyring with entryCapacity + = 1000. + :param partition_id: Partition ID to distinguish Cryptographic Material + Providers (i.e: Keyrings) writing to a cache. If the Partition ID is the same + for two Hierarchical Keyrings (or another Material Provider), they can share the + same cache entries in the cache. """ self.key_store = key_store self.branch_key_id = branch_key_id @@ -2365,8 +2205,9 @@ def __init__( self.partition_id = partition_id def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsHierarchicalKeyringInput to a - dictionary.""" + """Converts the CreateAwsKmsHierarchicalKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "key_store": self.key_store.as_dict(), } @@ -2390,14 +2231,11 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsHierarchicalKeyringInput": - """Creates a CreateAwsKmsHierarchicalKeyringInput from a dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - BranchKeyIdSupplier, - ) - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client import ( - KeyStore, - ) + """Creates a CreateAwsKmsHierarchicalKeyringInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import BranchKeyIdSupplier + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.client import KeyStore kwargs: Dict[str, Any] = { "key_store": KeyStore.from_dict(d["key_store"]), } @@ -2406,15 +2244,13 @@ def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsHierarchicalKeyringInput": kwargs["branch_key_id"] = d["branch_key_id"] if "branch_key_id_supplier" in d: - kwargs["branch_key_id_supplier"] = BranchKeyIdSupplier.from_dict( - d["branch_key_id_supplier"] - ) + kwargs["branch_key_id_supplier"] = BranchKeyIdSupplier.from_dict(d["branch_key_id_supplier"]) if "ttl_seconds" in d: kwargs["ttl_seconds"] = d["ttl_seconds"] if "cache" in d: - kwargs["cache"] = (_cache_type_from_dict(d["cache"]),) + kwargs["cache"] = _cache_type_from_dict(d["cache"]), if "partition_id" in d: kwargs["partition_id"] = d["partition_id"] @@ -2446,22 +2282,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsHierarchicalKeyringInput): return False - attributes: list[str] = [ - "branch_key_id", - "branch_key_id_supplier", - "key_store", - "ttl_seconds", - "cache", - "partition_id", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['branch_key_id','branch_key_id_supplier','key_store','ttl_seconds','cache','partition_id',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsKeyringInput: kms_key_id: str kms_client: BaseClient grant_tokens: Optional[list[str]] - def __init__( self, *, @@ -2471,20 +2301,20 @@ def __init__( ): """Inputs for for creating a AWS KMS Keyring. - :param kms_key_id: The identifier for the symmetric AWS KMS Key - responsible for wrapping and unwrapping data keys. This - should not be a AWS KMS Multi-Region Key. - :param kms_client: The KMS Client this Keyring will use to call - KMS. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param kms_key_id: The identifier for the symmetric AWS KMS Key responsible for + wrapping and unwrapping data keys. This should not be a AWS KMS Multi-Region + Key. + :param kms_client: The KMS Client this Keyring will use to call KMS. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.kms_key_id = kms_key_id self.kms_client = kms_client self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsKeyringInput to a dictionary.""" + """Converts the CreateAwsKmsKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "kms_key_id": self.kms_key_id, "kms_client": self.kms_client, @@ -2497,7 +2327,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsKeyringInput": - """Creates a CreateAwsKmsKeyringInput from a dictionary.""" + """Creates a CreateAwsKmsKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "kms_key_id": d["kms_key_id"], "kms_client": d["kms_client"], @@ -2524,20 +2356,17 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsKeyringInput): return False - attributes: list[str] = [ - "kms_key_id", - "kms_client", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['kms_key_id','kms_client','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsMrkDiscoveryKeyringInput: kms_client: BaseClient discovery_filter: Optional[DiscoveryFilter] grant_tokens: Optional[list[str]] region: str - def __init__( self, *, @@ -2548,14 +2377,11 @@ def __init__( ): """Inputs for for creating a AWS KMS MRK Discovery Keyring. - :param kms_client: The KMS Client this Keyring will use to call - KMS. + :param kms_client: The KMS Client this Keyring will use to call KMS. :param region: The region the input 'kmsClient' is in. - :param discovery_filter: A filter which restricts which KMS Keys - this Keyring may attempt to decrypt with by AWS partition - and account. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param discovery_filter: A filter which restricts which KMS Keys this Keyring + may attempt to decrypt with by AWS partition and account. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.kms_client = kms_client self.region = region @@ -2563,8 +2389,9 @@ def __init__( self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsMrkDiscoveryKeyringInput to a - dictionary.""" + """Converts the CreateAwsKmsMrkDiscoveryKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "kms_client": self.kms_client, "region": self.region, @@ -2580,16 +2407,16 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsMrkDiscoveryKeyringInput": - """Creates a CreateAwsKmsMrkDiscoveryKeyringInput from a dictionary.""" + """Creates a CreateAwsKmsMrkDiscoveryKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "kms_client": d["kms_client"], "region": d["region"], } if "discovery_filter" in d: - kwargs["discovery_filter"] = DiscoveryFilter.from_dict( - d["discovery_filter"] - ) + kwargs["discovery_filter"] = DiscoveryFilter.from_dict(d["discovery_filter"]) if "grant_tokens" in d: kwargs["grant_tokens"] = d["grant_tokens"] @@ -2615,47 +2442,35 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsMrkDiscoveryKeyringInput): return False - attributes: list[str] = [ - "kms_client", - "discovery_filter", - "grant_tokens", - "region", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['kms_client','discovery_filter','grant_tokens','region',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsMrkDiscoveryMultiKeyringInput: regions: list[str] discovery_filter: Optional[DiscoveryFilter] - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] grant_tokens: Optional[list[str]] - def __init__( self, *, regions: list[str], discovery_filter: Optional[DiscoveryFilter] = None, - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] = None, + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] = None, grant_tokens: Optional[list[str]] = None, ): """Inputs for for creating a AWS KMS MRK Discovery Multi-Keyring. - :param regions: The list of regions this Keyring will creates - KMS clients for. - :param discovery_filter: A filter which restricts which KMS Keys - this Keyring may attempt to decrypt with by AWS partition - and account. - :param client_supplier: The Client Supplier which will be used - to get KMS Clients for use with this Keyring. If not - specified on input, a Default Client Supplier is created - which creates a KMS Client for each region in the 'regions' - input. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param regions: The list of regions this Keyring will creates KMS clients for. + :param discovery_filter: A filter which restricts which KMS Keys this Keyring + may attempt to decrypt with by AWS partition and account. + :param client_supplier: The Client Supplier which will be used to get KMS + Clients for use with this Keyring. If not specified on input, a Default Client + Supplier is created which creates a KMS Client for each region in the 'regions' + input. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.regions = regions self.discovery_filter = discovery_filter @@ -2663,8 +2478,9 @@ def __init__( self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsMrkDiscoveryMultiKeyringInput to a - dictionary.""" + """Converts the CreateAwsKmsMrkDiscoveryMultiKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "regions": self.regions, } @@ -2682,20 +2498,16 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsMrkDiscoveryMultiKeyringInput": - """Creates a CreateAwsKmsMrkDiscoveryMultiKeyringInput from a - dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - ClientSupplier, - ) + """Creates a CreateAwsKmsMrkDiscoveryMultiKeyringInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ClientSupplier kwargs: Dict[str, Any] = { "regions": d["regions"], } if "discovery_filter" in d: - kwargs["discovery_filter"] = DiscoveryFilter.from_dict( - d["discovery_filter"] - ) + kwargs["discovery_filter"] = DiscoveryFilter.from_dict(d["discovery_filter"]) if "client_supplier" in d: kwargs["client_supplier"] = ClientSupplier.from_dict(d["client_supplier"]) @@ -2724,20 +2536,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsMrkDiscoveryMultiKeyringInput): return False - attributes: list[str] = [ - "regions", - "discovery_filter", - "client_supplier", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['regions','discovery_filter','client_supplier','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsMrkKeyringInput: kms_key_id: str kms_client: BaseClient grant_tokens: Optional[list[str]] - def __init__( self, *, @@ -2747,20 +2555,19 @@ def __init__( ): """Inputs for for creating an AWS KMS MRK Keyring. - :param kms_key_id: The identifier for the symmetric AWS KMS Key - or AWS KMS Multi-Region Key responsible for wrapping and - unwrapping data keys. - :param kms_client: The KMS Client this Keyring will use to call - KMS. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param kms_key_id: The identifier for the symmetric AWS KMS Key or AWS KMS + Multi-Region Key responsible for wrapping and unwrapping data keys. + :param kms_client: The KMS Client this Keyring will use to call KMS. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.kms_key_id = kms_key_id self.kms_client = kms_client self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsMrkKeyringInput to a dictionary.""" + """Converts the CreateAwsKmsMrkKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "kms_key_id": self.kms_key_id, "kms_client": self.kms_client, @@ -2773,7 +2580,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsMrkKeyringInput": - """Creates a CreateAwsKmsMrkKeyringInput from a dictionary.""" + """Creates a CreateAwsKmsMrkKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "kms_key_id": d["kms_key_id"], "kms_client": d["kms_client"], @@ -2800,49 +2609,39 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsMrkKeyringInput): return False - attributes: list[str] = [ - "kms_key_id", - "kms_client", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['kms_key_id','kms_client','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsMrkMultiKeyringInput: generator: Optional[str] kms_key_ids: Optional[list[str]] - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] grant_tokens: Optional[list[str]] - def __init__( self, *, generator: Optional[str] = None, kms_key_ids: Optional[list[str]] = None, - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] = None, + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] = None, grant_tokens: Optional[list[str]] = None, ): """Inputs for for creating a AWS KMS MRK Multi-Keyring. - :param generator: A symmetric AWS KMS Key or AWS KMS Multi- - Region Key responsible for wrapping and unwrapping data - keys. KMS.GenerateDataKey may be called with this key if the - data key has not already been generated by another Keyring. - :param kms_key_ids: A list of identifiers for the symmetric AWS - KMS Keys and/or AWS KMS Multi-Region Keys (other than the - generator) responsible for wrapping and unwrapping data - keys. - :param client_supplier: The Client Supplier which will be used - to get KMS Clients for use with this Keyring. The Client - Supplier will create a client for each region specified in - the generator and kmsKeyIds ARNs. If not specified on input, - the Default Client Supplier is used. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param generator: A symmetric AWS KMS Key or AWS KMS Multi-Region Key + responsible for wrapping and unwrapping data keys. KMS.GenerateDataKey may be + called with this key if the data key has not already been generated by another + Keyring. + :param kms_key_ids: A list of identifiers for the symmetric AWS KMS Keys and/or + AWS KMS Multi-Region Keys (other than the generator) responsible for wrapping + and unwrapping data keys. + :param client_supplier: The Client Supplier which will be used to get KMS + Clients for use with this Keyring. The Client Supplier will create a client for + each region specified in the generator and kmsKeyIds ARNs. If not specified on + input, the Default Client Supplier is used. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.generator = generator self.kms_key_ids = kms_key_ids @@ -2850,7 +2649,9 @@ def __init__( self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsMrkMultiKeyringInput to a dictionary.""" + """Converts the CreateAwsKmsMrkMultiKeyringInput to a dictionary. + + """ d: Dict[str, Any] = {} if self.generator is not None: @@ -2869,11 +2670,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsMrkMultiKeyringInput": - """Creates a CreateAwsKmsMrkMultiKeyringInput from a dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - ClientSupplier, - ) + """Creates a CreateAwsKmsMrkMultiKeyringInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ClientSupplier kwargs: Dict[str, Any] = {} if "generator" in d: @@ -2909,51 +2709,39 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsMrkMultiKeyringInput): return False - attributes: list[str] = [ - "generator", - "kms_key_ids", - "client_supplier", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['generator','kms_key_ids','client_supplier','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsMultiKeyringInput: generator: Optional[str] kms_key_ids: Optional[list[str]] - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] grant_tokens: Optional[list[str]] - def __init__( self, *, generator: Optional[str] = None, kms_key_ids: Optional[list[str]] = None, - client_supplier: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier" - ] = None, + client_supplier: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.ClientSupplier'] = None, grant_tokens: Optional[list[str]] = None, ): """Inputs for for creating a AWS KMS Multi-Keyring. - :param generator: A identifier for a symmetric AWS KMS Key - responsible for wrapping and unwrapping data keys. - KMS.GenerateDataKey may be called with this key if the data - key has not already been generated by another Keyring. This - should not be a AWS KMS Multi-Region Key. - :param kms_key_ids: A list of identifiers for the symmetric AWS - KMS Keys (other than the generator) responsible for wrapping - and unwrapping data keys. This list should not contain AWS - KMS Multi-Region Keys. - :param client_supplier: The Client Supplier which will be used - to get KMS Clients for use with this Keyring. The Client - Supplier will create a client for each region specified in - the generator and kmsKeyIds ARNs. If not specified on input, - the Default Client Supplier is used. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param generator: A identifier for a symmetric AWS KMS Key responsible for + wrapping and unwrapping data keys. KMS.GenerateDataKey may be called with this + key if the data key has not already been generated by another Keyring. This + should not be a AWS KMS Multi-Region Key. + :param kms_key_ids: A list of identifiers for the symmetric AWS KMS Keys (other + than the generator) responsible for wrapping and unwrapping data keys. This list + should not contain AWS KMS Multi-Region Keys. + :param client_supplier: The Client Supplier which will be used to get KMS + Clients for use with this Keyring. The Client Supplier will create a client for + each region specified in the generator and kmsKeyIds ARNs. If not specified on + input, the Default Client Supplier is used. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.generator = generator self.kms_key_ids = kms_key_ids @@ -2961,7 +2749,9 @@ def __init__( self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsMultiKeyringInput to a dictionary.""" + """Converts the CreateAwsKmsMultiKeyringInput to a dictionary. + + """ d: Dict[str, Any] = {} if self.generator is not None: @@ -2980,11 +2770,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsMultiKeyringInput": - """Creates a CreateAwsKmsMultiKeyringInput from a dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - ClientSupplier, - ) + """Creates a CreateAwsKmsMultiKeyringInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ClientSupplier kwargs: Dict[str, Any] = {} if "generator" in d: @@ -3020,14 +2809,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsMultiKeyringInput): return False - attributes: list[str] = [ - "generator", - "kms_key_ids", - "client_supplier", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['generator','kms_key_ids','client_supplier','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateAwsKmsRsaKeyringInput: public_key: Optional[bytes | bytearray] @@ -3035,7 +2821,6 @@ class CreateAwsKmsRsaKeyringInput: encryption_algorithm: str kms_client: Optional[BaseClient] grant_tokens: Optional[list[str]] - def __init__( self, *, @@ -3047,19 +2832,16 @@ def __init__( ): """Inputs for creating a AWS KMS RSA Keyring. - :param kms_key_id: The ARN for the asymmetric AWS KMS Key for - RSA responsible for wrapping and unwrapping data keys. - :param encryption_algorithm: The RSA algorithm used to wrap and - unwrap data keys. - :param public_key: The public RSA Key responsible for wrapping - data keys, as a UTF8 encoded, PEM encoded X.509 - SubjectPublicKeyInfo structure. This should be the public - key as exported from KMS. If not specified, this Keyring - cannot be used on encrypt. - :param kms_client: The KMS Client this Keyring will use to call - KMS. - :param grant_tokens: A list of grant tokens to be used when - calling KMS. + :param kms_key_id: The ARN for the asymmetric AWS KMS Key for RSA responsible + for wrapping and unwrapping data keys. + :param encryption_algorithm: The RSA algorithm used to wrap and unwrap data + keys. + :param public_key: The public RSA Key responsible for wrapping data keys, as a + UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. This should be + the public key as exported from KMS. If not specified, this Keyring cannot be + used on encrypt. + :param kms_client: The KMS Client this Keyring will use to call KMS. + :param grant_tokens: A list of grant tokens to be used when calling KMS. """ self.kms_key_id = kms_key_id self.encryption_algorithm = encryption_algorithm @@ -3068,7 +2850,9 @@ def __init__( self.grant_tokens = grant_tokens def as_dict(self) -> Dict[str, Any]: - """Converts the CreateAwsKmsRsaKeyringInput to a dictionary.""" + """Converts the CreateAwsKmsRsaKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "kms_key_id": self.kms_key_id, "encryption_algorithm": self.encryption_algorithm, @@ -3087,7 +2871,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateAwsKmsRsaKeyringInput": - """Creates a CreateAwsKmsRsaKeyringInput from a dictionary.""" + """Creates a CreateAwsKmsRsaKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "kms_key_id": d["kms_key_id"], "encryption_algorithm": d["encryption_algorithm"], @@ -3126,19 +2912,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateAwsKmsRsaKeyringInput): return False - attributes: list[str] = [ - "public_key", - "kms_key_id", - "encryption_algorithm", - "kms_client", - "grant_tokens", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['public_key','kms_key_id','encryption_algorithm','kms_client','grant_tokens',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateCryptographicMaterialsCacheInput: cache: CacheType - def __init__( self, *, @@ -3150,16 +2931,18 @@ def __init__( self.cache = cache def as_dict(self) -> Dict[str, Any]: - """Converts the CreateCryptographicMaterialsCacheInput to a - dictionary.""" + """Converts the CreateCryptographicMaterialsCacheInput to a dictionary. + + """ return { "cache": self.cache.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateCryptographicMaterialsCacheInput": - """Creates a CreateCryptographicMaterialsCacheInput from a - dictionary.""" + """Creates a CreateCryptographicMaterialsCacheInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "cache": _cache_type_from_dict(d["cache"]), } @@ -3176,20 +2959,24 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateCryptographicMaterialsCacheInput): return False - attributes: list[str] = [ - "cache", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['cache',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateDefaultClientSupplierInput: def as_dict(self) -> Dict[str, Any]: - """Converts the CreateDefaultClientSupplierInput to a dictionary.""" + """Converts the CreateDefaultClientSupplierInput to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateDefaultClientSupplierInput": - """Creates a CreateDefaultClientSupplierInput from a dictionary.""" + """Creates a CreateDefaultClientSupplierInput from a dictionary. + + """ return CreateDefaultClientSupplierInput() def __repr__(self) -> str: @@ -3200,39 +2987,34 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, CreateDefaultClientSupplierInput) - class CreateDefaultCryptographicMaterialsManagerInput: - keyring: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring" - + keyring: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring' def __init__( self, *, - keyring: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring", + keyring: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring', ): """Inputs for creating a Default Cryptographic Materials Manager. - :param keyring: The Keyring that the created Default - Cryprographic Materials Manager will use to wrap data keys. + :param keyring: The Keyring that the created Default Cryprographic Materials + Manager will use to wrap data keys. """ self.keyring = keyring def as_dict(self) -> Dict[str, Any]: - """Converts the CreateDefaultCryptographicMaterialsManagerInput to a - dictionary.""" + """Converts the CreateDefaultCryptographicMaterialsManagerInput to a dictionary. + + """ return { "keyring": self.keyring.as_dict(), } @staticmethod - def from_dict( - d: Dict[str, Any] - ) -> "CreateDefaultCryptographicMaterialsManagerInput": - """Creates a CreateDefaultCryptographicMaterialsManagerInput from a - dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - Keyring, - ) + def from_dict(d: Dict[str, Any]) -> "CreateDefaultCryptographicMaterialsManagerInput": + """Creates a CreateDefaultCryptographicMaterialsManagerInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import Keyring kwargs: Dict[str, Any] = { "keyring": Keyring.from_dict(d["keyring"]), } @@ -3249,45 +3031,36 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateDefaultCryptographicMaterialsManagerInput): return False - attributes: list[str] = [ - "keyring", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['keyring',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateMultiKeyringInput: - generator: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring" - ] - child_keyrings: list[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring" - ] - + generator: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring'] + child_keyrings: list['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring'] def __init__( self, *, - child_keyrings: list[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring" - ], - generator: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring" - ] = None, + child_keyrings: list['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring'], + generator: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring'] = None, ): """Inputs for creating a Multi-Keyring. - :param child_keyrings: A list of keyrings (other than the - generator) responsible for wrapping and unwrapping the data - key. - :param generator: A keyring responsible for wrapping and - unwrapping the data key. This is the first keyring that will - be used to wrap the data key, and may be responsible for - additionally generating the data key. + :param child_keyrings: A list of keyrings (other than the generator) responsible + for wrapping and unwrapping the data key. + :param generator: A keyring responsible for wrapping and unwrapping the data + key. This is the first keyring that will be used to wrap the data key, and may + be responsible for additionally generating the data key. """ self.child_keyrings = child_keyrings self.generator = generator def as_dict(self) -> Dict[str, Any]: - """Converts the CreateMultiKeyringInput to a dictionary.""" + """Converts the CreateMultiKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "child_keyrings": self.child_keyrings, } @@ -3299,11 +3072,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateMultiKeyringInput": - """Creates a CreateMultiKeyringInput from a dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - Keyring, - ) + """Creates a CreateMultiKeyringInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import Keyring kwargs: Dict[str, Any] = { "child_keyrings": d["child_keyrings"], } @@ -3326,19 +3098,17 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateMultiKeyringInput): return False - attributes: list[str] = [ - "generator", - "child_keyrings", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['generator','child_keyrings',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateRawAesKeyringInput: key_namespace: str key_name: str wrapping_key: bytes | bytearray wrapping_alg: str - def __init__( self, *, @@ -3349,13 +3119,11 @@ def __init__( ): """Inputs for creating a Raw AES Keyring. - :param key_namespace: A namespace associated with this wrapping - key. + :param key_namespace: A namespace associated with this wrapping key. :param key_name: A name associated with this wrapping key. - :param wrapping_key: The AES key used with AES_GCM encryption - and decryption. - :param wrapping_alg: The AES_GCM algorithm this Keyring uses to - wrap and unwrap data keys. + :param wrapping_key: The AES key used with AES_GCM encryption and decryption. + :param wrapping_alg: The AES_GCM algorithm this Keyring uses to wrap and unwrap + data keys. """ self.key_namespace = key_namespace self.key_name = key_name @@ -3363,7 +3131,9 @@ def __init__( self.wrapping_alg = wrapping_alg def as_dict(self) -> Dict[str, Any]: - """Converts the CreateRawAesKeyringInput to a dictionary.""" + """Converts the CreateRawAesKeyringInput to a dictionary. + + """ return { "key_namespace": self.key_namespace, "key_name": self.key_name, @@ -3373,7 +3143,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateRawAesKeyringInput": - """Creates a CreateRawAesKeyringInput from a dictionary.""" + """Creates a CreateRawAesKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_namespace": d["key_namespace"], "key_name": d["key_name"], @@ -3402,42 +3174,38 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateRawAesKeyringInput): return False - attributes: list[str] = [ - "key_namespace", - "key_name", - "wrapping_key", - "wrapping_alg", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_namespace','key_name','wrapping_key','wrapping_alg',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class EphemeralPrivateKeyToStaticPublicKeyInput: recipient_public_key: bytes | bytearray - def __init__( self, *, recipient_public_key: bytes | bytearray, ): - """Inputs for creating a EphemeralPrivateKeyToStaticPublicKey - Configuration. + """Inputs for creating a EphemeralPrivateKeyToStaticPublicKey Configuration. - :param recipient_public_key: The recipient's public key. MUST be - DER encoded. + :param recipient_public_key: The recipient's public key. MUST be DER encoded. """ self.recipient_public_key = recipient_public_key def as_dict(self) -> Dict[str, Any]: - """Converts the EphemeralPrivateKeyToStaticPublicKeyInput to a - dictionary.""" + """Converts the EphemeralPrivateKeyToStaticPublicKeyInput to a dictionary. + + """ return { "recipient_public_key": self.recipient_public_key, } @staticmethod def from_dict(d: Dict[str, Any]) -> "EphemeralPrivateKeyToStaticPublicKeyInput": - """Creates a EphemeralPrivateKeyToStaticPublicKeyInput from a - dictionary.""" + """Creates a EphemeralPrivateKeyToStaticPublicKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "recipient_public_key": d["recipient_public_key"], } @@ -3454,15 +3222,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, EphemeralPrivateKeyToStaticPublicKeyInput): return False - attributes: list[str] = [ - "recipient_public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['recipient_public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class PublicKeyDiscoveryInput: recipient_static_private_key: bytes | bytearray - def __init__( self, *, @@ -3470,20 +3237,24 @@ def __init__( ): """Inputs for creating a PublicKeyDiscovery Configuration. - :param recipient_static_private_key: The sender's private key. - MUST be PEM encoded. + :param recipient_static_private_key: The sender's private key. MUST be PEM + encoded. """ self.recipient_static_private_key = recipient_static_private_key def as_dict(self) -> Dict[str, Any]: - """Converts the PublicKeyDiscoveryInput to a dictionary.""" + """Converts the PublicKeyDiscoveryInput to a dictionary. + + """ return { "recipient_static_private_key": self.recipient_static_private_key, } @staticmethod def from_dict(d: Dict[str, Any]) -> "PublicKeyDiscoveryInput": - """Creates a PublicKeyDiscoveryInput from a dictionary.""" + """Creates a PublicKeyDiscoveryInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "recipient_static_private_key": d["recipient_static_private_key"], } @@ -3500,16 +3271,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, PublicKeyDiscoveryInput): return False - attributes: list[str] = [ - "recipient_static_private_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['recipient_static_private_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class RawPrivateKeyToStaticPublicKeyInput: sender_static_private_key: bytes | bytearray recipient_public_key: bytes | bytearray - def __init__( self, *, @@ -3518,16 +3288,16 @@ def __init__( ): """Inputs for creating a RawPrivateKeyToStaticPublicKey Configuration. - :param sender_static_private_key: The sender's private key. MUST - be PEM encoded. - :param recipient_public_key: The recipient's public key. MUST be - DER encoded. + :param sender_static_private_key: The sender's private key. MUST be PEM encoded. + :param recipient_public_key: The recipient's public key. MUST be DER encoded. """ self.sender_static_private_key = sender_static_private_key self.recipient_public_key = recipient_public_key def as_dict(self) -> Dict[str, Any]: - """Converts the RawPrivateKeyToStaticPublicKeyInput to a dictionary.""" + """Converts the RawPrivateKeyToStaticPublicKeyInput to a dictionary. + + """ return { "sender_static_private_key": self.sender_static_private_key, "recipient_public_key": self.recipient_public_key, @@ -3535,7 +3305,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RawPrivateKeyToStaticPublicKeyInput": - """Creates a RawPrivateKeyToStaticPublicKeyInput from a dictionary.""" + """Creates a RawPrivateKeyToStaticPublicKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "sender_static_private_key": d["sender_static_private_key"], "recipient_public_key": d["recipient_public_key"], @@ -3546,9 +3318,7 @@ def from_dict(d: Dict[str, Any]) -> "RawPrivateKeyToStaticPublicKeyInput": def __repr__(self) -> str: result = "RawPrivateKeyToStaticPublicKeyInput(" if self.sender_static_private_key is not None: - result += ( - f"sender_static_private_key={repr(self.sender_static_private_key)}, " - ) + result += f"sender_static_private_key={repr(self.sender_static_private_key)}, " if self.recipient_public_key is not None: result += f"recipient_public_key={repr(self.recipient_public_key)}" @@ -3558,16 +3328,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RawPrivateKeyToStaticPublicKeyInput): return False - attributes: list[str] = [ - "sender_static_private_key", - "recipient_public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class RawEcdhStaticConfigurationsPublicKeyDiscovery: - """Inputs for creating a PublicKeyDiscovery Configuration.""" + attributes: list[str] = ['sender_static_private_key','recipient_public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class RawEcdhStaticConfigurationsPublicKeyDiscovery(): + """Inputs for creating a PublicKeyDiscovery Configuration. + """ def __init__(self, value: PublicKeyDiscoveryInput): self.value = value @@ -3576,12 +3345,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RawEcdhStaticConfigurationsPublicKeyDiscovery": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return RawEcdhStaticConfigurationsPublicKeyDiscovery( - PublicKeyDiscoveryInput.from_dict(d["PublicKeyDiscovery"]) - ) + return RawEcdhStaticConfigurationsPublicKeyDiscovery(PublicKeyDiscoveryInput.from_dict(d["PublicKeyDiscovery"])) def __repr__(self) -> str: return f"RawEcdhStaticConfigurationsPublicKeyDiscovery(value=repr(self.value))" @@ -3591,10 +3358,9 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey: - """Inputs for creating a RawPrivateKeyToStaticPublicKey Configuration.""" - +class RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey(): + """Inputs for creating a RawPrivateKeyToStaticPublicKey Configuration. + """ def __init__(self, value: RawPrivateKeyToStaticPublicKeyInput): self.value = value @@ -3602,33 +3368,23 @@ def as_dict(self) -> Dict[str, Any]: return {"RawPrivateKeyToStaticPublicKey": self.value.as_dict()} @staticmethod - def from_dict( - d: Dict[str, Any] - ) -> "RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey": - if len(d) != 1: + def from_dict(d: Dict[str, Any]) -> "RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey": + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey( - RawPrivateKeyToStaticPublicKeyInput.from_dict( - d["RawPrivateKeyToStaticPublicKey"] - ) - ) + return RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey(RawPrivateKeyToStaticPublicKeyInput.from_dict(d["RawPrivateKeyToStaticPublicKey"])) def __repr__(self) -> str: return f"RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey(value=repr(self.value))" def __eq__(self, other: Any) -> bool: - if not isinstance( - other, RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey - ): + if not isinstance(other, RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey): return False return self.value == other.value - -class RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey: - """Inputs for creating a EphemeralPrivateKeyToStaticPublicKey - Configuration.""" - +class RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey(): + """Inputs for creating a EphemeralPrivateKeyToStaticPublicKey Configuration. + """ def __init__(self, value: EphemeralPrivateKeyToStaticPublicKeyInput): self.value = value @@ -3636,34 +3392,25 @@ def as_dict(self) -> Dict[str, Any]: return {"EphemeralPrivateKeyToStaticPublicKey": self.value.as_dict()} @staticmethod - def from_dict( - d: Dict[str, Any] - ) -> "RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey": - if len(d) != 1: + def from_dict(d: Dict[str, Any]) -> "RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey": + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey( - EphemeralPrivateKeyToStaticPublicKeyInput.from_dict( - d["EphemeralPrivateKeyToStaticPublicKey"] - ) - ) + return RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey(EphemeralPrivateKeyToStaticPublicKeyInput.from_dict(d["EphemeralPrivateKeyToStaticPublicKey"])) def __repr__(self) -> str: return f"RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey(value=repr(self.value))" def __eq__(self, other: Any) -> bool: - if not isinstance( - other, RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey - ): + if not isinstance(other, RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey): return False return self.value == other.value - -class RawEcdhStaticConfigurationsUnknown: +class RawEcdhStaticConfigurationsUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -3676,26 +3423,16 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RawEcdhStaticConfigurationsUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return RawEcdhStaticConfigurationsUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"RawEcdhStaticConfigurationsUnknown(tag={self.tag})" - # List of configurations when using RawEcdhStaticConfigurations. -RawEcdhStaticConfigurations = Union[ - RawEcdhStaticConfigurationsPublicKeyDiscovery, - RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey, - RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey, - RawEcdhStaticConfigurationsUnknown, -] - - -def _raw_ecdh_static_configurations_from_dict( - d: Dict[str, Any] -) -> RawEcdhStaticConfigurations: +RawEcdhStaticConfigurations = Union[RawEcdhStaticConfigurationsPublicKeyDiscovery, RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey, RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey, RawEcdhStaticConfigurationsUnknown] +def _raw_ecdh_static_configurations_from_dict(d: Dict[str, Any]) -> RawEcdhStaticConfigurations: if "PublicKeyDiscovery" in d: return RawEcdhStaticConfigurationsPublicKeyDiscovery.from_dict(d) @@ -3703,17 +3440,13 @@ def _raw_ecdh_static_configurations_from_dict( return RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey.from_dict(d) if "EphemeralPrivateKeyToStaticPublicKey" in d: - return ( - RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey.from_dict(d) - ) - - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") + return RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey.from_dict(d) + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class CreateRawEcdhKeyringInput: key_agreement_scheme: RawEcdhStaticConfigurations curve_spec: str - def __init__( self, *, @@ -3722,17 +3455,18 @@ def __init__( ): """Inputs for creating a raw ECDH Keyring. - :param key_agreement_scheme: The Key Agreement Scheme - configuration that is responsible for how the shared secret - is calculated. - :param curve_spec: The the curve on which the points for the - sender's private and recipient's public key lie. + :param key_agreement_scheme: The Key Agreement Scheme configuration that is + responsible for how the shared secret is calculated. + :param curve_spec: The the curve on which the points for the sender's private + and recipient's public key lie. """ self.key_agreement_scheme = key_agreement_scheme self.curve_spec = curve_spec def as_dict(self) -> Dict[str, Any]: - """Converts the CreateRawEcdhKeyringInput to a dictionary.""" + """Converts the CreateRawEcdhKeyringInput to a dictionary. + + """ return { "key_agreement_scheme": self.key_agreement_scheme.as_dict(), "curve_spec": self.curve_spec, @@ -3740,11 +3474,11 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateRawEcdhKeyringInput": - """Creates a CreateRawEcdhKeyringInput from a dictionary.""" + """Creates a CreateRawEcdhKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "key_agreement_scheme": _raw_ecdh_static_configurations_from_dict( - d["key_agreement_scheme"] - ), + "key_agreement_scheme": _raw_ecdh_static_configurations_from_dict(d["key_agreement_scheme"]), "curve_spec": d["curve_spec"], } @@ -3763,12 +3497,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateRawEcdhKeyringInput): return False - attributes: list[str] = [ - "key_agreement_scheme", - "curve_spec", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_agreement_scheme','curve_spec',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class PaddingScheme: PKCS1 = "PKCS1" @@ -3783,16 +3516,7 @@ class PaddingScheme: # This set contains every possible value known at the time this was generated. New # values may be added in the future. - values = frozenset( - { - "PKCS1", - "OAEP_SHA1_MGF1", - "OAEP_SHA256_MGF1", - "OAEP_SHA384_MGF1", - "OAEP_SHA512_MGF1", - } - ) - + values = frozenset({"PKCS1", "OAEP_SHA1_MGF1", "OAEP_SHA256_MGF1", "OAEP_SHA384_MGF1", "OAEP_SHA512_MGF1"}) class CreateRawRsaKeyringInput: key_namespace: str @@ -3800,7 +3524,6 @@ class CreateRawRsaKeyringInput: padding_scheme: str public_key: Optional[bytes | bytearray] private_key: Optional[bytes | bytearray] - def __init__( self, *, @@ -3812,21 +3535,17 @@ def __init__( ): """Inputs for creating a Raw RAW Keyring. - :param key_namespace: A namespace associated with this wrapping - key. + :param key_namespace: A namespace associated with this wrapping key. :param key_name: A name associated with this wrapping key. - :param padding_scheme: The RSA padding scheme to use with this - keyring. - :param public_key: The public RSA Key responsible for wrapping - data keys, as a UTF8 encoded, PEM encoded X.509 - SubjectPublicKeyInfo structure. If not specified, this - Keyring cannot be used on encrypt. A public key and/or a - private key must be specified. - :param private_key: The private RSA Key responsible for wrapping - data keys, as a UTF8 encoded, PEM encoded PKCS #8 - PrivateKeyInfo structure. If not specified, this Keyring - cannot be used on decrypt. A public key and/or a private key - must be specified. + :param padding_scheme: The RSA padding scheme to use with this keyring. + :param public_key: The public RSA Key responsible for wrapping data keys, as a + UTF8 encoded, PEM encoded X.509 SubjectPublicKeyInfo structure. If not + specified, this Keyring cannot be used on encrypt. A public key and/or a private + key must be specified. + :param private_key: The private RSA Key responsible for wrapping data keys, as a + UTF8 encoded, PEM encoded PKCS #8 PrivateKeyInfo structure. If not specified, + this Keyring cannot be used on decrypt. A public key and/or a private key must + be specified. """ self.key_namespace = key_namespace self.key_name = key_name @@ -3835,7 +3554,9 @@ def __init__( self.private_key = private_key def as_dict(self) -> Dict[str, Any]: - """Converts the CreateRawRsaKeyringInput to a dictionary.""" + """Converts the CreateRawRsaKeyringInput to a dictionary. + + """ d: Dict[str, Any] = { "key_namespace": self.key_namespace, "key_name": self.key_name, @@ -3852,7 +3573,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateRawRsaKeyringInput": - """Creates a CreateRawRsaKeyringInput from a dictionary.""" + """Creates a CreateRawRsaKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_namespace": d["key_namespace"], "key_name": d["key_name"], @@ -3889,63 +3612,48 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateRawRsaKeyringInput): return False - attributes: list[str] = [ - "key_namespace", - "key_name", - "padding_scheme", - "public_key", - "private_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_namespace','key_name','padding_scheme','public_key','private_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CreateRequiredEncryptionContextCMMInput: - underlying_cmm: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager" - ] - keyring: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring" - ] + underlying_cmm: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager'] + keyring: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring'] required_encryption_context_keys: list[str] - def __init__( self, *, required_encryption_context_keys: list[str], - underlying_cmm: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager" - ] = None, - keyring: Optional[ - "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring" - ] = None, + underlying_cmm: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager'] = None, + keyring: Optional['aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring'] = None, ): - """Inputs for creating an Required Encryption Context Cryptographic - Materials Manager. - - :param required_encryption_context_keys: A list of Encryption - Context keys which are required to be supplied during - encryption and decryption, and correspond to Encryption - Context key-value pairs which are not stored on the - resulting message. - :param underlying_cmm: The Cryprographic Materials Manager that - the created Required Encryption Context Cryptographic - Materials Manager will delegate to. Either a Keyring or - underlying Cryprographic Materials Manager must be - specified. - :param keyring: The Keyring that the created Cryprographic - Materials Manager will use to wrap data keys. The created - Required Encryption Context CMM will delegate to a Default - Cryptographic Materials Manager created with this Keyring. - Either a Keyring or an underlying Cryprographic Materials - Manager must be specified as input. + """Inputs for creating an Required Encryption Context Cryptographic Materials + Manager. + + :param required_encryption_context_keys: A list of Encryption Context keys which + are required to be supplied during encryption and decryption, and correspond to + Encryption Context key-value pairs which are not stored on the resulting + message. + :param underlying_cmm: The Cryprographic Materials Manager that the created + Required Encryption Context Cryptographic Materials Manager will delegate to. + Either a Keyring or underlying Cryprographic Materials Manager must be + specified. + :param keyring: The Keyring that the created Cryprographic Materials Manager + will use to wrap data keys. The created Required Encryption Context CMM will + delegate to a Default Cryptographic Materials Manager created with this Keyring. + Either a Keyring or an underlying Cryprographic Materials Manager must be + specified as input. """ self.required_encryption_context_keys = required_encryption_context_keys self.underlying_cmm = underlying_cmm self.keyring = keyring def as_dict(self) -> Dict[str, Any]: - """Converts the CreateRequiredEncryptionContextCMMInput to a - dictionary.""" + """Converts the CreateRequiredEncryptionContextCMMInput to a dictionary. + + """ d: Dict[str, Any] = { "required_encryption_context_keys": self.required_encryption_context_keys, } @@ -3960,23 +3668,17 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CreateRequiredEncryptionContextCMMInput": - """Creates a CreateRequiredEncryptionContextCMMInput from a - dictionary.""" - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - CryptographicMaterialsManager, - ) - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import ( - Keyring, - ) + """Creates a CreateRequiredEncryptionContextCMMInput from a dictionary. + """ + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import CryptographicMaterialsManager + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references import Keyring kwargs: Dict[str, Any] = { "required_encryption_context_keys": d["required_encryption_context_keys"], } if "underlying_cmm" in d: - kwargs["underlying_cmm"] = CryptographicMaterialsManager.from_dict( - d["underlying_cmm"] - ) + kwargs["underlying_cmm"] = CryptographicMaterialsManager.from_dict(d["underlying_cmm"]) if "keyring" in d: kwargs["keyring"] = Keyring.from_dict(d["keyring"]) @@ -3999,17 +3701,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CreateRequiredEncryptionContextCMMInput): return False - attributes: list[str] = [ - "underlying_cmm", - "keyring", - "required_encryption_context_keys", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['underlying_cmm','keyring','required_encryption_context_keys',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DeleteCacheEntryInput: identifier: bytes | bytearray - def __init__( self, *, @@ -4018,14 +3717,18 @@ def __init__( self.identifier = identifier def as_dict(self) -> Dict[str, Any]: - """Converts the DeleteCacheEntryInput to a dictionary.""" + """Converts the DeleteCacheEntryInput to a dictionary. + + """ return { "identifier": self.identifier, } @staticmethod def from_dict(d: Dict[str, Any]) -> "DeleteCacheEntryInput": - """Creates a DeleteCacheEntryInput from a dictionary.""" + """Creates a DeleteCacheEntryInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "identifier": d["identifier"], } @@ -4042,16 +3745,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DeleteCacheEntryInput): return False - attributes: list[str] = [ - "identifier", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['identifier',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetCacheEntryInput: identifier: bytes | bytearray bytes_used: Optional[int] - def __init__( self, *, @@ -4062,7 +3764,9 @@ def __init__( self.bytes_used = bytes_used def as_dict(self) -> Dict[str, Any]: - """Converts the GetCacheEntryInput to a dictionary.""" + """Converts the GetCacheEntryInput to a dictionary. + + """ d: Dict[str, Any] = { "identifier": self.identifier, } @@ -4074,7 +3778,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GetCacheEntryInput": - """Creates a GetCacheEntryInput from a dictionary.""" + """Creates a GetCacheEntryInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "identifier": d["identifier"], } @@ -4097,12 +3803,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetCacheEntryInput): return False - attributes: list[str] = [ - "identifier", - "bytes_used", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['identifier','bytes_used',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DecryptionMaterials: algorithm_suite: AlgorithmSuiteInfo @@ -4111,7 +3816,6 @@ class DecryptionMaterials: plaintext_data_key: Optional[bytes | bytearray] verification_key: Optional[bytes | bytearray] symmetric_signing_key: Optional[bytes | bytearray] - def __init__( self, *, @@ -4130,7 +3834,9 @@ def __init__( self.symmetric_signing_key = symmetric_signing_key def as_dict(self) -> Dict[str, Any]: - """Converts the DecryptionMaterials to a dictionary.""" + """Converts the DecryptionMaterials to a dictionary. + + """ d: Dict[str, Any] = { "algorithm_suite": self.algorithm_suite.as_dict(), "encryption_context": self.encryption_context, @@ -4150,7 +3856,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DecryptionMaterials": - """Creates a DecryptionMaterials from a dictionary.""" + """Creates a DecryptionMaterials from a dictionary. + + """ kwargs: Dict[str, Any] = { "algorithm_suite": AlgorithmSuiteInfo.from_dict(d["algorithm_suite"]), "encryption_context": d["encryption_context"], @@ -4193,22 +3901,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DecryptionMaterials): return False - attributes: list[str] = [ - "algorithm_suite", - "encryption_context", - "required_encryption_context_keys", - "plaintext_data_key", - "verification_key", - "symmetric_signing_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['algorithm_suite','encryption_context','required_encryption_context_keys','plaintext_data_key','verification_key','symmetric_signing_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class EncryptedDataKey: key_provider_id: str key_provider_info: bytes | bytearray ciphertext: bytes | bytearray - def __init__( self, *, @@ -4221,7 +3923,9 @@ def __init__( self.ciphertext = ciphertext def as_dict(self) -> Dict[str, Any]: - """Converts the EncryptedDataKey to a dictionary.""" + """Converts the EncryptedDataKey to a dictionary. + + """ return { "key_provider_id": self.key_provider_id, "key_provider_info": self.key_provider_info, @@ -4230,7 +3934,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "EncryptedDataKey": - """Creates a EncryptedDataKey from a dictionary.""" + """Creates a EncryptedDataKey from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_provider_id": d["key_provider_id"], "key_provider_info": d["key_provider_info"], @@ -4255,13 +3961,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, EncryptedDataKey): return False - attributes: list[str] = [ - "key_provider_id", - "key_provider_info", - "ciphertext", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_provider_id','key_provider_info','ciphertext',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class EncryptionMaterials: algorithm_suite: AlgorithmSuiteInfo @@ -4271,7 +3975,6 @@ class EncryptionMaterials: plaintext_data_key: Optional[bytes | bytearray] signing_key: Optional[bytes | bytearray] symmetric_signing_keys: Optional[list[bytes | bytearray]] - def __init__( self, *, @@ -4292,13 +3995,13 @@ def __init__( self.symmetric_signing_keys = symmetric_signing_keys def as_dict(self) -> Dict[str, Any]: - """Converts the EncryptionMaterials to a dictionary.""" + """Converts the EncryptionMaterials to a dictionary. + + """ d: Dict[str, Any] = { "algorithm_suite": self.algorithm_suite.as_dict(), "encryption_context": self.encryption_context, - "encrypted_data_keys": _encrypted_data_key_list_as_dict( - self.encrypted_data_keys - ), + "encrypted_data_keys": _encrypted_data_key_list_as_dict(self.encrypted_data_keys), "required_encryption_context_keys": self.required_encryption_context_keys, } @@ -4315,13 +4018,13 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "EncryptionMaterials": - """Creates a EncryptionMaterials from a dictionary.""" + """Creates a EncryptionMaterials from a dictionary. + + """ kwargs: Dict[str, Any] = { "algorithm_suite": AlgorithmSuiteInfo.from_dict(d["algorithm_suite"]), "encryption_context": d["encryption_context"], - "encrypted_data_keys": _encrypted_data_key_list_from_dict( - d["encrypted_data_keys"] - ), + "encrypted_data_keys": _encrypted_data_key_list_from_dict(d["encrypted_data_keys"]), "required_encryption_context_keys": d["required_encryption_context_keys"], } @@ -4364,19 +4067,13 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, EncryptionMaterials): return False - attributes: list[str] = [ - "algorithm_suite", - "encryption_context", - "encrypted_data_keys", - "required_encryption_context_keys", - "plaintext_data_key", - "signing_key", - "symmetric_signing_keys", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class MaterialsEncryption: + attributes: list[str] = ['algorithm_suite','encryption_context','encrypted_data_keys','required_encryption_context_keys','plaintext_data_key','signing_key','symmetric_signing_keys',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) + +class MaterialsEncryption(): def __init__(self, value: EncryptionMaterials): self.value = value @@ -4385,7 +4082,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "MaterialsEncryption": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return MaterialsEncryption(EncryptionMaterials.from_dict(d["Encryption"])) @@ -4398,8 +4095,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class MaterialsDecryption: +class MaterialsDecryption(): def __init__(self, value: DecryptionMaterials): self.value = value @@ -4408,7 +4104,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "MaterialsDecryption": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return MaterialsDecryption(DecryptionMaterials.from_dict(d["Decryption"])) @@ -4421,8 +4117,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class MaterialsBranchKey: +class MaterialsBranchKey(): def __init__(self, value: BranchKeyMaterials): self.value = value @@ -4431,7 +4126,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "MaterialsBranchKey": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return MaterialsBranchKey(BranchKeyMaterials.from_dict(d["BranchKey"])) @@ -4444,8 +4139,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class MaterialsBeaconKey: +class MaterialsBeaconKey(): def __init__(self, value: BeaconKeyMaterials): self.value = value @@ -4454,7 +4148,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "MaterialsBeaconKey": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return MaterialsBeaconKey(BeaconKeyMaterials.from_dict(d["BeaconKey"])) @@ -4467,12 +4161,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class MaterialsUnknown: +class MaterialsUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -4485,23 +4178,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "MaterialsUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return MaterialsUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"MaterialsUnknown(tag={self.tag})" - -Materials = Union[ - MaterialsEncryption, - MaterialsDecryption, - MaterialsBranchKey, - MaterialsBeaconKey, - MaterialsUnknown, -] - - +Materials = Union[MaterialsEncryption, MaterialsDecryption, MaterialsBranchKey, MaterialsBeaconKey, MaterialsUnknown] def _materials_from_dict(d: Dict[str, Any]) -> Materials: if "Encryption" in d: return MaterialsEncryption.from_dict(d) @@ -4515,8 +4199,7 @@ def _materials_from_dict(d: Dict[str, Any]) -> Materials: if "BeaconKey" in d: return MaterialsBeaconKey.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class GetCacheEntryOutput: materials: Materials @@ -4524,7 +4207,6 @@ class GetCacheEntryOutput: expiry_time: int messages_used: int bytes_used: int - def __init__( self, *, @@ -4553,7 +4235,9 @@ def __init__( self.bytes_used = bytes_used def as_dict(self) -> Dict[str, Any]: - """Converts the GetCacheEntryOutput to a dictionary.""" + """Converts the GetCacheEntryOutput to a dictionary. + + """ d: Dict[str, Any] = { "materials": self.materials.as_dict(), } @@ -4574,7 +4258,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GetCacheEntryOutput": - """Creates a GetCacheEntryOutput from a dictionary.""" + """Creates a GetCacheEntryOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "materials": _materials_from_dict(d["materials"]), } @@ -4615,15 +4301,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetCacheEntryOutput): return False - attributes: list[str] = [ - "materials", - "creation_time", - "expiry_time", - "messages_used", - "bytes_used", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['materials','creation_time','expiry_time','messages_used','bytes_used',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class PutCacheEntryInput: identifier: bytes | bytearray @@ -4632,7 +4314,6 @@ class PutCacheEntryInput: expiry_time: int messages_used: int bytes_used: int - def __init__( self, *, @@ -4663,7 +4344,9 @@ def __init__( self.bytes_used = bytes_used def as_dict(self) -> Dict[str, Any]: - """Converts the PutCacheEntryInput to a dictionary.""" + """Converts the PutCacheEntryInput to a dictionary. + + """ d: Dict[str, Any] = { "identifier": self.identifier, "materials": self.materials.as_dict(), @@ -4685,7 +4368,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "PutCacheEntryInput": - """Creates a PutCacheEntryInput from a dictionary.""" + """Creates a PutCacheEntryInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "identifier": d["identifier"], "materials": _materials_from_dict(d["materials"]), @@ -4730,21 +4415,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, PutCacheEntryInput): return False - attributes: list[str] = [ - "identifier", - "materials", - "creation_time", - "expiry_time", - "messages_used", - "bytes_used", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['identifier','materials','creation_time','expiry_time','messages_used','bytes_used',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class UpdateUsageMetadataInput: identifier: bytes | bytearray bytes_used: int - def __init__( self, *, @@ -4758,7 +4437,9 @@ def __init__( self.bytes_used = bytes_used def as_dict(self) -> Dict[str, Any]: - """Converts the UpdateUsageMetadataInput to a dictionary.""" + """Converts the UpdateUsageMetadataInput to a dictionary. + + """ d: Dict[str, Any] = { "identifier": self.identifier, } @@ -4770,7 +4451,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "UpdateUsageMetadataInput": - """Creates a UpdateUsageMetadataInput from a dictionary.""" + """Creates a UpdateUsageMetadataInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "identifier": d["identifier"], } @@ -4793,12 +4476,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, UpdateUsageMetadataInput): return False - attributes: list[str] = [ - "identifier", - "bytes_used", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['identifier','bytes_used',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DBECommitmentPolicy: REQUIRE_ENCRYPT_REQUIRE_DECRYPT = "REQUIRE_ENCRYPT_REQUIRE_DECRYPT" @@ -4807,7 +4489,6 @@ class DBECommitmentPolicy: # values may be added in the future. values = frozenset({"REQUIRE_ENCRYPT_REQUIRE_DECRYPT"}) - class ESDKCommitmentPolicy: FORBID_ENCRYPT_ALLOW_DECRYPT = "FORBID_ENCRYPT_ALLOW_DECRYPT" @@ -4817,16 +4498,9 @@ class ESDKCommitmentPolicy: # This set contains every possible value known at the time this was generated. New # values may be added in the future. - values = frozenset( - { - "FORBID_ENCRYPT_ALLOW_DECRYPT", - "REQUIRE_ENCRYPT_ALLOW_DECRYPT", - "REQUIRE_ENCRYPT_REQUIRE_DECRYPT", - } - ) - + values = frozenset({"FORBID_ENCRYPT_ALLOW_DECRYPT", "REQUIRE_ENCRYPT_ALLOW_DECRYPT", "REQUIRE_ENCRYPT_REQUIRE_DECRYPT"}) -class CommitmentPolicyESDK: +class CommitmentPolicyESDK(): def __init__(self, value: str): self.value = value @@ -4835,7 +4509,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CommitmentPolicyESDK": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CommitmentPolicyESDK(d["ESDK"]) @@ -4848,8 +4522,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CommitmentPolicyDBE: +class CommitmentPolicyDBE(): def __init__(self, value: str): self.value = value @@ -4858,7 +4531,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CommitmentPolicyDBE": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CommitmentPolicyDBE(d["DBE"]) @@ -4871,12 +4544,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class CommitmentPolicyUnknown: +class CommitmentPolicyUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -4889,19 +4561,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CommitmentPolicyUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return CommitmentPolicyUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"CommitmentPolicyUnknown(tag={self.tag})" - -CommitmentPolicy = Union[ - CommitmentPolicyESDK, CommitmentPolicyDBE, CommitmentPolicyUnknown -] - - +CommitmentPolicy = Union[CommitmentPolicyESDK, CommitmentPolicyDBE, CommitmentPolicyUnknown] def _commitment_policy_from_dict(d: Dict[str, Any]) -> CommitmentPolicy: if "ESDK" in d: return CommitmentPolicyESDK.from_dict(d) @@ -4909,8 +4576,7 @@ def _commitment_policy_from_dict(d: Dict[str, Any]) -> CommitmentPolicy: if "DBE" in d: return CommitmentPolicyDBE.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class DecryptMaterialsInput: algorithm_suite_id: AlgorithmSuiteId @@ -4918,7 +4584,6 @@ class DecryptMaterialsInput: encrypted_data_keys: list[EncryptedDataKey] encryption_context: dict[str, str] reproduced_encryption_context: Optional[dict[str, str]] - def __init__( self, *, @@ -4935,13 +4600,13 @@ def __init__( self.reproduced_encryption_context = reproduced_encryption_context def as_dict(self) -> Dict[str, Any]: - """Converts the DecryptMaterialsInput to a dictionary.""" + """Converts the DecryptMaterialsInput to a dictionary. + + """ d: Dict[str, Any] = { "algorithm_suite_id": self.algorithm_suite_id.as_dict(), "commitment_policy": self.commitment_policy.as_dict(), - "encrypted_data_keys": _encrypted_data_key_list_as_dict( - self.encrypted_data_keys - ), + "encrypted_data_keys": _encrypted_data_key_list_as_dict(self.encrypted_data_keys), "encryption_context": self.encryption_context, } @@ -4952,15 +4617,13 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DecryptMaterialsInput": - """Creates a DecryptMaterialsInput from a dictionary.""" + """Creates a DecryptMaterialsInput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "algorithm_suite_id": _algorithm_suite_id_from_dict( - d["algorithm_suite_id"] - ), + "algorithm_suite_id": _algorithm_suite_id_from_dict(d["algorithm_suite_id"]), "commitment_policy": _commitment_policy_from_dict(d["commitment_policy"]), - "encrypted_data_keys": _encrypted_data_key_list_from_dict( - d["encrypted_data_keys"] - ), + "encrypted_data_keys": _encrypted_data_key_list_from_dict(d["encrypted_data_keys"]), "encryption_context": d["encryption_context"], } @@ -4991,19 +4654,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DecryptMaterialsInput): return False - attributes: list[str] = [ - "algorithm_suite_id", - "commitment_policy", - "encrypted_data_keys", - "encryption_context", - "reproduced_encryption_context", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['algorithm_suite_id','commitment_policy','encrypted_data_keys','encryption_context','reproduced_encryption_context',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DecryptMaterialsOutput: decryption_materials: DecryptionMaterials - def __init__( self, *, @@ -5012,18 +4670,20 @@ def __init__( self.decryption_materials = decryption_materials def as_dict(self) -> Dict[str, Any]: - """Converts the DecryptMaterialsOutput to a dictionary.""" + """Converts the DecryptMaterialsOutput to a dictionary. + + """ return { "decryption_materials": self.decryption_materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "DecryptMaterialsOutput": - """Creates a DecryptMaterialsOutput from a dictionary.""" + """Creates a DecryptMaterialsOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "decryption_materials": DecryptionMaterials.from_dict( - d["decryption_materials"] - ), + "decryption_materials": DecryptionMaterials.from_dict(d["decryption_materials"]), } return DecryptMaterialsOutput(**kwargs) @@ -5038,11 +4698,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DecryptMaterialsOutput): return False - attributes: list[str] = [ - "decryption_materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['decryption_materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetEncryptionMaterialsInput: encryption_context: dict[str, str] @@ -5050,7 +4710,6 @@ class GetEncryptionMaterialsInput: algorithm_suite_id: Optional[AlgorithmSuiteId] max_plaintext_length: Optional[int] required_encryption_context_keys: Optional[list[str]] - def __init__( self, *, @@ -5067,7 +4726,9 @@ def __init__( self.required_encryption_context_keys = required_encryption_context_keys def as_dict(self) -> Dict[str, Any]: - """Converts the GetEncryptionMaterialsInput to a dictionary.""" + """Converts the GetEncryptionMaterialsInput to a dictionary. + + """ d: Dict[str, Any] = { "encryption_context": self.encryption_context, "commitment_policy": self.commitment_policy.as_dict(), @@ -5080,32 +4741,28 @@ def as_dict(self) -> Dict[str, Any]: d["max_plaintext_length"] = self.max_plaintext_length if self.required_encryption_context_keys is not None: - d["required_encryption_context_keys"] = ( - self.required_encryption_context_keys - ) + d["required_encryption_context_keys"] = self.required_encryption_context_keys return d @staticmethod def from_dict(d: Dict[str, Any]) -> "GetEncryptionMaterialsInput": - """Creates a GetEncryptionMaterialsInput from a dictionary.""" + """Creates a GetEncryptionMaterialsInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "encryption_context": d["encryption_context"], "commitment_policy": _commitment_policy_from_dict(d["commitment_policy"]), } if "algorithm_suite_id" in d: - kwargs["algorithm_suite_id"] = ( - _algorithm_suite_id_from_dict(d["algorithm_suite_id"]), - ) + kwargs["algorithm_suite_id"] = _algorithm_suite_id_from_dict(d["algorithm_suite_id"]), if "max_plaintext_length" in d: kwargs["max_plaintext_length"] = d["max_plaintext_length"] if "required_encryption_context_keys" in d: - kwargs["required_encryption_context_keys"] = d[ - "required_encryption_context_keys" - ] + kwargs["required_encryption_context_keys"] = d["required_encryption_context_keys"] return GetEncryptionMaterialsInput(**kwargs) @@ -5131,19 +4788,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetEncryptionMaterialsInput): return False - attributes: list[str] = [ - "encryption_context", - "commitment_policy", - "algorithm_suite_id", - "max_plaintext_length", - "required_encryption_context_keys", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['encryption_context','commitment_policy','algorithm_suite_id','max_plaintext_length','required_encryption_context_keys',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetEncryptionMaterialsOutput: encryption_materials: EncryptionMaterials - def __init__( self, *, @@ -5152,18 +4804,20 @@ def __init__( self.encryption_materials = encryption_materials def as_dict(self) -> Dict[str, Any]: - """Converts the GetEncryptionMaterialsOutput to a dictionary.""" + """Converts the GetEncryptionMaterialsOutput to a dictionary. + + """ return { "encryption_materials": self.encryption_materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetEncryptionMaterialsOutput": - """Creates a GetEncryptionMaterialsOutput from a dictionary.""" + """Creates a GetEncryptionMaterialsOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "encryption_materials": EncryptionMaterials.from_dict( - d["encryption_materials"] - ), + "encryption_materials": EncryptionMaterials.from_dict(d["encryption_materials"]), } return GetEncryptionMaterialsOutput(**kwargs) @@ -5178,17 +4832,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetEncryptionMaterialsOutput): return False - attributes: list[str] = [ - "encryption_materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['encryption_materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class InitializeDecryptionMaterialsInput: algorithm_suite_id: AlgorithmSuiteId encryption_context: dict[str, str] required_encryption_context_keys: list[str] - def __init__( self, *, @@ -5201,7 +4854,9 @@ def __init__( self.required_encryption_context_keys = required_encryption_context_keys def as_dict(self) -> Dict[str, Any]: - """Converts the InitializeDecryptionMaterialsInput to a dictionary.""" + """Converts the InitializeDecryptionMaterialsInput to a dictionary. + + """ return { "algorithm_suite_id": self.algorithm_suite_id.as_dict(), "encryption_context": self.encryption_context, @@ -5210,11 +4865,11 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "InitializeDecryptionMaterialsInput": - """Creates a InitializeDecryptionMaterialsInput from a dictionary.""" + """Creates a InitializeDecryptionMaterialsInput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "algorithm_suite_id": _algorithm_suite_id_from_dict( - d["algorithm_suite_id"] - ), + "algorithm_suite_id": _algorithm_suite_id_from_dict(d["algorithm_suite_id"]), "encryption_context": d["encryption_context"], "required_encryption_context_keys": d["required_encryption_context_keys"], } @@ -5237,13 +4892,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InitializeDecryptionMaterialsInput): return False - attributes: list[str] = [ - "algorithm_suite_id", - "encryption_context", - "required_encryption_context_keys", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['algorithm_suite_id','encryption_context','required_encryption_context_keys',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class InitializeEncryptionMaterialsInput: algorithm_suite_id: AlgorithmSuiteId @@ -5251,7 +4904,6 @@ class InitializeEncryptionMaterialsInput: required_encryption_context_keys: list[str] signing_key: Optional[bytes | bytearray] verification_key: Optional[bytes | bytearray] - def __init__( self, *, @@ -5268,7 +4920,9 @@ def __init__( self.verification_key = verification_key def as_dict(self) -> Dict[str, Any]: - """Converts the InitializeEncryptionMaterialsInput to a dictionary.""" + """Converts the InitializeEncryptionMaterialsInput to a dictionary. + + """ d: Dict[str, Any] = { "algorithm_suite_id": self.algorithm_suite_id.as_dict(), "encryption_context": self.encryption_context, @@ -5285,11 +4939,11 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "InitializeEncryptionMaterialsInput": - """Creates a InitializeEncryptionMaterialsInput from a dictionary.""" + """Creates a InitializeEncryptionMaterialsInput from a dictionary. + + """ kwargs: Dict[str, Any] = { - "algorithm_suite_id": _algorithm_suite_id_from_dict( - d["algorithm_suite_id"] - ), + "algorithm_suite_id": _algorithm_suite_id_from_dict(d["algorithm_suite_id"]), "encryption_context": d["encryption_context"], "required_encryption_context_keys": d["required_encryption_context_keys"], } @@ -5324,20 +4978,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, InitializeEncryptionMaterialsInput): return False - attributes: list[str] = [ - "algorithm_suite_id", - "encryption_context", - "required_encryption_context_keys", - "signing_key", - "verification_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['algorithm_suite_id','encryption_context','required_encryption_context_keys','signing_key','verification_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OnDecryptInput: materials: DecryptionMaterials encrypted_data_keys: list[EncryptedDataKey] - def __init__( self, *, @@ -5348,22 +4997,22 @@ def __init__( self.encrypted_data_keys = encrypted_data_keys def as_dict(self) -> Dict[str, Any]: - """Converts the OnDecryptInput to a dictionary.""" + """Converts the OnDecryptInput to a dictionary. + + """ return { "materials": self.materials.as_dict(), - "encrypted_data_keys": _encrypted_data_key_list_as_dict( - self.encrypted_data_keys - ), + "encrypted_data_keys": _encrypted_data_key_list_as_dict(self.encrypted_data_keys), } @staticmethod def from_dict(d: Dict[str, Any]) -> "OnDecryptInput": - """Creates a OnDecryptInput from a dictionary.""" + """Creates a OnDecryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "materials": DecryptionMaterials.from_dict(d["materials"]), - "encrypted_data_keys": _encrypted_data_key_list_from_dict( - d["encrypted_data_keys"] - ), + "encrypted_data_keys": _encrypted_data_key_list_from_dict(d["encrypted_data_keys"]), } return OnDecryptInput(**kwargs) @@ -5381,16 +5030,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, OnDecryptInput): return False - attributes: list[str] = [ - "materials", - "encrypted_data_keys", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['materials','encrypted_data_keys',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OnDecryptOutput: materials: DecryptionMaterials - def __init__( self, *, @@ -5399,14 +5046,18 @@ def __init__( self.materials = materials def as_dict(self) -> Dict[str, Any]: - """Converts the OnDecryptOutput to a dictionary.""" + """Converts the OnDecryptOutput to a dictionary. + + """ return { "materials": self.materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "OnDecryptOutput": - """Creates a OnDecryptOutput from a dictionary.""" + """Creates a OnDecryptOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "materials": DecryptionMaterials.from_dict(d["materials"]), } @@ -5423,15 +5074,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, OnDecryptOutput): return False - attributes: list[str] = [ - "materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OnEncryptInput: materials: EncryptionMaterials - def __init__( self, *, @@ -5440,14 +5090,18 @@ def __init__( self.materials = materials def as_dict(self) -> Dict[str, Any]: - """Converts the OnEncryptInput to a dictionary.""" + """Converts the OnEncryptInput to a dictionary. + + """ return { "materials": self.materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "OnEncryptInput": - """Creates a OnEncryptInput from a dictionary.""" + """Creates a OnEncryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "materials": EncryptionMaterials.from_dict(d["materials"]), } @@ -5464,15 +5118,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, OnEncryptInput): return False - attributes: list[str] = [ - "materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OnEncryptOutput: materials: EncryptionMaterials - def __init__( self, *, @@ -5481,14 +5134,18 @@ def __init__( self.materials = materials def as_dict(self) -> Dict[str, Any]: - """Converts the OnEncryptOutput to a dictionary.""" + """Converts the OnEncryptOutput to a dictionary. + + """ return { "materials": self.materials.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "OnEncryptOutput": - """Creates a OnEncryptOutput from a dictionary.""" + """Creates a OnEncryptOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "materials": EncryptionMaterials.from_dict(d["materials"]), } @@ -5505,16 +5162,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, OnEncryptOutput): return False - attributes: list[str] = [ - "materials", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['materials',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ValidateCommitmentPolicyOnDecryptInput: algorithm: AlgorithmSuiteId commitment_policy: CommitmentPolicy - def __init__( self, *, @@ -5525,8 +5181,9 @@ def __init__( self.commitment_policy = commitment_policy def as_dict(self) -> Dict[str, Any]: - """Converts the ValidateCommitmentPolicyOnDecryptInput to a - dictionary.""" + """Converts the ValidateCommitmentPolicyOnDecryptInput to a dictionary. + + """ return { "algorithm": self.algorithm.as_dict(), "commitment_policy": self.commitment_policy.as_dict(), @@ -5534,8 +5191,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "ValidateCommitmentPolicyOnDecryptInput": - """Creates a ValidateCommitmentPolicyOnDecryptInput from a - dictionary.""" + """Creates a ValidateCommitmentPolicyOnDecryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "algorithm": _algorithm_suite_id_from_dict(d["algorithm"]), "commitment_policy": _commitment_policy_from_dict(d["commitment_policy"]), @@ -5556,17 +5214,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ValidateCommitmentPolicyOnDecryptInput): return False - attributes: list[str] = [ - "algorithm", - "commitment_policy", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['algorithm','commitment_policy',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ValidateCommitmentPolicyOnEncryptInput: algorithm: AlgorithmSuiteId commitment_policy: CommitmentPolicy - def __init__( self, *, @@ -5577,8 +5233,9 @@ def __init__( self.commitment_policy = commitment_policy def as_dict(self) -> Dict[str, Any]: - """Converts the ValidateCommitmentPolicyOnEncryptInput to a - dictionary.""" + """Converts the ValidateCommitmentPolicyOnEncryptInput to a dictionary. + + """ return { "algorithm": self.algorithm.as_dict(), "commitment_policy": self.commitment_policy.as_dict(), @@ -5586,8 +5243,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "ValidateCommitmentPolicyOnEncryptInput": - """Creates a ValidateCommitmentPolicyOnEncryptInput from a - dictionary.""" + """Creates a ValidateCommitmentPolicyOnEncryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "algorithm": _algorithm_suite_id_from_dict(d["algorithm"]), "commitment_policy": _commitment_policy_from_dict(d["commitment_policy"]), @@ -5608,17 +5266,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ValidateCommitmentPolicyOnEncryptInput): return False - attributes: list[str] = [ - "algorithm", - "commitment_policy", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['algorithm','commitment_policy',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ValidDecryptionMaterialsTransitionInput: start: DecryptionMaterials stop: DecryptionMaterials - def __init__( self, *, @@ -5629,8 +5285,9 @@ def __init__( self.stop = stop def as_dict(self) -> Dict[str, Any]: - """Converts the ValidDecryptionMaterialsTransitionInput to a - dictionary.""" + """Converts the ValidDecryptionMaterialsTransitionInput to a dictionary. + + """ return { "start": self.start.as_dict(), "stop": self.stop.as_dict(), @@ -5638,8 +5295,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "ValidDecryptionMaterialsTransitionInput": - """Creates a ValidDecryptionMaterialsTransitionInput from a - dictionary.""" + """Creates a ValidDecryptionMaterialsTransitionInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "start": DecryptionMaterials.from_dict(d["start"]), "stop": DecryptionMaterials.from_dict(d["stop"]), @@ -5660,17 +5318,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ValidDecryptionMaterialsTransitionInput): return False - attributes: list[str] = [ - "start", - "stop", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['start','stop',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ValidEncryptionMaterialsTransitionInput: start: EncryptionMaterials stop: EncryptionMaterials - def __init__( self, *, @@ -5681,8 +5337,9 @@ def __init__( self.stop = stop def as_dict(self) -> Dict[str, Any]: - """Converts the ValidEncryptionMaterialsTransitionInput to a - dictionary.""" + """Converts the ValidEncryptionMaterialsTransitionInput to a dictionary. + + """ return { "start": self.start.as_dict(), "stop": self.stop.as_dict(), @@ -5690,8 +5347,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "ValidEncryptionMaterialsTransitionInput": - """Creates a ValidEncryptionMaterialsTransitionInput from a - dictionary.""" + """Creates a ValidEncryptionMaterialsTransitionInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "start": EncryptionMaterials.from_dict(d["start"]), "stop": EncryptionMaterials.from_dict(d["stop"]), @@ -5712,16 +5370,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ValidEncryptionMaterialsTransitionInput): return False - attributes: list[str] = [ - "start", - "stop", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - - -class StaticConfigurationsAWS_KMS_ECDH: - """Allowed configurations when using KmsEcdhStaticConfigurations.""" + attributes: list[str] = ['start','stop',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) +class StaticConfigurationsAWS_KMS_ECDH(): + """Allowed configurations when using KmsEcdhStaticConfigurations. + """ def __init__(self, value: KmsEcdhStaticConfigurations): self.value = value @@ -5730,12 +5387,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "StaticConfigurationsAWS_KMS_ECDH": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return StaticConfigurationsAWS_KMS_ECDH( - _kms_ecdh_static_configurations_from_dict(d["AWS_KMS_ECDH"]) - ) + return StaticConfigurationsAWS_KMS_ECDH(_kms_ecdh_static_configurations_from_dict(d["AWS_KMS_ECDH"])) def __repr__(self) -> str: return f"StaticConfigurationsAWS_KMS_ECDH(value=repr(self.value))" @@ -5745,10 +5400,9 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class StaticConfigurationsRAW_ECDH: - """List of configurations when using RawEcdhStaticConfigurations.""" - +class StaticConfigurationsRAW_ECDH(): + """List of configurations when using RawEcdhStaticConfigurations. + """ def __init__(self, value: RawEcdhStaticConfigurations): self.value = value @@ -5757,12 +5411,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "StaticConfigurationsRAW_ECDH": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return StaticConfigurationsRAW_ECDH( - _raw_ecdh_static_configurations_from_dict(d["RAW_ECDH"]) - ) + return StaticConfigurationsRAW_ECDH(_raw_ecdh_static_configurations_from_dict(d["RAW_ECDH"])) def __repr__(self) -> str: return f"StaticConfigurationsRAW_ECDH(value=repr(self.value))" @@ -5772,12 +5424,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class StaticConfigurationsUnknown: +class StaticConfigurationsUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -5790,22 +5441,15 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "StaticConfigurationsUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return StaticConfigurationsUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"StaticConfigurationsUnknown(tag={self.tag})" - # Supported configurations for the StaticConfiguration Key Agreement Scheme. -StaticConfigurations = Union[ - StaticConfigurationsAWS_KMS_ECDH, - StaticConfigurationsRAW_ECDH, - StaticConfigurationsUnknown, -] - - +StaticConfigurations = Union[StaticConfigurationsAWS_KMS_ECDH, StaticConfigurationsRAW_ECDH, StaticConfigurationsUnknown] def _static_configurations_from_dict(d: Dict[str, Any]) -> StaticConfigurations: if "AWS_KMS_ECDH" in d: return StaticConfigurationsAWS_KMS_ECDH.from_dict(d) @@ -5813,13 +5457,11 @@ def _static_configurations_from_dict(d: Dict[str, Any]) -> StaticConfigurations: if "RAW_ECDH" in d: return StaticConfigurationsRAW_ECDH.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - - -class KeyAgreementSchemeStaticConfiguration: - """Supported configurations for the StaticConfiguration Key Agreement - Scheme.""" + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') +class KeyAgreementSchemeStaticConfiguration(): + """Supported configurations for the StaticConfiguration Key Agreement Scheme. + """ def __init__(self, value: StaticConfigurations): self.value = value @@ -5828,12 +5470,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyAgreementSchemeStaticConfiguration": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return KeyAgreementSchemeStaticConfiguration( - _static_configurations_from_dict(d["StaticConfiguration"]) - ) + return KeyAgreementSchemeStaticConfiguration(_static_configurations_from_dict(d["StaticConfiguration"])) def __repr__(self) -> str: return f"KeyAgreementSchemeStaticConfiguration(value=repr(self.value))" @@ -5843,12 +5483,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyAgreementSchemeUnknown: +class KeyAgreementSchemeUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -5861,34 +5500,26 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyAgreementSchemeUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyAgreementSchemeUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"KeyAgreementSchemeUnknown(tag={self.tag})" - # Supported ECDH Key Agreement Schemes. -KeyAgreementScheme = Union[ - KeyAgreementSchemeStaticConfiguration, KeyAgreementSchemeUnknown -] - - +KeyAgreementScheme = Union[KeyAgreementSchemeStaticConfiguration, KeyAgreementSchemeUnknown] def _key_agreement_scheme_from_dict(d: Dict[str, Any]) -> KeyAgreementScheme: if "StaticConfiguration" in d: return KeyAgreementSchemeStaticConfiguration.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') def _encrypted_data_key_list_as_dict(given: list[EncryptedDataKey]) -> List[Any]: return [v.as_dict() for v in given] - def _encrypted_data_key_list_from_dict(given: List[Any]) -> list[EncryptedDataKey]: return [EncryptedDataKey.from_dict(v) for v in given] - class Unit: pass diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/plugin.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/plugin.py index 6f0d25a66..e2a5e5a03 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/plugin.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/plugin.py @@ -2,47 +2,34 @@ # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. -from .config import ( - Config, - Plugin, - smithy_config_to_dafny_config, - MaterialProvidersConfig, -) +from .config import Config, Plugin, smithy_config_to_dafny_config, MaterialProvidersConfig from smithy_python.interfaces.retries import RetryStrategy from smithy_python.exceptions import SmithyRetryException from .dafnyImplInterface import DafnyImplInterface - def set_config_impl(config: Config): - """Set the Dafny-compiled implementation in the Smithy-Python client Config - and load our custom NoRetriesStrategy.""" + """ + Set the Dafny-compiled implementation in the Smithy-Python client Config + and load our custom NoRetriesStrategy. + """ config.dafnyImplInterface = DafnyImplInterface() if isinstance(config, MaterialProvidersConfig): - from aws_cryptographic_material_providers.internaldafny.generated.MaterialProviders import ( - default__, - ) - - config.dafnyImplInterface.impl = default__.MaterialProviders( - smithy_config_to_dafny_config(config) - ).value + from aws_cryptographic_material_providers.internaldafny.generated.MaterialProviders import default__ + config.dafnyImplInterface.impl = default__.MaterialProviders(smithy_config_to_dafny_config(config)).value config.retry_strategy = NoRetriesStrategy() - class ZeroRetryDelayToken: - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not wait to retry. """ - retry_delay = 0 - class NoRetriesStrategy(RetryStrategy): - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not retry calling Dafny code. """ - def acquire_initial_retry_token(self): return ZeroRetryDelayToken() diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/references.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/references.py index f95718c41..86c1918b3 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/references.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/references.py @@ -34,36 +34,31 @@ from typing import Any, Dict + class IBranchKeyIdSupplier(metaclass=abc.ABCMeta): @classmethod def __subclasshook__(cls, subclass): - return hasattr(subclass, "GetBranchKeyId") and callable(subclass.GetBranchKeyId) + return ( + hasattr(subclass, "GetBranchKeyId") and callable(subclass.GetBranchKeyId) + ) @abc.abstractmethod - def get_branch_key_id( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdOutput": - """Given the Encryption Context associated with this encryption or - decryption, returns the branch key that should be responsible for - unwrapping or wrapping the data key. - - :param param: Inputs for determining the Branch Key which should - be used to wrap or unwrap the data key for this encryption - or decryption - :returns: Outputs for the Branch Key responsible for wrapping or - unwrapping the data key in this encryption or decryption. + def get_branch_key_id(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdOutput': + """Given the Encryption Context associated with this encryption or decryption, + returns the branch key that should be responsible for unwrapping or wrapping the + data key. + :param param: Inputs for determining the Branch Key which should be used to wrap + or unwrap the data key for this encryption or decryption + :returns: Outputs for the Branch Key responsible for wrapping or unwrapping the + data key in this encryption or decryption. """ raise NotImplementedError - def GetBranchKeyId( - self, dafny_input: "DafnyGetBranchKeyIdInput" - ) -> "DafnyGetBranchKeyIdOutput": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def GetBranchKeyId(self, dafny_input: 'DafnyGetBranchKeyIdInput') -> 'DafnyGetBranchKeyIdOutput': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetBranchKeyIdInput( dafny_input @@ -78,82 +73,56 @@ def GetBranchKeyId( error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - class BranchKeyIdSupplier(IBranchKeyIdSupplier): - _impl: ( - aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier - ) + _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier - def __init__( - self, - _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier, - ): + def __init__(self, _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IBranchKeyIdSupplier): self._impl = _impl - def get_branch_key_id( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdOutput": - """Given the Encryption Context associated with this encryption or - decryption, returns the branch key that should be responsible for - unwrapping or wrapping the data key. - - :param param: Inputs for determining the Branch Key which should - be used to wrap or unwrap the data key for this encryption - or decryption - :returns: Outputs for the Branch Key responsible for wrapping or - unwrapping the data key in this encryption or decryption. + def get_branch_key_id(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetBranchKeyIdOutput': + """Given the Encryption Context associated with this encryption or decryption, + returns the branch key that should be responsible for unwrapping or wrapping the + data key. + :param param: Inputs for determining the Branch Key which should be used to wrap + or unwrap the data key for this encryption or decryption + :returns: Outputs for the Branch Key responsible for wrapping or unwrapping the + data key in this encryption or decryption. """ - dafny_output = self._impl.GetBranchKeyId( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetBranchKeyIdInput( - param - ) - ) + dafny_output = self._impl.GetBranchKeyId(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetBranchKeyIdInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as aws_cryptography_materialproviders_deserialize_error, - ) - - raise aws_cryptography_materialproviders_deserialize_error( - dafny_output.error - ) + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as aws_cryptography_materialproviders_deserialize_error + raise aws_cryptography_materialproviders_deserialize_error(dafny_output.error) else: - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetBranchKeyIdOutput( - dafny_output.value - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetBranchKeyIdOutput(dafny_output.value) @staticmethod - def from_dict(d: Dict[str, Any]) -> "BranchKeyIdSupplier": - return BranchKeyIdSupplier(d["_impl"]) + def from_dict(d: Dict[str, Any]) -> 'BranchKeyIdSupplier': + return BranchKeyIdSupplier(d['_impl']) def as_dict(self) -> Dict[str, Any]: - return {"_impl": self._impl} - + return {'_impl': self._impl} class IClientSupplier(metaclass=abc.ABCMeta): @classmethod def __subclasshook__(cls, subclass): - return hasattr(subclass, "GetClient") and callable(subclass.GetClient) + return ( + hasattr(subclass, "GetClient") and callable(subclass.GetClient) + ) @abc.abstractmethod - def get_client( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetClientInput", - ) -> "botocore.client.BaseClient": + def get_client(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetClientInput') -> 'botocore.client.BaseClient': """Returns an AWS KMS Client. - :param param: Inputs for getting a AWS KMS Client. """ raise NotImplementedError - def GetClient(self, dafny_input: "DafnyGetClientInput") -> "DafnyGetClientOutput": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def GetClient(self, dafny_input: 'DafnyGetClientInput') -> 'DafnyGetClientOutput': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetClientInput( dafny_input @@ -168,102 +137,63 @@ def GetClient(self, dafny_input: "DafnyGetClientInput") -> "DafnyGetClientOutput error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - class ClientSupplier(IClientSupplier): - _impl: ( - aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IClientSupplier - ) + _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IClientSupplier - def __init__( - self, - _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IClientSupplier, - ): + def __init__(self, _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IClientSupplier): self._impl = _impl - def get_client( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetClientInput", - ) -> "botocore.client.BaseClient": + def get_client(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetClientInput') -> 'botocore.client.BaseClient': """Returns an AWS KMS Client. - :param param: Inputs for getting a AWS KMS Client. """ - dafny_output = self._impl.GetClient( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetClientInput( - param - ) - ) + dafny_output = self._impl.GetClient(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetClientInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as aws_cryptography_materialproviders_deserialize_error, - ) - - raise aws_cryptography_materialproviders_deserialize_error( - dafny_output.error - ) + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as aws_cryptography_materialproviders_deserialize_error + raise aws_cryptography_materialproviders_deserialize_error(dafny_output.error) else: - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetClientOutput( - dafny_output.value - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetClientOutput(dafny_output.value) @staticmethod - def from_dict(d: Dict[str, Any]) -> "ClientSupplier": - return ClientSupplier(d["_impl"]) + def from_dict(d: Dict[str, Any]) -> 'ClientSupplier': + return ClientSupplier(d['_impl']) def as_dict(self) -> Dict[str, Any]: - return {"_impl": self._impl} - + return {'_impl': self._impl} class ICryptographicMaterialsCache(metaclass=abc.ABCMeta): @classmethod def __subclasshook__(cls, subclass): return ( - hasattr(subclass, "PutCacheEntry") - and callable(subclass.PutCacheEntry) - and hasattr(subclass, "GetCacheEntry") - and callable(subclass.GetCacheEntry) - and hasattr(subclass, "UpdateUsageMetadata") - and callable(subclass.UpdateUsageMetadata) - and hasattr(subclass, "DeleteCacheEntry") - and callable(subclass.DeleteCacheEntry) + hasattr(subclass, "PutCacheEntry") and callable(subclass.PutCacheEntry) and + hasattr(subclass, "GetCacheEntry") and callable(subclass.GetCacheEntry) and + hasattr(subclass, "UpdateUsageMetadata") and callable(subclass.UpdateUsageMetadata) and + hasattr(subclass, "DeleteCacheEntry") and callable(subclass.DeleteCacheEntry) ) @abc.abstractmethod - def put_cache_entry( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.PutCacheEntryInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit": + def put_cache_entry(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.PutCacheEntryInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit': raise NotImplementedError @abc.abstractmethod - def get_cache_entry( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryOutput": + def get_cache_entry(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryOutput': raise NotImplementedError @abc.abstractmethod - def update_usage_metadata( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.UpdateUsageMetadataInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit": + def update_usage_metadata(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.UpdateUsageMetadataInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit': raise NotImplementedError @abc.abstractmethod - def delete_cache_entry( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DeleteCacheEntryInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit": + def delete_cache_entry(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DeleteCacheEntryInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit': raise NotImplementedError - def PutCacheEntry(self, dafny_input: "DafnyPutCacheEntryInput") -> "None": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def PutCacheEntry(self, dafny_input: 'DafnyPutCacheEntryInput') -> 'None': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_PutCacheEntryInput( dafny_input @@ -278,13 +208,10 @@ def PutCacheEntry(self, dafny_input: "DafnyPutCacheEntryInput") -> "None": error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - def GetCacheEntry( - self, dafny_input: "DafnyGetCacheEntryInput" - ) -> "DafnyGetCacheEntryOutput": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def GetCacheEntry(self, dafny_input: 'DafnyGetCacheEntryInput') -> 'DafnyGetCacheEntryOutput': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetCacheEntryInput( dafny_input @@ -299,13 +226,10 @@ def GetCacheEntry( error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - def UpdateUsageMetadata( - self, dafny_input: "DafnyUpdateUsageMetadataInput" - ) -> "None": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def UpdateUsageMetadata(self, dafny_input: 'DafnyUpdateUsageMetadataInput') -> 'None': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_UpdateUsageMetadataInput( dafny_input @@ -320,11 +244,10 @@ def UpdateUsageMetadata( error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - def DeleteCacheEntry(self, dafny_input: "DafnyDeleteCacheEntryInput") -> "None": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def DeleteCacheEntry(self, dafny_input: 'DafnyDeleteCacheEntryInput') -> 'None': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DeleteCacheEntryInput( dafny_input @@ -339,145 +262,77 @@ def DeleteCacheEntry(self, dafny_input: "DafnyDeleteCacheEntryInput") -> "None": error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - class CryptographicMaterialsCache(ICryptographicMaterialsCache): - _impl: ( - aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache - ) + _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache - def __init__( - self, - _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache, - ): + def __init__(self, _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsCache): self._impl = _impl - def put_cache_entry( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.PutCacheEntryInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit": - dafny_output = self._impl.PutCacheEntry( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PutCacheEntryInput( - param - ) - ) + def put_cache_entry(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.PutCacheEntryInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit': + dafny_output = self._impl.PutCacheEntry(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PutCacheEntryInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as smithy_api_deserialize_error, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as smithy_api_deserialize_error raise smithy_api_deserialize_error(dafny_output.error) else: - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.smithy_api_Unit() - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.smithy_api_Unit() - def get_cache_entry( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryOutput": - dafny_output = self._impl.GetCacheEntry( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetCacheEntryInput( - param - ) - ) + def get_cache_entry(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetCacheEntryOutput': + dafny_output = self._impl.GetCacheEntry(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetCacheEntryInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as aws_cryptography_materialproviders_deserialize_error, - ) - - raise aws_cryptography_materialproviders_deserialize_error( - dafny_output.error - ) + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as aws_cryptography_materialproviders_deserialize_error + raise aws_cryptography_materialproviders_deserialize_error(dafny_output.error) else: - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetCacheEntryOutput( - dafny_output.value - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetCacheEntryOutput(dafny_output.value) - def update_usage_metadata( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.UpdateUsageMetadataInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit": - dafny_output = self._impl.UpdateUsageMetadata( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_UpdateUsageMetadataInput( - param - ) - ) + def update_usage_metadata(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.UpdateUsageMetadataInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit': + dafny_output = self._impl.UpdateUsageMetadata(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_UpdateUsageMetadataInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as smithy_api_deserialize_error, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as smithy_api_deserialize_error raise smithy_api_deserialize_error(dafny_output.error) else: - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.smithy_api_Unit() - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.smithy_api_Unit() - def delete_cache_entry( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DeleteCacheEntryInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit": - dafny_output = self._impl.DeleteCacheEntry( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DeleteCacheEntryInput( - param - ) - ) + def delete_cache_entry(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DeleteCacheEntryInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.Unit': + dafny_output = self._impl.DeleteCacheEntry(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DeleteCacheEntryInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as smithy_api_deserialize_error, - ) - + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as smithy_api_deserialize_error raise smithy_api_deserialize_error(dafny_output.error) else: - return ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.smithy_api_Unit() - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.smithy_api_Unit() @staticmethod - def from_dict(d: Dict[str, Any]) -> "CryptographicMaterialsCache": - return CryptographicMaterialsCache(d["_impl"]) + def from_dict(d: Dict[str, Any]) -> 'CryptographicMaterialsCache': + return CryptographicMaterialsCache(d['_impl']) def as_dict(self) -> Dict[str, Any]: - return {"_impl": self._impl} - + return {'_impl': self._impl} class ICryptographicMaterialsManager(metaclass=abc.ABCMeta): @classmethod def __subclasshook__(cls, subclass): return ( - hasattr(subclass, "GetEncryptionMaterials") - and callable(subclass.GetEncryptionMaterials) - and hasattr(subclass, "DecryptMaterials") - and callable(subclass.DecryptMaterials) + hasattr(subclass, "GetEncryptionMaterials") and callable(subclass.GetEncryptionMaterials) and + hasattr(subclass, "DecryptMaterials") and callable(subclass.DecryptMaterials) ) @abc.abstractmethod - def get_encryption_materials( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsOutput": + def get_encryption_materials(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsOutput': raise NotImplementedError @abc.abstractmethod - def decrypt_materials( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsOutput": + def decrypt_materials(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsOutput': raise NotImplementedError - def GetEncryptionMaterials( - self, dafny_input: "DafnyGetEncryptionMaterialsInput" - ) -> "DafnyGetEncryptionMaterialsOutput": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def GetEncryptionMaterials(self, dafny_input: 'DafnyGetEncryptionMaterialsInput') -> 'DafnyGetEncryptionMaterialsOutput': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetEncryptionMaterialsInput( dafny_input @@ -492,13 +347,10 @@ def GetEncryptionMaterials( error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - def DecryptMaterials( - self, dafny_input: "DafnyDecryptMaterialsInput" - ) -> "DafnyDecryptMaterialsOutput": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def DecryptMaterials(self, dafny_input: 'DafnyDecryptMaterialsInput') -> 'DafnyDecryptMaterialsOutput': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptMaterialsInput( dafny_input @@ -513,103 +365,59 @@ def DecryptMaterials( error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - class CryptographicMaterialsManager(ICryptographicMaterialsManager): - _impl: ( - aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager - ) + _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager - def __init__( - self, - _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager, - ): + def __init__(self, _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.ICryptographicMaterialsManager): self._impl = _impl - def get_encryption_materials( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsOutput": - dafny_output = self._impl.GetEncryptionMaterials( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetEncryptionMaterialsInput( - param - ) - ) + def get_encryption_materials(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetEncryptionMaterialsOutput': + dafny_output = self._impl.GetEncryptionMaterials(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetEncryptionMaterialsInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as aws_cryptography_materialproviders_deserialize_error, - ) - - raise aws_cryptography_materialproviders_deserialize_error( - dafny_output.error - ) + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as aws_cryptography_materialproviders_deserialize_error + raise aws_cryptography_materialproviders_deserialize_error(dafny_output.error) else: - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetEncryptionMaterialsOutput( - dafny_output.value - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetEncryptionMaterialsOutput(dafny_output.value) - def decrypt_materials( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsOutput": - dafny_output = self._impl.DecryptMaterials( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptMaterialsInput( - param - ) - ) + def decrypt_materials(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptMaterialsOutput': + dafny_output = self._impl.DecryptMaterials(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptMaterialsInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as aws_cryptography_materialproviders_deserialize_error, - ) - - raise aws_cryptography_materialproviders_deserialize_error( - dafny_output.error - ) + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as aws_cryptography_materialproviders_deserialize_error + raise aws_cryptography_materialproviders_deserialize_error(dafny_output.error) else: - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptMaterialsOutput( - dafny_output.value - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptMaterialsOutput(dafny_output.value) @staticmethod - def from_dict(d: Dict[str, Any]) -> "CryptographicMaterialsManager": - return CryptographicMaterialsManager(d["_impl"]) + def from_dict(d: Dict[str, Any]) -> 'CryptographicMaterialsManager': + return CryptographicMaterialsManager(d['_impl']) def as_dict(self) -> Dict[str, Any]: - return {"_impl": self._impl} - + return {'_impl': self._impl} class IKeyring(metaclass=abc.ABCMeta): @classmethod def __subclasshook__(cls, subclass): return ( - hasattr(subclass, "OnEncrypt") - and callable(subclass.OnEncrypt) - and hasattr(subclass, "OnDecrypt") - and callable(subclass.OnDecrypt) + hasattr(subclass, "OnEncrypt") and callable(subclass.OnEncrypt) and + hasattr(subclass, "OnDecrypt") and callable(subclass.OnDecrypt) ) @abc.abstractmethod - def on_encrypt( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptOutput": + def on_encrypt(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptOutput': raise NotImplementedError @abc.abstractmethod - def on_decrypt( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptOutput": + def on_decrypt(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptOutput': raise NotImplementedError - def OnEncrypt(self, dafny_input: "DafnyOnEncryptInput") -> "DafnyOnEncryptOutput": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def OnEncrypt(self, dafny_input: 'DafnyOnEncryptInput') -> 'DafnyOnEncryptOutput': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_OnEncryptInput( dafny_input @@ -624,11 +432,10 @@ def OnEncrypt(self, dafny_input: "DafnyOnEncryptInput") -> "DafnyOnEncryptOutput error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - def OnDecrypt(self, dafny_input: "DafnyOnDecryptInput") -> "DafnyOnDecryptOutput": - """Do not use. - - This method allows custom implementations of this interface to - interact with generated code. + def OnDecrypt(self, dafny_input: 'DafnyOnDecryptInput') -> 'DafnyOnDecryptOutput': + """ + Do not use. + This method allows custom implementations of this interface to interact with generated code. """ native_input = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_OnDecryptInput( dafny_input @@ -643,68 +450,34 @@ def OnDecrypt(self, dafny_input: "DafnyOnDecryptInput") -> "DafnyOnDecryptOutput error = _smithy_error_to_dafny_error(e) return Wrappers.Result_Failure(error) - class Keyring(IKeyring): - _impl: ( - aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IKeyring - ) + _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IKeyring - def __init__( - self, - _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IKeyring, - ): + def __init__(self, _impl: aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IKeyring): self._impl = _impl - def on_encrypt( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptOutput": - dafny_output = self._impl.OnEncrypt( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_OnEncryptInput( - param - ) - ) + def on_encrypt(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnEncryptOutput': + dafny_output = self._impl.OnEncrypt(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_OnEncryptInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as aws_cryptography_materialproviders_deserialize_error, - ) - - raise aws_cryptography_materialproviders_deserialize_error( - dafny_output.error - ) + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as aws_cryptography_materialproviders_deserialize_error + raise aws_cryptography_materialproviders_deserialize_error(dafny_output.error) else: - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_OnEncryptOutput( - dafny_output.value - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_OnEncryptOutput(dafny_output.value) - def on_decrypt( - self, - param: "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptInput", - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptOutput": - dafny_output = self._impl.OnDecrypt( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_OnDecryptInput( - param - ) - ) + def on_decrypt(self, param: 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptInput') -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.OnDecryptOutput': + dafny_output = self._impl.OnDecrypt(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_OnDecryptInput(param)) if dafny_output.IsFailure(): - from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import ( - _deserialize_error as aws_cryptography_materialproviders_deserialize_error, - ) - - raise aws_cryptography_materialproviders_deserialize_error( - dafny_output.error - ) + from aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.deserialize import _deserialize_error as aws_cryptography_materialproviders_deserialize_error + raise aws_cryptography_materialproviders_deserialize_error(dafny_output.error) else: - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_OnDecryptOutput( - dafny_output.value - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_OnDecryptOutput(dafny_output.value) @staticmethod - def from_dict(d: Dict[str, Any]) -> "Keyring": - return Keyring(d["_impl"]) + def from_dict(d: Dict[str, Any]) -> 'Keyring': + return Keyring(d['_impl']) def as_dict(self) -> Dict[str, Any]: - return {"_impl": self._impl} + return {'_impl': self._impl} diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/serialize.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/serialize.py index 3778a0c55..14597f1d4 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/serialize.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/serialize.py @@ -10,287 +10,88 @@ def _serialize_create_aws_kms_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsKeyringInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateAwsKmsKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsKeyringInput(input)) def _serialize_create_aws_kms_discovery_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsDiscoveryKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryKeyringInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateAwsKmsDiscoveryKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryKeyringInput(input)) def _serialize_create_aws_kms_multi_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsMultiKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMultiKeyringInput( - input - ), - ) - - -def _serialize_create_aws_kms_discovery_multi_keyring( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsDiscoveryMultiKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput( - input - ), - ) + return DafnyRequest(operation_name="CreateAwsKmsMultiKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMultiKeyringInput(input)) +def _serialize_create_aws_kms_discovery_multi_keyring(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateAwsKmsDiscoveryMultiKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput(input)) def _serialize_create_aws_kms_mrk_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsMrkKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkKeyringInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateAwsKmsMrkKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkKeyringInput(input)) def _serialize_create_aws_kms_mrk_multi_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsMrkMultiKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkMultiKeyringInput( - input - ), - ) - - -def _serialize_create_aws_kms_mrk_discovery_keyring( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsMrkDiscoveryKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput( - input - ), - ) - - -def _serialize_create_aws_kms_mrk_discovery_multi_keyring( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsMrkDiscoveryMultiKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput( - input - ), - ) - - -def _serialize_create_aws_kms_hierarchical_keyring( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsHierarchicalKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput( - input - ), - ) + return DafnyRequest(operation_name="CreateAwsKmsMrkMultiKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkMultiKeyringInput(input)) +def _serialize_create_aws_kms_mrk_discovery_keyring(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateAwsKmsMrkDiscoveryKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput(input)) -def _serialize_create_aws_kms_rsa_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsRsaKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsRsaKeyringInput( - input - ), - ) +def _serialize_create_aws_kms_mrk_discovery_multi_keyring(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateAwsKmsMrkDiscoveryMultiKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput(input)) +def _serialize_create_aws_kms_hierarchical_keyring(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateAwsKmsHierarchicalKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput(input)) -def _serialize_create_aws_kms_ecdh_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateAwsKmsEcdhKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsEcdhKeyringInput( - input - ), - ) +def _serialize_create_aws_kms_rsa_keyring(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateAwsKmsRsaKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsRsaKeyringInput(input)) +def _serialize_create_aws_kms_ecdh_keyring(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateAwsKmsEcdhKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateAwsKmsEcdhKeyringInput(input)) def _serialize_create_multi_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateMultiKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateMultiKeyringInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateMultiKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateMultiKeyringInput(input)) def _serialize_create_raw_aes_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateRawAesKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRawAesKeyringInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateRawAesKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRawAesKeyringInput(input)) def _serialize_create_raw_rsa_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateRawRsaKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRawRsaKeyringInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateRawRsaKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRawRsaKeyringInput(input)) def _serialize_create_raw_ecdh_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateRawEcdhKeyring", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRawEcdhKeyringInput( - input - ), - ) - - -def _serialize_create_default_cryptographic_materials_manager( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateDefaultCryptographicMaterialsManager", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput( - input - ), - ) - - -def _serialize_create_required_encryption_context_cmm( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateRequiredEncryptionContextCMM", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput( - input - ), - ) - - -def _serialize_create_cryptographic_materials_cache( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateCryptographicMaterialsCache", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput( - input - ), - ) + return DafnyRequest(operation_name="CreateRawEcdhKeyring", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRawEcdhKeyringInput(input)) +def _serialize_create_default_cryptographic_materials_manager(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateDefaultCryptographicMaterialsManager", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput(input)) -def _serialize_create_default_client_supplier(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateDefaultClientSupplier", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateDefaultClientSupplierInput( - input - ), - ) +def _serialize_create_required_encryption_context_cmm(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateRequiredEncryptionContextCMM", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput(input)) +def _serialize_create_cryptographic_materials_cache(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateCryptographicMaterialsCache", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput(input)) -def _serialize_initialize_encryption_materials(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="InitializeEncryptionMaterials", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_InitializeEncryptionMaterialsInput( - input - ), - ) +def _serialize_create_default_client_supplier(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateDefaultClientSupplier", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateDefaultClientSupplierInput(input)) +def _serialize_initialize_encryption_materials(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="InitializeEncryptionMaterials", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_InitializeEncryptionMaterialsInput(input)) def _serialize_initialize_decryption_materials(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="InitializeDecryptionMaterials", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_InitializeDecryptionMaterialsInput( - input - ), - ) - - -def _serialize_valid_encryption_materials_transition( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="ValidEncryptionMaterialsTransition", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput( - input - ), - ) - - -def _serialize_valid_decryption_materials_transition( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="ValidDecryptionMaterialsTransition", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput( - input - ), - ) - - -def _serialize_encryption_materials_has_plaintext_data_key( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="EncryptionMaterialsHasPlaintextDataKey", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - input - ), - ) - - -def _serialize_decryption_materials_with_plaintext_data_key( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="DecryptionMaterialsWithPlaintextDataKey", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - input - ), - ) + return DafnyRequest(operation_name="InitializeDecryptionMaterials", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_InitializeDecryptionMaterialsInput(input)) +def _serialize_valid_encryption_materials_transition(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="ValidEncryptionMaterialsTransition", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput(input)) -def _serialize_get_algorithm_suite_info(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GetAlgorithmSuiteInfo", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetAlgorithmSuiteInfoInput( - input - ), - ) +def _serialize_valid_decryption_materials_transition(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="ValidDecryptionMaterialsTransition", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput(input)) +def _serialize_encryption_materials_has_plaintext_data_key(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="EncryptionMaterialsHasPlaintextDataKey", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(input)) + +def _serialize_decryption_materials_with_plaintext_data_key(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="DecryptionMaterialsWithPlaintextDataKey", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(input)) + +def _serialize_get_algorithm_suite_info(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="GetAlgorithmSuiteInfo", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_GetAlgorithmSuiteInfoInput(input)) def _serialize_valid_algorithm_suite_info(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="ValidAlgorithmSuiteInfo", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - input - ), - ) - - -def _serialize_validate_commitment_policy_on_encrypt( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="ValidateCommitmentPolicyOnEncrypt", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput( - input - ), - ) - - -def _serialize_validate_commitment_policy_on_decrypt( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="ValidateCommitmentPolicyOnDecrypt", - dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput( - input - ), - ) + return DafnyRequest(operation_name="ValidAlgorithmSuiteInfo", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo(input)) + +def _serialize_validate_commitment_policy_on_encrypt(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="ValidateCommitmentPolicyOnEncrypt", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput(input)) + +def _serialize_validate_commitment_policy_on_decrypt(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="ValidateCommitmentPolicyOnDecrypt", dafny_operation_input=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput(input)) diff --git a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/smithy_to_dafny.py b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/smithy_to_dafny.py index c64ed7e8f..c332406d6 100644 --- a/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/smithy_to_dafny.py +++ b/AwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptographic_material_providers/smithygenerated/aws_cryptography_materialproviders/smithy_to_dafny.py @@ -140,1509 +140,477 @@ def aws_cryptography_materialproviders_GetBranchKeyIdInput(native_input): return DafnyGetBranchKeyIdInput( - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), ) - def aws_cryptography_materialproviders_GetBranchKeyIdOutput(native_input): return DafnyGetBranchKeyIdOutput( - branchKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.branch_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + branchKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_id.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviders_GetClientInput(native_input): return DafnyGetClientInput( - region=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.region.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + region=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.region.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviders_GetClientOutput(native_input): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input - ) - + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input) def aws_cryptography_materialproviders_KmsClientReference(native_input): import aws_cryptography_internal_kms.internaldafny.generated.Com_Amazonaws_Kms - - client = aws_cryptography_internal_kms.internaldafny.generated.Com_Amazonaws_Kms.default__.KMSClient( - boto_client=native_input - ) + client = aws_cryptography_internal_kms.internaldafny.generated.Com_Amazonaws_Kms.default__.KMSClient(boto_client = native_input) client.value.impl = native_input return client.value - def aws_cryptography_materialproviders_PutCacheEntryInput(native_input): return DafnyPutCacheEntryInput( identifier=Seq(native_input.identifier), - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Materials( - native_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Materials(native_input.materials), creationTime=native_input.creation_time, expiryTime=native_input.expiry_time, - messagesUsed=( - (Option_Some(native_input.messages_used)) - if (native_input.messages_used is not None) - else (Option_None()) - ), - bytesUsed=( - (Option_Some(native_input.bytes_used)) - if (native_input.bytes_used is not None) - else (Option_None()) - ), + messagesUsed=((Option_Some(native_input.messages_used)) if (native_input.messages_used is not None) else (Option_None())), + bytesUsed=((Option_Some(native_input.bytes_used)) if (native_input.bytes_used is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_Materials(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsEncryption, - ): - Materials_union_value = Materials_Encryption( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsDecryption, - ): - Materials_union_value = Materials_Decryption( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBranchKey, - ): - Materials_union_value = Materials_BranchKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BranchKeyMaterials( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBeaconKey, - ): - Materials_union_value = Materials_BeaconKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BeaconKeyMaterials( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsEncryption): + Materials_union_value = Materials_Encryption(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsDecryption): + Materials_union_value = Materials_Decryption(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBranchKey): + Materials_union_value = Materials_BranchKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BranchKeyMaterials(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.MaterialsBeaconKey): + Materials_union_value = Materials_BeaconKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_keystore.smithy_to_dafny.aws_cryptography_keystore_BeaconKeyMaterials(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return Materials_union_value - def aws_cryptography_materialproviders_EncryptionMaterials(native_input): return DafnyEncryptionMaterials( - algorithmSuite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - native_input.algorithm_suite - ), - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), - encryptedDataKeys=Seq( - [ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptedDataKey( - list_element - ) - for list_element in native_input.encrypted_data_keys - ] - ), - requiredEncryptionContextKeys=Seq( - [ - Seq(list_element.encode("utf-8")) - for list_element in native_input.required_encryption_context_keys - ] - ), - plaintextDataKey=( - (Option_Some(Seq(native_input.plaintext_data_key))) - if (native_input.plaintext_data_key is not None) - else (Option_None()) - ), - signingKey=( - (Option_Some(Seq(native_input.signing_key))) - if (native_input.signing_key is not None) - else (Option_None()) - ), - symmetricSigningKeys=( - ( - Option_Some( - Seq( - [ - Seq(list_element) - for list_element in native_input.symmetric_signing_keys - ] - ) - ) - ) - if (native_input.symmetric_signing_keys is not None) - else (Option_None()) - ), + algorithmSuite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo(native_input.algorithm_suite), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), + encryptedDataKeys=Seq([aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptedDataKey(list_element) for list_element in native_input.encrypted_data_keys]), + requiredEncryptionContextKeys=Seq([Seq(list_element.encode('utf-8')) for list_element in native_input.required_encryption_context_keys]), + plaintextDataKey=((Option_Some(Seq(native_input.plaintext_data_key))) if (native_input.plaintext_data_key is not None) else (Option_None())), + signingKey=((Option_Some(Seq(native_input.signing_key))) if (native_input.signing_key is not None) else (Option_None())), + symmetricSigningKeys=((Option_Some(Seq([Seq(list_element) for list_element in native_input.symmetric_signing_keys]))) if (native_input.symmetric_signing_keys is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_DecryptionMaterials(native_input): return DafnyDecryptionMaterials( - algorithmSuite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - native_input.algorithm_suite - ), - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), - requiredEncryptionContextKeys=Seq( - [ - Seq(list_element.encode("utf-8")) - for list_element in native_input.required_encryption_context_keys - ] - ), - plaintextDataKey=( - (Option_Some(Seq(native_input.plaintext_data_key))) - if (native_input.plaintext_data_key is not None) - else (Option_None()) - ), - verificationKey=( - (Option_Some(Seq(native_input.verification_key))) - if (native_input.verification_key is not None) - else (Option_None()) - ), - symmetricSigningKey=( - (Option_Some(Seq(native_input.symmetric_signing_key))) - if (native_input.symmetric_signing_key is not None) - else (Option_None()) - ), + algorithmSuite=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo(native_input.algorithm_suite), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), + requiredEncryptionContextKeys=Seq([Seq(list_element.encode('utf-8')) for list_element in native_input.required_encryption_context_keys]), + plaintextDataKey=((Option_Some(Seq(native_input.plaintext_data_key))) if (native_input.plaintext_data_key is not None) else (Option_None())), + verificationKey=((Option_Some(Seq(native_input.verification_key))) if (native_input.verification_key is not None) else (Option_None())), + symmetricSigningKey=((Option_Some(Seq(native_input.symmetric_signing_key))) if (native_input.symmetric_signing_key is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_AlgorithmSuiteInfo(native_input): return DafnyAlgorithmSuiteInfo( - id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId( - native_input.id - ), + id=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId(native_input.id), binaryId=Seq(native_input.binary_id), messageVersion=native_input.message_version, - encrypt=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Encrypt( - native_input.encrypt - ), - kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm( - native_input.kdf - ), - commitment=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm( - native_input.commitment - ), - signature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_SignatureAlgorithm( - native_input.signature - ), - symmetricSignature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_SymmetricSignatureAlgorithm( - native_input.symmetric_signature - ), - edkWrapping=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EdkWrappingAlgorithm( - native_input.edk_wrapping - ), + encrypt=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Encrypt(native_input.encrypt), + kdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm(native_input.kdf), + commitment=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm(native_input.commitment), + signature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_SignatureAlgorithm(native_input.signature), + symmetricSignature=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_SymmetricSignatureAlgorithm(native_input.symmetric_signature), + edkWrapping=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EdkWrappingAlgorithm(native_input.edk_wrapping), ) - def aws_cryptography_materialproviders_EncryptedDataKey(native_input): return DafnyEncryptedDataKey( - keyProviderId=Seq(native_input.key_provider_id.encode("utf-8")), + keyProviderId=Seq(native_input.key_provider_id.encode('utf-8')), keyProviderInfo=Seq(native_input.key_provider_info), ciphertext=Seq(native_input.ciphertext), ) - def aws_cryptography_materialproviders_AlgorithmSuiteId(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdESDK, - ): - AlgorithmSuiteId_union_value = AlgorithmSuiteId_ESDK( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ESDKAlgorithmSuiteId( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdDBE, - ): - AlgorithmSuiteId_union_value = AlgorithmSuiteId_DBE( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DBEAlgorithmSuiteId( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdESDK): + AlgorithmSuiteId_union_value = AlgorithmSuiteId_ESDK(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ESDKAlgorithmSuiteId(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteIdDBE): + AlgorithmSuiteId_union_value = AlgorithmSuiteId_DBE(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DBEAlgorithmSuiteId(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return AlgorithmSuiteId_union_value - def aws_cryptography_materialproviders_Encrypt(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptAES_GCM, - ): - Encrypt_union_value = Encrypt_AES__GCM( - aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AES_GCM( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptAES_GCM): + Encrypt_union_value = Encrypt_AES__GCM(aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AES_GCM(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return Encrypt_union_value - def aws_cryptography_materialproviders_DerivationAlgorithm(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmHKDF, - ): - DerivationAlgorithm_union_value = DerivationAlgorithm_HKDF( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_HKDF( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmIDENTITY, - ): - DerivationAlgorithm_union_value = DerivationAlgorithm_IDENTITY( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_IDENTITY( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmNone, - ): - DerivationAlgorithm_union_value = DerivationAlgorithm_None( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_None( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmHKDF): + DerivationAlgorithm_union_value = DerivationAlgorithm_HKDF(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_HKDF(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmIDENTITY): + DerivationAlgorithm_union_value = DerivationAlgorithm_IDENTITY(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_IDENTITY(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DerivationAlgorithmNone): + DerivationAlgorithm_union_value = DerivationAlgorithm_None(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_None(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return DerivationAlgorithm_union_value - def aws_cryptography_materialproviders_SignatureAlgorithm(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmECDSA, - ): - SignatureAlgorithm_union_value = SignatureAlgorithm_ECDSA( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ECDSA( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmNone, - ): - SignatureAlgorithm_union_value = SignatureAlgorithm_None( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_None( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmECDSA): + SignatureAlgorithm_union_value = SignatureAlgorithm_ECDSA(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ECDSA(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SignatureAlgorithmNone): + SignatureAlgorithm_union_value = SignatureAlgorithm_None(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_None(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return SignatureAlgorithm_union_value - def aws_cryptography_materialproviders_SymmetricSignatureAlgorithm(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmHMAC, - ): - SymmetricSignatureAlgorithm_union_value = SymmetricSignatureAlgorithm_HMAC( - aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmNone, - ): - SymmetricSignatureAlgorithm_union_value = SymmetricSignatureAlgorithm_None( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_None( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmHMAC): + SymmetricSignatureAlgorithm_union_value = SymmetricSignatureAlgorithm_HMAC(aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.SymmetricSignatureAlgorithmNone): + SymmetricSignatureAlgorithm_union_value = SymmetricSignatureAlgorithm_None(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_None(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return SymmetricSignatureAlgorithm_union_value - def aws_cryptography_materialproviders_EdkWrappingAlgorithm(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmDIRECT_KEY_WRAPPING, - ): - EdkWrappingAlgorithm_union_value = EdkWrappingAlgorithm_DIRECT__KEY__WRAPPING( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DIRECT_KEY_WRAPPING( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmIntermediateKeyWrapping, - ): - EdkWrappingAlgorithm_union_value = EdkWrappingAlgorithm_IntermediateKeyWrapping( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_IntermediateKeyWrapping( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmDIRECT_KEY_WRAPPING): + EdkWrappingAlgorithm_union_value = EdkWrappingAlgorithm_DIRECT__KEY__WRAPPING(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DIRECT_KEY_WRAPPING(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EdkWrappingAlgorithmIntermediateKeyWrapping): + EdkWrappingAlgorithm_union_value = EdkWrappingAlgorithm_IntermediateKeyWrapping(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_IntermediateKeyWrapping(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return EdkWrappingAlgorithm_union_value - def aws_cryptography_materialproviders_ESDKAlgorithmSuiteId(native_input): - if native_input == "0x0014": + if native_input == '0x0014': return ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__NO__KDF() - elif native_input == "0x0046": + elif native_input == '0x0046': return ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__NO__KDF() - elif native_input == "0x0078": + elif native_input == '0x0078': return ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__NO__KDF() - elif native_input == "0x0114": + elif native_input == '0x0114': return ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256() - elif native_input == "0x0146": + elif native_input == '0x0146': return ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA256() - elif native_input == "0x0178": + elif native_input == '0x0178': return ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA256() - elif native_input == "0x0214": - return ( - ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256__ECDSA__P256() - ) + elif native_input == '0x0214': + return ESDKAlgorithmSuiteId_ALG__AES__128__GCM__IV12__TAG16__HKDF__SHA256__ECDSA__P256() - elif native_input == "0x0346": - return ( - ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384() - ) + elif native_input == '0x0346': + return ESDKAlgorithmSuiteId_ALG__AES__192__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384() - elif native_input == "0x0378": - return ( - ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384() - ) + elif native_input == '0x0378': + return ESDKAlgorithmSuiteId_ALG__AES__256__GCM__IV12__TAG16__HKDF__SHA384__ECDSA__P384() - elif native_input == "0x0478": + elif native_input == '0x0478': return ESDKAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY() - elif native_input == "0x0578": - return ( - ESDKAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384() - ) + elif native_input == '0x0578': + return ESDKAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_materialproviders_DBEAlgorithmSuiteId(native_input): - if native_input == "0x6700": - return ( - DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__SYMSIG__HMAC__SHA384() - ) + if native_input == '0x6700': + return DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__SYMSIG__HMAC__SHA384() - elif native_input == "0x6701": - return ( - DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384__SYMSIG__HMAC__SHA384() - ) + elif native_input == '0x6701': + return DBEAlgorithmSuiteId_ALG__AES__256__GCM__HKDF__SHA512__COMMIT__KEY__ECDSA__P384__SYMSIG__HMAC__SHA384() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_materialproviders_HKDF(native_input): return DafnyHKDF( - hmac=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.hmac - ), + hmac=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.hmac), saltLength=native_input.salt_length, inputKeyLength=native_input.input_key_length, outputKeyLength=native_input.output_key_length, ) - def aws_cryptography_materialproviders_IDENTITY(native_input): - return DafnyIDENTITY() - + return DafnyIDENTITY( + ) def aws_cryptography_materialproviders_None(native_input): - return DafnyNone() - + return DafnyNone( + ) def aws_cryptography_materialproviders_ECDSA(native_input): return DafnyECDSA( - curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm( - native_input.curve - ), + curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm(native_input.curve), ) - def aws_cryptography_materialproviders_DIRECT_KEY_WRAPPING(native_input): - return DafnyDIRECT_KEY_WRAPPING() - + return DafnyDIRECT_KEY_WRAPPING( + ) def aws_cryptography_materialproviders_IntermediateKeyWrapping(native_input): return DafnyIntermediateKeyWrapping( - keyEncryptionKeyKdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm( - native_input.key_encryption_key_kdf - ), - macKeyKdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm( - native_input.mac_key_kdf - ), - pdkEncryptAlgorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Encrypt( - native_input.pdk_encrypt_algorithm - ), + keyEncryptionKeyKdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm(native_input.key_encryption_key_kdf), + macKeyKdf=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DerivationAlgorithm(native_input.mac_key_kdf), + pdkEncryptAlgorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Encrypt(native_input.pdk_encrypt_algorithm), ) - def smithy_api_Unit(native_input): return None - def aws_cryptography_materialproviders_GetCacheEntryInput(native_input): return DafnyGetCacheEntryInput( identifier=Seq(native_input.identifier), - bytesUsed=( - (Option_Some(native_input.bytes_used)) - if (native_input.bytes_used is not None) - else (Option_None()) - ), + bytesUsed=((Option_Some(native_input.bytes_used)) if (native_input.bytes_used is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_GetCacheEntryOutput(native_input): return DafnyGetCacheEntryOutput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Materials( - native_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_Materials(native_input.materials), creationTime=native_input.creation_time, expiryTime=native_input.expiry_time, messagesUsed=native_input.messages_used, bytesUsed=native_input.bytes_used, ) - def aws_cryptography_materialproviders_UpdateUsageMetadataInput(native_input): return DafnyUpdateUsageMetadataInput( identifier=Seq(native_input.identifier), bytesUsed=native_input.bytes_used, ) - def aws_cryptography_materialproviders_DeleteCacheEntryInput(native_input): return DafnyDeleteCacheEntryInput( identifier=Seq(native_input.identifier), ) - def aws_cryptography_materialproviders_GetEncryptionMaterialsInput(native_input): return DafnyGetEncryptionMaterialsInput( - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), - commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy( - native_input.commitment_policy - ), - algorithmSuiteId=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId( - native_input.algorithm_suite_id - ) - ) - ) - if (native_input.algorithm_suite_id is not None) - else (Option_None()) - ), - maxPlaintextLength=( - (Option_Some(native_input.max_plaintext_length)) - if (native_input.max_plaintext_length is not None) - else (Option_None()) - ), - requiredEncryptionContextKeys=( - ( - Option_Some( - Seq( - [ - Seq(list_element.encode("utf-8")) - for list_element in native_input.required_encryption_context_keys - ] - ) - ) - ) - if (native_input.required_encryption_context_keys is not None) - else (Option_None()) - ), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), + commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy(native_input.commitment_policy), + algorithmSuiteId=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId(native_input.algorithm_suite_id))) if (native_input.algorithm_suite_id is not None) else (Option_None())), + maxPlaintextLength=((Option_Some(native_input.max_plaintext_length)) if (native_input.max_plaintext_length is not None) else (Option_None())), + requiredEncryptionContextKeys=((Option_Some(Seq([Seq(list_element.encode('utf-8')) for list_element in native_input.required_encryption_context_keys]))) if (native_input.required_encryption_context_keys is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_CommitmentPolicy(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyESDK, - ): - CommitmentPolicy_union_value = CommitmentPolicy_ESDK( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ESDKCommitmentPolicy( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyDBE, - ): - CommitmentPolicy_union_value = CommitmentPolicy_DBE( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DBECommitmentPolicy( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyESDK): + CommitmentPolicy_union_value = CommitmentPolicy_ESDK(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ESDKCommitmentPolicy(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CommitmentPolicyDBE): + CommitmentPolicy_union_value = CommitmentPolicy_DBE(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DBECommitmentPolicy(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return CommitmentPolicy_union_value - def aws_cryptography_materialproviders_ESDKCommitmentPolicy(native_input): - if native_input == "FORBID_ENCRYPT_ALLOW_DECRYPT": + if native_input == 'FORBID_ENCRYPT_ALLOW_DECRYPT': return ESDKCommitmentPolicy_FORBID__ENCRYPT__ALLOW__DECRYPT() - elif native_input == "REQUIRE_ENCRYPT_ALLOW_DECRYPT": + elif native_input == 'REQUIRE_ENCRYPT_ALLOW_DECRYPT': return ESDKCommitmentPolicy_REQUIRE__ENCRYPT__ALLOW__DECRYPT() - elif native_input == "REQUIRE_ENCRYPT_REQUIRE_DECRYPT": + elif native_input == 'REQUIRE_ENCRYPT_REQUIRE_DECRYPT': return ESDKCommitmentPolicy_REQUIRE__ENCRYPT__REQUIRE__DECRYPT() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_materialproviders_DBECommitmentPolicy(native_input): - if native_input == "REQUIRE_ENCRYPT_REQUIRE_DECRYPT": + if native_input == 'REQUIRE_ENCRYPT_REQUIRE_DECRYPT': return DBECommitmentPolicy_REQUIRE__ENCRYPT__REQUIRE__DECRYPT() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_materialproviders_GetEncryptionMaterialsOutput(native_input): return DafnyGetEncryptionMaterialsOutput( - encryptionMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - native_input.encryption_materials - ), + encryptionMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(native_input.encryption_materials), ) - def aws_cryptography_materialproviders_DecryptMaterialsInput(native_input): return DafnyDecryptMaterialsInput( - algorithmSuiteId=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId( - native_input.algorithm_suite_id - ), - commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy( - native_input.commitment_policy - ), - encryptedDataKeys=Seq( - [ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptedDataKey( - list_element - ) - for list_element in native_input.encrypted_data_keys - ] - ), - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), - reproducedEncryptionContext=( - ( - Option_Some( - Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for ( - key, - value, - ) in native_input.reproduced_encryption_context.items() - } - ) - ) - ) - if (native_input.reproduced_encryption_context is not None) - else (Option_None()) - ), + algorithmSuiteId=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId(native_input.algorithm_suite_id), + commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy(native_input.commitment_policy), + encryptedDataKeys=Seq([aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptedDataKey(list_element) for list_element in native_input.encrypted_data_keys]), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), + reproducedEncryptionContext=((Option_Some(Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.reproduced_encryption_context.items() }))) if (native_input.reproduced_encryption_context is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_DecryptMaterialsOutput(native_input): return DafnyDecryptMaterialsOutput( - decryptionMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - native_input.decryption_materials - ), + decryptionMaterials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(native_input.decryption_materials), ) - def aws_cryptography_materialproviders_OnEncryptInput(native_input): return DafnyOnEncryptInput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - native_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(native_input.materials), ) - def aws_cryptography_materialproviders_OnEncryptOutput(native_input): return DafnyOnEncryptOutput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - native_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(native_input.materials), ) - def aws_cryptography_materialproviders_OnDecryptInput(native_input): return DafnyOnDecryptInput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - native_input.materials - ), - encryptedDataKeys=Seq( - [ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptedDataKey( - list_element - ) - for list_element in native_input.encrypted_data_keys - ] - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(native_input.materials), + encryptedDataKeys=Seq([aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptedDataKey(list_element) for list_element in native_input.encrypted_data_keys]), ) - def aws_cryptography_materialproviders_OnDecryptOutput(native_input): return DafnyOnDecryptOutput( - materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - native_input.materials - ), + materials=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(native_input.materials), ) - def aws_cryptography_materialproviders_CreateAwsKmsKeyringInput(native_input): return DafnyCreateAwsKmsKeyringInput( - kmsKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.kms_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input.kms_client - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + kmsKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.kms_key_id.encode('utf-16-be'))]*2)])), + kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input.kms_client), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_CreateAwsKmsDiscoveryKeyringInput(native_input): return DafnyCreateAwsKmsDiscoveryKeyringInput( - kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input.kms_client - ), - discoveryFilter=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter( - native_input.discovery_filter - ) - ) - ) - if (native_input.discovery_filter is not None) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input.kms_client), + discoveryFilter=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter(native_input.discovery_filter))) if (native_input.discovery_filter is not None) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_DiscoveryFilter(native_input): return DafnyDiscoveryFilter( - accountIds=Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input.account_ids - ] - ), - partition=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.partition.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + accountIds=Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.account_ids]), + partition=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.partition.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviders_CreateAwsKmsMultiKeyringInput(native_input): return DafnyCreateAwsKmsMultiKeyringInput( - generator=( - ( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.generator.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - ) - if (native_input.generator is not None) - else (Option_None()) - ), - kmsKeyIds=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.kms_key_ids - ] - ) - ) - ) - if (native_input.kms_key_ids is not None) - else (Option_None()) - ), - clientSupplier=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - ) - ) - if ( - (native_input.client_supplier is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - is not None - ) - ) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + generator=((Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.generator.encode('utf-16-be'))]*2)])))) if (native_input.generator is not None) else (Option_None())), + kmsKeyIds=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.kms_key_ids]))) if (native_input.kms_key_ids is not None) else (Option_None())), + clientSupplier=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier))) if ((native_input.client_supplier is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier) is not None)) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_ClientSupplierReference(native_input): - if hasattr(native_input, "_impl"): + if hasattr(native_input, '_impl'): return native_input._impl else: return native_input - -def aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput( - native_input, -): +def aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput(native_input): return DafnyCreateAwsKmsDiscoveryMultiKeyringInput( - regions=Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input.regions - ] - ), - discoveryFilter=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter( - native_input.discovery_filter - ) - ) - ) - if (native_input.discovery_filter is not None) - else (Option_None()) - ), - clientSupplier=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - ) - ) - if ( - (native_input.client_supplier is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - is not None - ) - ) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + regions=Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.regions]), + discoveryFilter=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter(native_input.discovery_filter))) if (native_input.discovery_filter is not None) else (Option_None())), + clientSupplier=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier))) if ((native_input.client_supplier is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier) is not None)) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_CreateAwsKmsMrkKeyringInput(native_input): return DafnyCreateAwsKmsMrkKeyringInput( - kmsKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.kms_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input.kms_client - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + kmsKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.kms_key_id.encode('utf-16-be'))]*2)])), + kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input.kms_client), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_CreateAwsKmsMrkMultiKeyringInput(native_input): return DafnyCreateAwsKmsMrkMultiKeyringInput( - generator=( - ( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.generator.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - ) - if (native_input.generator is not None) - else (Option_None()) - ), - kmsKeyIds=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.kms_key_ids - ] - ) - ) - ) - if (native_input.kms_key_ids is not None) - else (Option_None()) - ), - clientSupplier=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - ) - ) - if ( - (native_input.client_supplier is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - is not None - ) - ) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + generator=((Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.generator.encode('utf-16-be'))]*2)])))) if (native_input.generator is not None) else (Option_None())), + kmsKeyIds=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.kms_key_ids]))) if (native_input.kms_key_ids is not None) else (Option_None())), + clientSupplier=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier))) if ((native_input.client_supplier is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier) is not None)) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - -def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput( - native_input, -): +def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput(native_input): return DafnyCreateAwsKmsMrkDiscoveryKeyringInput( - kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input.kms_client - ), - discoveryFilter=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter( - native_input.discovery_filter - ) - ) - ) - if (native_input.discovery_filter is not None) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), - region=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.region.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input.kms_client), + discoveryFilter=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter(native_input.discovery_filter))) if (native_input.discovery_filter is not None) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), + region=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.region.encode('utf-16-be'))]*2)])), ) - -def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput( - native_input, -): +def aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput(native_input): return DafnyCreateAwsKmsMrkDiscoveryMultiKeyringInput( - regions=Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input.regions - ] - ), - discoveryFilter=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter( - native_input.discovery_filter - ) - ) - ) - if (native_input.discovery_filter is not None) - else (Option_None()) - ), - clientSupplier=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - ) - ) - if ( - (native_input.client_supplier is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input.client_supplier - ) - is not None - ) - ) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + regions=Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.regions]), + discoveryFilter=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter(native_input.discovery_filter))) if (native_input.discovery_filter is not None) else (Option_None())), + clientSupplier=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier))) if ((native_input.client_supplier is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input.client_supplier) is not None)) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - -def aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput( - native_input, -): +def aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput(native_input): return DafnyCreateAwsKmsHierarchicalKeyringInput( - branchKeyId=( - ( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input.branch_key_id.encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - ) - if (native_input.branch_key_id is not None) - else (Option_None()) - ), - branchKeyIdSupplier=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_BranchKeyIdSupplierReference( - native_input.branch_key_id_supplier - ) - ) - ) - if ( - (native_input.branch_key_id_supplier is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_BranchKeyIdSupplierReference( - native_input.branch_key_id_supplier - ) - is not None - ) - ) - else (Option_None()) - ), - keyStore=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyStoreReference( - native_input.key_store - ), + branchKeyId=((Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.branch_key_id.encode('utf-16-be'))]*2)])))) if (native_input.branch_key_id is not None) else (Option_None())), + branchKeyIdSupplier=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_BranchKeyIdSupplierReference(native_input.branch_key_id_supplier))) if ((native_input.branch_key_id_supplier is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_BranchKeyIdSupplierReference(native_input.branch_key_id_supplier) is not None)) else (Option_None())), + keyStore=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyStoreReference(native_input.key_store), ttlSeconds=native_input.ttl_seconds, - cache=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CacheType( - native_input.cache - ) - ) - ) - if (native_input.cache is not None) - else (Option_None()) - ), - partitionId=( - ( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input.partition_id.encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - ) - if (native_input.partition_id is not None) - else (Option_None()) - ), + cache=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CacheType(native_input.cache))) if (native_input.cache is not None) else (Option_None())), + partitionId=((Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.partition_id.encode('utf-16-be'))]*2)])))) if (native_input.partition_id is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_BranchKeyIdSupplierReference(native_input): - if hasattr(native_input, "_impl"): + if hasattr(native_input, '_impl'): return native_input._impl else: return native_input - def aws_cryptography_materialproviders_KeyStoreReference(native_input): return native_input._config.dafnyImplInterface.impl - def aws_cryptography_materialproviders_CacheType(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeDefault, - ): - CacheType_union_value = CacheType_Default( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DefaultCache( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeNo, - ): - CacheType_union_value = CacheType_No( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_NoCache( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeSingleThreaded, - ): - CacheType_union_value = CacheType_SingleThreaded( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_SingleThreadedCache( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeMultiThreaded, - ): - CacheType_union_value = CacheType_MultiThreaded( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_MultiThreadedCache( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeStormTracking, - ): - CacheType_union_value = CacheType_StormTracking( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_StormTrackingCache( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeShared, - ): - CacheType_union_value = CacheType_Shared( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeDefault): + CacheType_union_value = CacheType_Default(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DefaultCache(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeNo): + CacheType_union_value = CacheType_No(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_NoCache(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeSingleThreaded): + CacheType_union_value = CacheType_SingleThreaded(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_SingleThreadedCache(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeMultiThreaded): + CacheType_union_value = CacheType_MultiThreaded(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_MultiThreadedCache(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeStormTracking): + CacheType_union_value = CacheType_StormTracking(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_StormTrackingCache(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CacheTypeShared): + CacheType_union_value = CacheType_Shared(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return CacheType_union_value - def aws_cryptography_materialproviders_DefaultCache(native_input): return DafnyDefaultCache( entryCapacity=native_input.entry_capacity, ) - def aws_cryptography_materialproviders_NoCache(native_input): - return DafnyNoCache() - + return DafnyNoCache( + ) def aws_cryptography_materialproviders_SingleThreadedCache(native_input): return DafnySingleThreadedCache( entryCapacity=native_input.entry_capacity, - entryPruningTailSize=( - (Option_Some(native_input.entry_pruning_tail_size)) - if (native_input.entry_pruning_tail_size is not None) - else (Option_None()) - ), + entryPruningTailSize=((Option_Some(native_input.entry_pruning_tail_size)) if (native_input.entry_pruning_tail_size is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_MultiThreadedCache(native_input): return DafnyMultiThreadedCache( entryCapacity=native_input.entry_capacity, - entryPruningTailSize=( - (Option_Some(native_input.entry_pruning_tail_size)) - if (native_input.entry_pruning_tail_size is not None) - else (Option_None()) - ), + entryPruningTailSize=((Option_Some(native_input.entry_pruning_tail_size)) if (native_input.entry_pruning_tail_size is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_StormTrackingCache(native_input): return DafnyStormTrackingCache( entryCapacity=native_input.entry_capacity, - entryPruningTailSize=( - (Option_Some(native_input.entry_pruning_tail_size)) - if (native_input.entry_pruning_tail_size is not None) - else (Option_None()) - ), + entryPruningTailSize=((Option_Some(native_input.entry_pruning_tail_size)) if (native_input.entry_pruning_tail_size is not None) else (Option_None())), gracePeriod=native_input.grace_period, graceInterval=native_input.grace_interval, fanOut=native_input.fan_out, @@ -1650,631 +618,234 @@ def aws_cryptography_materialproviders_StormTrackingCache(native_input): sleepMilli=native_input.sleep_milli, ) - -def aws_cryptography_materialproviders_CryptographicMaterialsCacheReference( - native_input, -): - if hasattr(native_input, "_impl"): +def aws_cryptography_materialproviders_CryptographicMaterialsCacheReference(native_input): + if hasattr(native_input, '_impl'): return native_input._impl else: return native_input - def aws_cryptography_materialproviders_CreateAwsKmsRsaKeyringInput(native_input): return DafnyCreateAwsKmsRsaKeyringInput( - publicKey=( - (Option_Some(Seq(native_input.public_key))) - if (native_input.public_key is not None) - else (Option_None()) - ), - kmsKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.kms_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - encryptionAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input.encryption_algorithm - ), - kmsClient=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input.kms_client - ) - ) - ) - if ( - (native_input.kms_client is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input.kms_client - ) - is not None - ) - ) - else (Option_None()) - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + publicKey=((Option_Some(Seq(native_input.public_key))) if (native_input.public_key is not None) else (Option_None())), + kmsKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.kms_key_id.encode('utf-16-be'))]*2)])), + encryptionAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input.encryption_algorithm), + kmsClient=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input.kms_client))) if ((native_input.kms_client is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input.kms_client) is not None)) else (Option_None())), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_CreateAwsKmsEcdhKeyringInput(native_input): return DafnyCreateAwsKmsEcdhKeyringInput( - KeyAgreementScheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsEcdhStaticConfigurations( - native_input.key_agreement_scheme - ), - curveSpec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.curve_spec - ), - kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference( - native_input.kms_client - ), - grantTokens=( - ( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - for list_element in native_input.grant_tokens - ] - ) - ) - ) - if (native_input.grant_tokens is not None) - else (Option_None()) - ), + KeyAgreementScheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsEcdhStaticConfigurations(native_input.key_agreement_scheme), + curveSpec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.curve_spec), + kmsClient=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsClientReference(native_input.kms_client), + grantTokens=((Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input.grant_tokens]))) if (native_input.grant_tokens is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_KmsEcdhStaticConfigurations(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery, - ): - KmsEcdhStaticConfigurations_union_value = KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsPublicKeyDiscoveryInput( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey, - ): - KmsEcdhStaticConfigurations_union_value = KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsPrivateKeyToStaticPublicKeyInput( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPublicKeyDiscovery): + KmsEcdhStaticConfigurations_union_value = KmsEcdhStaticConfigurations_KmsPublicKeyDiscovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsPublicKeyDiscoveryInput(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.KmsEcdhStaticConfigurationsKmsPrivateKeyToStaticPublicKey): + KmsEcdhStaticConfigurations_union_value = KmsEcdhStaticConfigurations_KmsPrivateKeyToStaticPublicKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KmsPrivateKeyToStaticPublicKeyInput(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return KmsEcdhStaticConfigurations_union_value - def aws_cryptography_materialproviders_KmsPublicKeyDiscoveryInput(native_input): return DafnyKmsPublicKeyDiscoveryInput( - recipientKmsIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input.recipient_kms_identifier.encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ), + recipientKmsIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.recipient_kms_identifier.encode('utf-16-be'))]*2)])), ) - -def aws_cryptography_materialproviders_KmsPrivateKeyToStaticPublicKeyInput( - native_input, -): +def aws_cryptography_materialproviders_KmsPrivateKeyToStaticPublicKeyInput(native_input): return DafnyKmsPrivateKeyToStaticPublicKeyInput( - senderKmsIdentifier=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.sender_kms_identifier.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - senderPublicKey=( - (Option_Some(Seq(native_input.sender_public_key))) - if (native_input.sender_public_key is not None) - else (Option_None()) - ), + senderKmsIdentifier=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.sender_kms_identifier.encode('utf-16-be'))]*2)])), + senderPublicKey=((Option_Some(Seq(native_input.sender_public_key))) if (native_input.sender_public_key is not None) else (Option_None())), recipientPublicKey=Seq(native_input.recipient_public_key), ) - def aws_cryptography_materialproviders_CreateMultiKeyringInput(native_input): return DafnyCreateMultiKeyringInput( - generator=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference( - native_input.generator - ) - ) - ) - if ( - (native_input.generator is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference( - native_input.generator - ) - is not None - ) - ) - else (Option_None()) - ), - childKeyrings=Seq( - [ - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference( - list_element - ) - for list_element in native_input.child_keyrings - ] - ), + generator=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference(native_input.generator))) if ((native_input.generator is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference(native_input.generator) is not None)) else (Option_None())), + childKeyrings=Seq([aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference(list_element) for list_element in native_input.child_keyrings]), ) - def aws_cryptography_materialproviders_KeyringReference(native_input): - if hasattr(native_input, "_impl"): + if hasattr(native_input, '_impl'): return native_input._impl else: return native_input - def aws_cryptography_materialproviders_CreateRawAesKeyringInput(native_input): return DafnyCreateRawAesKeyringInput( - keyNamespace=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_namespace.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - keyName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_name.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + keyNamespace=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_namespace.encode('utf-16-be'))]*2)])), + keyName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_name.encode('utf-16-be'))]*2)])), wrappingKey=Seq(native_input.wrapping_key), - wrappingAlg=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AesWrappingAlg( - native_input.wrapping_alg - ), + wrappingAlg=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AesWrappingAlg(native_input.wrapping_alg), ) - def aws_cryptography_materialproviders_AesWrappingAlg(native_input): - if native_input == "ALG_AES128_GCM_IV12_TAG16": + if native_input == 'ALG_AES128_GCM_IV12_TAG16': return AesWrappingAlg_ALG__AES128__GCM__IV12__TAG16() - elif native_input == "ALG_AES192_GCM_IV12_TAG16": + elif native_input == 'ALG_AES192_GCM_IV12_TAG16': return AesWrappingAlg_ALG__AES192__GCM__IV12__TAG16() - elif native_input == "ALG_AES256_GCM_IV12_TAG16": + elif native_input == 'ALG_AES256_GCM_IV12_TAG16': return AesWrappingAlg_ALG__AES256__GCM__IV12__TAG16() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_materialproviders_CreateRawRsaKeyringInput(native_input): return DafnyCreateRawRsaKeyringInput( - keyNamespace=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_namespace.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - keyName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_name.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - paddingScheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PaddingScheme( - native_input.padding_scheme - ), - publicKey=( - (Option_Some(Seq(native_input.public_key))) - if (native_input.public_key is not None) - else (Option_None()) - ), - privateKey=( - (Option_Some(Seq(native_input.private_key))) - if (native_input.private_key is not None) - else (Option_None()) - ), + keyNamespace=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_namespace.encode('utf-16-be'))]*2)])), + keyName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_name.encode('utf-16-be'))]*2)])), + paddingScheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PaddingScheme(native_input.padding_scheme), + publicKey=((Option_Some(Seq(native_input.public_key))) if (native_input.public_key is not None) else (Option_None())), + privateKey=((Option_Some(Seq(native_input.private_key))) if (native_input.private_key is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_PaddingScheme(native_input): - if native_input == "PKCS1": + if native_input == 'PKCS1': return PaddingScheme_PKCS1() - elif native_input == "OAEP_SHA1_MGF1": + elif native_input == 'OAEP_SHA1_MGF1': return PaddingScheme_OAEP__SHA1__MGF1() - elif native_input == "OAEP_SHA256_MGF1": + elif native_input == 'OAEP_SHA256_MGF1': return PaddingScheme_OAEP__SHA256__MGF1() - elif native_input == "OAEP_SHA384_MGF1": + elif native_input == 'OAEP_SHA384_MGF1': return PaddingScheme_OAEP__SHA384__MGF1() - elif native_input == "OAEP_SHA512_MGF1": + elif native_input == 'OAEP_SHA512_MGF1': return PaddingScheme_OAEP__SHA512__MGF1() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_materialproviders_CreateRawEcdhKeyringInput(native_input): return DafnyCreateRawEcdhKeyringInput( - KeyAgreementScheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_RawEcdhStaticConfigurations( - native_input.key_agreement_scheme - ), - curveSpec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.curve_spec - ), + KeyAgreementScheme=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_RawEcdhStaticConfigurations(native_input.key_agreement_scheme), + curveSpec=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.curve_spec), ) - def aws_cryptography_materialproviders_RawEcdhStaticConfigurations(native_input): - if isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsPublicKeyDiscovery, - ): - RawEcdhStaticConfigurations_union_value = RawEcdhStaticConfigurations_PublicKeyDiscovery( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PublicKeyDiscoveryInput( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey, - ): - RawEcdhStaticConfigurations_union_value = RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_RawPrivateKeyToStaticPublicKeyInput( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey, - ): - RawEcdhStaticConfigurations_union_value = RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsPublicKeyDiscovery): + RawEcdhStaticConfigurations_union_value = RawEcdhStaticConfigurations_PublicKeyDiscovery(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PublicKeyDiscoveryInput(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsRawPrivateKeyToStaticPublicKey): + RawEcdhStaticConfigurations_union_value = RawEcdhStaticConfigurations_RawPrivateKeyToStaticPublicKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_RawPrivateKeyToStaticPublicKeyInput(native_input.value)) + elif isinstance(native_input, aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.RawEcdhStaticConfigurationsEphemeralPrivateKeyToStaticPublicKey): + RawEcdhStaticConfigurations_union_value = RawEcdhStaticConfigurations_EphemeralPrivateKeyToStaticPublicKey(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return RawEcdhStaticConfigurations_union_value - def aws_cryptography_materialproviders_PublicKeyDiscoveryInput(native_input): return DafnyPublicKeyDiscoveryInput( recipientStaticPrivateKey=Seq(native_input.recipient_static_private_key), ) - -def aws_cryptography_materialproviders_RawPrivateKeyToStaticPublicKeyInput( - native_input, -): +def aws_cryptography_materialproviders_RawPrivateKeyToStaticPublicKeyInput(native_input): return DafnyRawPrivateKeyToStaticPublicKeyInput( senderStaticPrivateKey=Seq(native_input.sender_static_private_key), recipientPublicKey=Seq(native_input.recipient_public_key), ) - -def aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput( - native_input, -): +def aws_cryptography_materialproviders_EphemeralPrivateKeyToStaticPublicKeyInput(native_input): return DafnyEphemeralPrivateKeyToStaticPublicKeyInput( recipientPublicKey=Seq(native_input.recipient_public_key), ) - -def aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput( - native_input, -): +def aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput(native_input): return DafnyCreateDefaultCryptographicMaterialsManagerInput( - keyring=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference( - native_input.keyring - ), + keyring=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference(native_input.keyring), ) - -def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput( - native_input, -): +def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput(native_input): return DafnyCreateRequiredEncryptionContextCMMInput( - underlyingCMM=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - native_input.underlying_cmm - ) - ) - ) - if ( - (native_input.underlying_cmm is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - native_input.underlying_cmm - ) - is not None - ) - ) - else (Option_None()) - ), - keyring=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference( - native_input.keyring - ) - ) - ) - if ( - (native_input.keyring is not None) - and ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference( - native_input.keyring - ) - is not None - ) - ) - else (Option_None()) - ), - requiredEncryptionContextKeys=Seq( - [ - Seq(list_element.encode("utf-8")) - for list_element in native_input.required_encryption_context_keys - ] - ), + underlyingCMM=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(native_input.underlying_cmm))) if ((native_input.underlying_cmm is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(native_input.underlying_cmm) is not None)) else (Option_None())), + keyring=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference(native_input.keyring))) if ((native_input.keyring is not None) and (aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference(native_input.keyring) is not None)) else (Option_None())), + requiredEncryptionContextKeys=Seq([Seq(list_element.encode('utf-8')) for list_element in native_input.required_encryption_context_keys]), ) - -def aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - native_input, -): - if hasattr(native_input, "_impl"): +def aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(native_input): + if hasattr(native_input, '_impl'): return native_input._impl else: return native_input - -def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput( - native_input, -): +def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput(native_input): return DafnyCreateCryptographicMaterialsCacheInput( - cache=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CacheType( - native_input.cache - ), + cache=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CacheType(native_input.cache), ) - def aws_cryptography_materialproviders_CreateDefaultClientSupplierInput(native_input): - return DafnyCreateDefaultClientSupplierInput() - + return DafnyCreateDefaultClientSupplierInput( + ) def aws_cryptography_materialproviders_InitializeEncryptionMaterialsInput(native_input): return DafnyInitializeEncryptionMaterialsInput( - algorithmSuiteId=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId( - native_input.algorithm_suite_id - ), - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), - requiredEncryptionContextKeys=Seq( - [ - Seq(list_element.encode("utf-8")) - for list_element in native_input.required_encryption_context_keys - ] - ), - signingKey=( - (Option_Some(Seq(native_input.signing_key))) - if (native_input.signing_key is not None) - else (Option_None()) - ), - verificationKey=( - (Option_Some(Seq(native_input.verification_key))) - if (native_input.verification_key is not None) - else (Option_None()) - ), + algorithmSuiteId=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId(native_input.algorithm_suite_id), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), + requiredEncryptionContextKeys=Seq([Seq(list_element.encode('utf-8')) for list_element in native_input.required_encryption_context_keys]), + signingKey=((Option_Some(Seq(native_input.signing_key))) if (native_input.signing_key is not None) else (Option_None())), + verificationKey=((Option_Some(Seq(native_input.verification_key))) if (native_input.verification_key is not None) else (Option_None())), ) - def aws_cryptography_materialproviders_InitializeDecryptionMaterialsInput(native_input): return DafnyInitializeDecryptionMaterialsInput( - algorithmSuiteId=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId( - native_input.algorithm_suite_id - ), - encryptionContext=Map( - { - Seq(key.encode("utf-8")): Seq(value.encode("utf-8")) - for (key, value) in native_input.encryption_context.items() - } - ), - requiredEncryptionContextKeys=Seq( - [ - Seq(list_element.encode("utf-8")) - for list_element in native_input.required_encryption_context_keys - ] - ), + algorithmSuiteId=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId(native_input.algorithm_suite_id), + encryptionContext=Map({Seq(key.encode('utf-8')): Seq(value.encode('utf-8')) for (key, value) in native_input.encryption_context.items() }), + requiredEncryptionContextKeys=Seq([Seq(list_element.encode('utf-8')) for list_element in native_input.required_encryption_context_keys]), ) - -def aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput( - native_input, -): +def aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput(native_input): return DafnyValidEncryptionMaterialsTransitionInput( - start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - native_input.start - ), - stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - native_input.stop - ), + start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(native_input.start), + stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(native_input.stop), ) - -def aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput( - native_input, -): +def aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput(native_input): return DafnyValidDecryptionMaterialsTransitionInput( - start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - native_input.start - ), - stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - native_input.stop - ), + start=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(native_input.start), + stop=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(native_input.stop), ) - def aws_cryptography_materialproviders_GetAlgorithmSuiteInfoInput(native_input): return Seq(native_input) - -def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput( - native_input, -): +def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput(native_input): return DafnyValidateCommitmentPolicyOnEncryptInput( - algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId( - native_input.algorithm - ), - commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy( - native_input.commitment_policy - ), + algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId(native_input.algorithm), + commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy(native_input.commitment_policy), ) - -def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput( - native_input, -): +def aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput(native_input): return DafnyValidateCommitmentPolicyOnDecryptInput( - algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId( - native_input.algorithm - ), - commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy( - native_input.commitment_policy - ), + algorithm=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteId(native_input.algorithm), + commitmentPolicy=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CommitmentPolicy(native_input.commitment_policy), ) - def aws_cryptography_materialproviders_CreateKeyringOutput(native_input): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference( - native_input - ) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_KeyringReference(native_input) +def aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput(native_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(native_input) -def aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput( - native_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - native_input - ) - - -def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput( - native_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - native_input - ) - - -def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput( - native_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference( - native_input - ) +def aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput(native_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(native_input) +def aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput(native_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsCacheReference(native_input) def aws_cryptography_materialproviders_CreateDefaultClientSupplierOutput(native_input): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference( - native_input - ) - + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_ClientSupplierReference(native_input) def aws_cryptography_materialproviders_MaterialProvidersConfig(native_input): - return DafnyMaterialProvidersConfig() + return DafnyMaterialProvidersConfig( + ) diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/__init__.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/__init__.py index 09be6133b..89d64801a 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/__init__.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/__init__.py @@ -1,3 +1,4 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. + diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/client.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/client.py index 34f26b828..bf468ba74 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/client.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/client.py @@ -110,17 +110,15 @@ Input = TypeVar("Input") Output = TypeVar("Output") - class AwsCryptographicPrimitives: - """Client for AwsCryptographicPrimitives. + """Client for AwsCryptographicPrimitives :param config: Configuration for the client. """ - def __init__( self, config: CryptoConfig | None = None, - dafny_client: IAwsCryptographicPrimitivesClient | None = None, + dafny_client: IAwsCryptographicPrimitivesClient | None = None ): if config is None: self._config = Config() @@ -137,9 +135,7 @@ def __init__( if dafny_client is not None: self._config.dafnyImplInterface.impl = dafny_client - def generate_random_bytes( - self, input: GenerateRandomBytesInput - ) -> bytes | bytearray: + def generate_random_bytes(self, input: GenerateRandomBytesInput) -> bytes | bytearray: """Invokes the GenerateRandomBytes operation. :param input: The operation's input. @@ -279,9 +275,7 @@ def aes_decrypt(self, input: AESDecryptInput) -> bytes | bytearray: operation_name="AESDecrypt", ) - def generate_rsa_key_pair( - self, input: GenerateRSAKeyPairInput - ) -> GenerateRSAKeyPairOutput: + def generate_rsa_key_pair(self, input: GenerateRSAKeyPairInput) -> GenerateRSAKeyPairOutput: """Invokes the GenerateRSAKeyPair operation. :param input: The operation's input. @@ -295,9 +289,7 @@ def generate_rsa_key_pair( operation_name="GenerateRSAKeyPair", ) - def get_rsa_key_modulus_length( - self, input: GetRSAKeyModulusLengthInput - ) -> GetRSAKeyModulusLengthOutput: + def get_rsa_key_modulus_length(self, input: GetRSAKeyModulusLengthInput) -> GetRSAKeyModulusLengthOutput: """Invokes the GetRSAKeyModulusLength operation. :param input: The operation's input. @@ -339,9 +331,7 @@ def rsa_encrypt(self, input: RSAEncryptInput) -> bytes | bytearray: operation_name="RSAEncrypt", ) - def generate_ecdsa_signature_key( - self, input: GenerateECDSASignatureKeyInput - ) -> GenerateECDSASignatureKeyOutput: + def generate_ecdsa_signature_key(self, input: GenerateECDSASignatureKeyInput) -> GenerateECDSASignatureKeyOutput: """Invokes the GenerateECDSASignatureKey operation. :param input: The operation's input. @@ -383,9 +373,7 @@ def ecdsa_verify(self, input: ECDSAVerifyInput) -> bool: operation_name="ECDSAVerify", ) - def generate_ecc_key_pair( - self, input: GenerateECCKeyPairInput - ) -> GenerateECCKeyPairOutput: + def generate_ecc_key_pair(self, input: GenerateECCKeyPairInput) -> GenerateECCKeyPairOutput: """Invokes the GenerateECCKeyPair operation. :param input: The operation's input. @@ -399,9 +387,7 @@ def generate_ecc_key_pair( operation_name="GenerateECCKeyPair", ) - def get_public_key_from_private_key( - self, input: GetPublicKeyFromPrivateKeyInput - ) -> GetPublicKeyFromPrivateKeyOutput: + def get_public_key_from_private_key(self, input: GetPublicKeyFromPrivateKeyInput) -> GetPublicKeyFromPrivateKeyOutput: """Invokes the GetPublicKeyFromPrivateKey operation. :param input: The operation's input. @@ -415,9 +401,7 @@ def get_public_key_from_private_key( operation_name="GetPublicKeyFromPrivateKey", ) - def validate_public_key( - self, input: ValidatePublicKeyInput - ) -> ValidatePublicKeyOutput: + def validate_public_key(self, input: ValidatePublicKeyInput) -> ValidatePublicKeyOutput: """Invokes the ValidatePublicKey operation. :param input: The operation's input. @@ -431,9 +415,7 @@ def validate_public_key( operation_name="ValidatePublicKey", ) - def derive_shared_secret( - self, input: DeriveSharedSecretInput - ) -> DeriveSharedSecretOutput: + def derive_shared_secret(self, input: DeriveSharedSecretInput) -> DeriveSharedSecretOutput: """Invokes the DeriveSharedSecret operation. :param input: The operation's input. @@ -447,9 +429,7 @@ def derive_shared_secret( operation_name="DeriveSharedSecret", ) - def compress_public_key( - self, input: CompressPublicKeyInput - ) -> CompressPublicKeyOutput: + def compress_public_key(self, input: CompressPublicKeyInput) -> CompressPublicKeyOutput: """Invokes the CompressPublicKey operation. :param input: The operation's input. @@ -463,9 +443,7 @@ def compress_public_key( operation_name="CompressPublicKey", ) - def decompress_public_key( - self, input: DecompressPublicKeyInput - ) -> DecompressPublicKeyOutput: + def decompress_public_key(self, input: DecompressPublicKeyInput) -> DecompressPublicKeyOutput: """Invokes the DecompressPublicKey operation. :param input: The operation's input. @@ -530,8 +508,7 @@ def _handle_execution( ) _client_interceptors = config.interceptors client_interceptors = cast( - list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - _client_interceptors, + list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], _client_interceptors ) interceptors = client_interceptors @@ -614,7 +591,7 @@ def _handle_execution( error_info=RetryErrorInfo( # TODO: Determine the error type. error_type=RetryErrorType.CLIENT_ERROR, - ), + ) ) except SmithyRetryException: raise context_with_response.response @@ -629,10 +606,7 @@ def _handle_execution( # The response will be set either with the modeled output or an exception. The # transport_request and transport_response may be set or None. execution_context = cast( - InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], - context, + InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], context ) return self._finalize_execution(interceptors, execution_context) @@ -657,10 +631,8 @@ def _handle_attempt( InterceptorContext[Input, None, DafnyRequest, DafnyResponse], context ) - context_with_response._transport_response = ( - config.dafnyImplInterface.handle_request( - input=context_with_response.transport_request - ) + context_with_response._transport_response = config.dafnyImplInterface.handle_request( + input=context_with_response.transport_request ) # Step 7n: Invoke read_after_transmit @@ -697,8 +669,7 @@ def _handle_attempt( # None. This will also be true after _finalize_attempt because there is no opportunity # there to set the transport_response. attempt_context = cast( - InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], - context, + InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], context ) return self._finalize_attempt(interceptors, attempt_context) @@ -728,9 +699,7 @@ def _finalize_attempt( def _finalize_execution( self, interceptors: list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - context: InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], + context: InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], ) -> Output: try: # Step 9: Invoke modify_before_completion diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/config.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/config.py index 58319c282..9d29721f6 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/config.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/config.py @@ -17,8 +17,6 @@ _ServiceInterceptor = Any - - @dataclass(init=False) class Config: """Configuration for AwsCryptographicPrimitives.""" @@ -36,35 +34,40 @@ def __init__( ): """Constructor. - :param interceptors: The list of interceptors, which are hooks - that are called during the execution of a request. - :param retry_strategy: The retry strategy for issuing retry - tokens and computing retry delays. + :param interceptors: The list of interceptors, which are hooks that are called + during the execution of a request. + + :param retry_strategy: The retry strategy for issuing retry tokens and computing + retry delays. + :param dafnyImplInterface: """ self.interceptors = interceptors or [] self.retry_strategy = retry_strategy or SimpleRetryStrategy() self.dafnyImplInterface = dafnyImplInterface - # A callable that allows customizing the config object on each request. Plugin: TypeAlias = Callable[[Config], None] - class CryptoConfig(Config): def __init__( self, ): - """Constructor for CryptoConfig.""" + """Constructor for CryptoConfig + """ super().__init__() def as_dict(self) -> Dict[str, Any]: - """Converts the CryptoConfig to a dictionary.""" + """Converts the CryptoConfig to a dictionary. + + """ return {} @staticmethod def from_dict(d: Dict[str, Any]) -> "CryptoConfig": - """Creates a CryptoConfig from a dictionary.""" + """Creates a CryptoConfig from a dictionary. + + """ return CryptoConfig() def __repr__(self) -> str: @@ -75,18 +78,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: return isinstance(other, CryptoConfig) - def dafny_config_to_smithy_config(dafny_config) -> CryptoConfig: - """Converts the provided Dafny shape for this localService's config into - the corresponding Smithy-modelled shape.""" - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_CryptoConfig( - dafny_config - ) - + """ + Converts the provided Dafny shape for this localService's config + into the corresponding Smithy-modelled shape. + """ + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_CryptoConfig(dafny_config) def smithy_config_to_dafny_config(smithy_config) -> DafnyCryptoConfig: - """Converts the provided Smithy-modelled shape for this localService's - config into the corresponding Dafny shape.""" - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_CryptoConfig( - smithy_config - ) + """ + Converts the provided Smithy-modelled shape for this localService's config + into the corresponding Dafny shape. + """ + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_CryptoConfig(smithy_config) diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafnyImplInterface.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafnyImplInterface.py index 97262b1c6..78d4dc634 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafnyImplInterface.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafnyImplInterface.py @@ -2,12 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. -from aws_cryptography_primitives.internaldafny.generated.AtomicPrimitives import ( - AtomicPrimitivesClient, -) +from aws_cryptography_primitives.internaldafny.generated.AtomicPrimitives import AtomicPrimitivesClient from .dafny_protocol import DafnyRequest - class DafnyImplInterface: impl: AtomicPrimitivesClient | None = None @@ -47,9 +44,9 @@ def handle_request(self, input: DafnyRequest): "ParsePublicKey": self.impl.ParsePublicKey, } - # This logic is where a typical Smithy client would expect the "server" to be. - # This code can be thought of as logic our Dafny "server" uses - # to route incoming client requests to the correct request handler code. + # This logic is where a typical Smithy client would expect the "server" to be. + # This code can be thought of as logic our Dafny "server" uses + # to route incoming client requests to the correct request handler code. if input.dafny_operation_input is None: return self.operation_map[input.operation_name]() else: diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_protocol.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_protocol.py index cc3901213..053fb1afa 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_protocol.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_protocol.py @@ -34,7 +34,6 @@ import smithy_dafny_standard_library.internaldafny.generated.Wrappers as Wrappers from typing import Union - class DafnyRequest: operation_name: str @@ -71,7 +70,6 @@ def __init__(self, operation_name, dafny_operation_input): self.operation_name = operation_name self.dafny_operation_input = dafny_operation_input - class DafnyResponse(Wrappers.Result): def __init__(self): super().__init__(self) diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_to_smithy.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_to_smithy.py index 5f3d1b3ff..7e600182c 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_to_smithy.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/dafny_to_smithy.py @@ -28,89 +28,65 @@ def aws_cryptography_primitives_GenerateRandomBytesInput(dafny_input): length=dafny_input.length, ) - def aws_cryptography_primitives_DigestAlgorithm(dafny_input): if isinstance(dafny_input, DigestAlgorithm_SHA__512): - return "SHA_512" + return 'SHA_512' elif isinstance(dafny_input, DigestAlgorithm_SHA__384): - return "SHA_384" + return 'SHA_384' elif isinstance(dafny_input, DigestAlgorithm_SHA__256): - return "SHA_256" + return 'SHA_256' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_primitives_DigestInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.DigestInput( - digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.digestAlgorithm - ), + digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.digestAlgorithm), message=bytes(dafny_input.message), ) - def aws_cryptography_primitives_HMacInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.HMacInput( - digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.digestAlgorithm - ), + digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.digestAlgorithm), key=bytes(dafny_input.key), message=bytes(dafny_input.message), ) - def aws_cryptography_primitives_HkdfExtractInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.HkdfExtractInput( - digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.digestAlgorithm - ), + digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.digestAlgorithm), salt=(bytes(dafny_input.salt.value)) if (dafny_input.salt.is_Some) else None, ikm=bytes(dafny_input.ikm), ) - def aws_cryptography_primitives_HkdfExpandInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.HkdfExpandInput( - digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.digestAlgorithm - ), + digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.digestAlgorithm), prk=bytes(dafny_input.prk), info=bytes(dafny_input.info), expected_length=dafny_input.expectedLength, ) - def aws_cryptography_primitives_HkdfInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.HkdfInput( - digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.digestAlgorithm - ), + digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.digestAlgorithm), salt=(bytes(dafny_input.salt.value)) if (dafny_input.salt.is_Some) else None, ikm=bytes(dafny_input.ikm), info=bytes(dafny_input.info), expected_length=dafny_input.expectedLength, ) - def aws_cryptography_primitives_KdfCtrInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.KdfCtrInput( - digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm( - dafny_input.digestAlgorithm - ), + digest_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestAlgorithm(dafny_input.digestAlgorithm), ikm=bytes(dafny_input.ikm), expected_length=dafny_input.expectedLength, - purpose=( - (bytes(dafny_input.purpose.value)) - if (dafny_input.purpose.is_Some) - else None - ), + purpose=(bytes(dafny_input.purpose.value)) if (dafny_input.purpose.is_Some) else None, nonce=(bytes(dafny_input.nonce.value)) if (dafny_input.nonce.is_Some) else None, ) - def aws_cryptography_primitives_AesKdfCtrInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.AesKdfCtrInput( ikm=bytes(dafny_input.ikm), @@ -118,7 +94,6 @@ def aws_cryptography_primitives_AesKdfCtrInput(dafny_input): nonce=(bytes(dafny_input.nonce.value)) if (dafny_input.nonce.is_Some) else None, ) - def aws_cryptography_primitives_AES_GCM(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.AES_GCM( key_length=dafny_input.keyLength, @@ -126,24 +101,18 @@ def aws_cryptography_primitives_AES_GCM(dafny_input): iv_length=dafny_input.ivLength, ) - def aws_cryptography_primitives_AESEncryptInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.AESEncryptInput( - enc_alg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AES_GCM( - dafny_input.encAlg - ), + enc_alg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AES_GCM(dafny_input.encAlg), iv=bytes(dafny_input.iv), key=bytes(dafny_input.key), msg=bytes(dafny_input.msg), aad=bytes(dafny_input.aad), ) - def aws_cryptography_primitives_AESDecryptInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.AESDecryptInput( - enc_alg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AES_GCM( - dafny_input.encAlg - ), + enc_alg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AES_GCM(dafny_input.encAlg), key=bytes(dafny_input.key), cipher_txt=bytes(dafny_input.cipherTxt), auth_tag=bytes(dafny_input.authTag), @@ -151,360 +120,262 @@ def aws_cryptography_primitives_AESDecryptInput(dafny_input): aad=bytes(dafny_input.aad), ) - def aws_cryptography_primitives_GenerateRSAKeyPairInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GenerateRSAKeyPairInput( length_bits=dafny_input.lengthBits, ) - def aws_cryptography_primitives_GetRSAKeyModulusLengthInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GetRSAKeyModulusLengthInput( public_key=bytes(dafny_input.publicKey), ) - def aws_cryptography_primitives_RSAPaddingMode(dafny_input): if isinstance(dafny_input, RSAPaddingMode_PKCS1): - return "PKCS1" + return 'PKCS1' elif isinstance(dafny_input, RSAPaddingMode_OAEP__SHA1): - return "OAEP_SHA1" + return 'OAEP_SHA1' elif isinstance(dafny_input, RSAPaddingMode_OAEP__SHA256): - return "OAEP_SHA256" + return 'OAEP_SHA256' elif isinstance(dafny_input, RSAPaddingMode_OAEP__SHA384): - return "OAEP_SHA384" + return 'OAEP_SHA384' elif isinstance(dafny_input, RSAPaddingMode_OAEP__SHA512): - return "OAEP_SHA512" + return 'OAEP_SHA512' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_primitives_RSADecryptInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.RSADecryptInput( - padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPaddingMode( - dafny_input.padding - ), + padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPaddingMode(dafny_input.padding), private_key=bytes(dafny_input.privateKey), cipher_text=bytes(dafny_input.cipherText), ) - def aws_cryptography_primitives_RSAEncryptInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.RSAEncryptInput( - padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPaddingMode( - dafny_input.padding - ), + padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPaddingMode(dafny_input.padding), public_key=bytes(dafny_input.publicKey), plaintext=bytes(dafny_input.plaintext), ) - def aws_cryptography_primitives_ECDSASignatureAlgorithm(dafny_input): if isinstance(dafny_input, ECDSASignatureAlgorithm_ECDSA__P384): - return "ECDSA_P384" + return 'ECDSA_P384' elif isinstance(dafny_input, ECDSASignatureAlgorithm_ECDSA__P256): - return "ECDSA_P256" + return 'ECDSA_P256' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_primitives_GenerateECDSASignatureKeyInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GenerateECDSASignatureKeyInput( - signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm( - dafny_input.signatureAlgorithm - ), + signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm(dafny_input.signatureAlgorithm), ) - def aws_cryptography_primitives_ECDSASignInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ECDSASignInput( - signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm( - dafny_input.signatureAlgorithm - ), + signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm(dafny_input.signatureAlgorithm), signing_key=bytes(dafny_input.signingKey), message=bytes(dafny_input.message), ) - def aws_cryptography_primitives_ECDSAVerifyInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ECDSAVerifyInput( - signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm( - dafny_input.signatureAlgorithm - ), + signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm(dafny_input.signatureAlgorithm), verification_key=bytes(dafny_input.verificationKey), message=bytes(dafny_input.message), signature=bytes(dafny_input.signature), ) - def aws_cryptography_primitives_ECDHCurveSpec(dafny_input): if isinstance(dafny_input, ECDHCurveSpec_ECC__NIST__P256): - return "ECC_NIST_P256" + return 'ECC_NIST_P256' elif isinstance(dafny_input, ECDHCurveSpec_ECC__NIST__P384): - return "ECC_NIST_P384" + return 'ECC_NIST_P384' elif isinstance(dafny_input, ECDHCurveSpec_ECC__NIST__P521): - return "ECC_NIST_P521" + return 'ECC_NIST_P521' elif isinstance(dafny_input, ECDHCurveSpec_SM2): - return "SM2" + return 'SM2' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_primitives_GenerateECCKeyPairInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GenerateECCKeyPairInput( - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), ) - def aws_cryptography_primitives_ECCPrivateKey(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ECCPrivateKey( pem=bytes(dafny_input.pem), ) - def aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GetPublicKeyFromPrivateKeyInput( - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), - private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey( - dafny_input.privateKey - ), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), + private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey(dafny_input.privateKey), ) - def aws_cryptography_primitives_ValidatePublicKeyInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ValidatePublicKeyInput( - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), public_key=bytes(dafny_input.publicKey), ) - def aws_cryptography_primitives_ECCPublicKey(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ECCPublicKey( der=bytes(dafny_input.der), ) - def aws_cryptography_primitives_DeriveSharedSecretInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.DeriveSharedSecretInput( - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), - private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey( - dafny_input.privateKey - ), - public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey( - dafny_input.publicKey - ), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), + private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey(dafny_input.privateKey), + public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey(dafny_input.publicKey), ) - def aws_cryptography_primitives_CompressPublicKeyInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.CompressPublicKeyInput( - public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey( - dafny_input.publicKey - ), - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), + public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey(dafny_input.publicKey), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), ) - def aws_cryptography_primitives_DecompressPublicKeyInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.DecompressPublicKeyInput( compressed_public_key=bytes(dafny_input.compressedPublicKey), - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), ) - def aws_cryptography_primitives_ParsePublicKeyInput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ParsePublicKeyInput( public_key=bytes(dafny_input.publicKey), ) - def aws_cryptography_primitives_GenerateRandomBytesOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_DigestOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_HMacOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_HkdfExtractOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_HkdfExpandOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_HkdfOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_KdfCtrOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_AesKdfCtrOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_AESEncryptOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.AESEncryptOutput( cipher_text=bytes(dafny_input.cipherText), auth_tag=bytes(dafny_input.authTag), ) - def aws_cryptography_primitives_AESDecryptOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_RSAPublicKey(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.RSAPublicKey( length_bits=dafny_input.lengthBits, pem=bytes(dafny_input.pem), ) - def aws_cryptography_primitives_RSAPrivateKey(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.RSAPrivateKey( length_bits=dafny_input.lengthBits, pem=bytes(dafny_input.pem), ) - def aws_cryptography_primitives_GenerateRSAKeyPairOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GenerateRSAKeyPairOutput( - public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPublicKey( - dafny_input.publicKey - ), - private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPrivateKey( - dafny_input.privateKey - ), + public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPublicKey(dafny_input.publicKey), + private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAPrivateKey(dafny_input.privateKey), ) - def aws_cryptography_primitives_GetRSAKeyModulusLengthOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GetRSAKeyModulusLengthOutput( length=dafny_input.length, ) - def aws_cryptography_primitives_RSADecryptOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_RSAEncryptOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_GenerateECDSASignatureKeyOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GenerateECDSASignatureKeyOutput( - signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm( - dafny_input.signatureAlgorithm - ), + signature_algorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignatureAlgorithm(dafny_input.signatureAlgorithm), verification_key=bytes(dafny_input.verificationKey), signing_key=bytes(dafny_input.signingKey), ) - def aws_cryptography_primitives_ECDSASignOutput(dafny_input): return bytes(dafny_input) - def aws_cryptography_primitives_ECDSAVerifyOutput(dafny_input): return dafny_input - def aws_cryptography_primitives_GenerateECCKeyPairOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GenerateECCKeyPairOutput( - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), - private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey( - dafny_input.privateKey - ), - public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey( - dafny_input.publicKey - ), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), + private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey(dafny_input.privateKey), + public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey(dafny_input.publicKey), ) - def aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.GetPublicKeyFromPrivateKeyOutput( - ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec( - dafny_input.eccCurve - ), - private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey( - dafny_input.privateKey - ), + ecc_curve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDHCurveSpec(dafny_input.eccCurve), + private_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPrivateKey(dafny_input.privateKey), public_key=bytes(dafny_input.publicKey), ) - def aws_cryptography_primitives_ValidatePublicKeyOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ValidatePublicKeyOutput( success=dafny_input.success, ) - def aws_cryptography_primitives_DeriveSharedSecretOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.DeriveSharedSecretOutput( shared_secret=bytes(dafny_input.sharedSecret), ) - def aws_cryptography_primitives_CompressPublicKeyOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.CompressPublicKeyOutput( compressed_public_key=bytes(dafny_input.compressedPublicKey), ) - def aws_cryptography_primitives_DecompressPublicKeyOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.DecompressPublicKeyOutput( - public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey( - dafny_input.publicKey - ), + public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey(dafny_input.publicKey), ) - def aws_cryptography_primitives_ParsePublicKeyOutput(dafny_input): return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.models.ParsePublicKeyOutput( - public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey( - dafny_input.publicKey - ), + public_key=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECCPublicKey(dafny_input.publicKey), ) - def aws_cryptography_primitives_CryptoConfig(dafny_input): # Deferred import of .config to avoid circular dependency import aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.config - - return ( - aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.config.CryptoConfig() + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.config.CryptoConfig( ) diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/deserialize.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/deserialize.py index 55a69a59d..574cd0032 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/deserialize.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/deserialize.py @@ -35,219 +35,147 @@ def _deserialize_generate_random_bytes(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateRandomBytesOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateRandomBytesOutput(input.value) def _deserialize_digest(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DigestOutput(input.value) def _deserialize_h_mac(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HMacOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HMacOutput(input.value) def _deserialize_hkdf_extract(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HkdfExtractOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HkdfExtractOutput(input.value) def _deserialize_hkdf_expand(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HkdfExpandOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HkdfExpandOutput(input.value) def _deserialize_hkdf(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HkdfOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_HkdfOutput(input.value) def _deserialize_kdf_counter_mode(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_KdfCtrOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_KdfCtrOutput(input.value) def _deserialize_aes_kdf_counter_mode(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AesKdfCtrOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AesKdfCtrOutput(input.value) def _deserialize_aes_encrypt(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AESEncryptOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AESEncryptOutput(input.value) def _deserialize_aes_decrypt(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AESDecryptOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_AESDecryptOutput(input.value) def _deserialize_generate_rsa_key_pair(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateRSAKeyPairOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateRSAKeyPairOutput(input.value) def _deserialize_get_rsa_key_modulus_length(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GetRSAKeyModulusLengthOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GetRSAKeyModulusLengthOutput(input.value) def _deserialize_rsa_decrypt(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSADecryptOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSADecryptOutput(input.value) def _deserialize_rsa_encrypt(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAEncryptOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_RSAEncryptOutput(input.value) def _deserialize_generate_ecdsa_signature_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateECDSASignatureKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateECDSASignatureKeyOutput(input.value) def _deserialize_ecdsa_sign(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSASignOutput(input.value) def _deserialize_ecdsa_verify(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSAVerifyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ECDSAVerifyOutput(input.value) def _deserialize_generate_ecc_key_pair(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateECCKeyPairOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GenerateECCKeyPairOutput(input.value) def _deserialize_get_public_key_from_private_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput(input.value) def _deserialize_validate_public_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ValidatePublicKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ValidatePublicKeyOutput(input.value) def _deserialize_derive_shared_secret(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DeriveSharedSecretOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DeriveSharedSecretOutput(input.value) def _deserialize_compress_public_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_CompressPublicKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_CompressPublicKeyOutput(input.value) def _deserialize_decompress_public_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DecompressPublicKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_DecompressPublicKeyOutput(input.value) def _deserialize_parse_public_key(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ParsePublicKeyOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.dafny_to_smithy.aws_cryptography_primitives_ParsePublicKeyOutput(input.value) def _deserialize_error(error: Error) -> ServiceError: if error.is_Opaque: @@ -258,6 +186,6 @@ def _deserialize_error(error: Error) -> ServiceError: list=[_deserialize_error(dafny_e) for dafny_e in error.list], ) elif error.is_AwsCryptographicPrimitivesError: - return AwsCryptographicPrimitivesError(message=_dafny.string_of(error.message)) + return AwsCryptographicPrimitivesError(message=_dafny.string_of(error.message)) else: return OpaqueError(obj=error, alt_text=repr(error)) diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/errors.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/errors.py index 6b94aa177..f46ff9c26 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/errors.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/errors.py @@ -10,36 +10,27 @@ class ServiceError(Exception): - """Base error for all errors in the service.""" - + """Base error for all errors in the service. + """ pass - -T = TypeVar("T") - - +T = TypeVar('T') class ApiError(ServiceError, Generic[T]): - """Base error for all api errors in the service.""" - + """Base error for all api errors in the service. + """ code: T - def __init__(self, message: str): super().__init__(message) self.message = message +class UnknownApiError(ApiError[Literal['Unknown']]): + """Error representing any unknown api errors + """ + code: Literal['Unknown'] = 'Unknown' -class UnknownApiError(ApiError[Literal["Unknown"]]): - """Error representing any unknown api errors.""" - - code: Literal["Unknown"] = "Unknown" - - -class AwsCryptographicPrimitivesError( - ApiError[Literal["AwsCryptographicPrimitivesError"]] -): +class AwsCryptographicPrimitivesError(ApiError[Literal["AwsCryptographicPrimitivesError"]]): code: Literal["AwsCryptographicPrimitivesError"] = "AwsCryptographicPrimitivesError" message: str - def __init__( self, *, @@ -48,17 +39,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the AwsCryptographicPrimitivesError to a dictionary.""" + """Converts the AwsCryptographicPrimitivesError to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "AwsCryptographicPrimitivesError": - """Creates a AwsCryptographicPrimitivesError from a dictionary.""" + """Creates a AwsCryptographicPrimitivesError from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return AwsCryptographicPrimitivesError(**kwargs) @@ -73,59 +68,62 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AwsCryptographicPrimitivesError): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) -class AwsCryptographicPrimitivesError( - ApiError[Literal["AwsCryptographicPrimitivesError"]] -): +class AwsCryptographicPrimitivesError(ApiError[Literal["AwsCryptographicPrimitivesError"]]): code: Literal["AwsCryptographicPrimitivesError"] = "AwsCryptographicPrimitivesError" message: str - class CollectionOfErrors(ApiError[Literal["CollectionOfErrors"]]): code: Literal["CollectionOfErrors"] = "CollectionOfErrors" message: str list: List[ServiceError] - def __init__(self, *, message: str, list): + def __init__( + self, + *, + message: str, + list + ): super().__init__(message) self.list = list def as_dict(self) -> Dict[str, Any]: """Converts the CollectionOfErrors to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "list": self.list, + 'message': self.message, + 'code': self.code, + 'list': self.list, } @staticmethod def from_dict(d: Dict[str, Any]) -> "CollectionOfErrors": """Creates a CollectionOfErrors from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ - kwargs: Dict[str, Any] = {"message": d["message"], "list": d["list"]} + kwargs: Dict[str, Any] = { + 'message': d['message'], + 'list': d['list'] + } return CollectionOfErrors(**kwargs) def __repr__(self) -> str: result = "CollectionOfErrors(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"list={self.list}" + result += f'list={self.list}' result += ")" return result @@ -134,15 +132,22 @@ def __eq__(self, other: Any) -> bool: return False if not (self.list == other.list): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OpaqueError(ApiError[Literal["OpaqueError"]]): code: Literal["OpaqueError"] = "OpaqueError" obj: Any # As an OpaqueError, type of obj is unknown - def __init__(self, *, obj, alt_text): + def __init__( + self, + *, + obj, + alt_text + ): super().__init__("") self.obj = obj self.alt_text = alt_text @@ -150,38 +155,37 @@ def __init__(self, *, obj, alt_text): def as_dict(self) -> Dict[str, Any]: """Converts the OpaqueError to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "obj": self.obj, - "alt_text": self.alt_text, + 'message': self.message, + 'code': self.code, + 'obj': self.obj, + 'alt_text': self.alt_text, } @staticmethod def from_dict(d: Dict[str, Any]) -> "OpaqueError": """Creates a OpaqueError from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ kwargs: Dict[str, Any] = { - "message": d["message"], - "obj": d["obj"], - "alt_text": d["alt_text"], + 'message': d['message'], + 'obj': d['obj'], + 'alt_text': d['alt_text'] } return OpaqueError(**kwargs) def __repr__(self) -> str: result = "OpaqueError(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"obj={self.alt_text}" + result += f'obj={self.alt_text}' result += ")" return result @@ -190,43 +194,36 @@ def __eq__(self, other: Any) -> bool: return False if not (self.obj == other.obj): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) def _smithy_error_to_dafny_error(e: ServiceError): - """Converts the provided native Smithy-modeled error into the corresponding - Dafny error.""" - if isinstance( - e, - aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.errors.AwsCryptographicPrimitivesError, - ): - return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_AwsCryptographicPrimitivesError( - message=_dafny.Seq(e.message) - ) + """ + Converts the provided native Smithy-modeled error + into the corresponding Dafny error. + """ + if isinstance(e, aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.errors.AwsCryptographicPrimitivesError): + return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_AwsCryptographicPrimitivesError(message=_dafny.Seq(e.message)) if isinstance(e, CollectionOfErrors): - return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_CollectionOfErrors( - message=_dafny.Seq(e.message), - list=_dafny.Seq( - _smithy_error_to_dafny_error(native_err) for native_err in e.list - ), - ) + return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_CollectionOfErrors(message=_dafny.Seq(e.message), list=_dafny.Seq( + _smithy_error_to_dafny_error(native_err) for native_err in e.list + )) if isinstance(e, OpaqueError): - return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_Opaque( - obj=e.obj, alt__text=e.alt_text - ) + return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_Opaque(obj=e.obj, alt__text=e.alt_text) else: - return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_Opaque( - obj=e, - alt__text=_dafny.Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip(*[iter(repr(e).encode("utf-16-be"))] * 2) - ] - ) - ), - ) + return aws_cryptography_primitives.internaldafny.generated.AwsCryptographyPrimitivesTypes.Error_Opaque(obj=e, alt__text=_dafny.Seq( + "".join( + [ + chr(int.from_bytes(pair, "big")) + for pair in zip( + *[iter(repr(e).encode("utf-16-be"))] * 2 + ) + ] + ) + )) diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/models.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/models.py index bccfddba2..ccf6d4f56 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/models.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/models.py @@ -9,7 +9,6 @@ class AES_GCM: key_length: int tag_length: int iv_length: int - def __init__( self, *, @@ -40,7 +39,9 @@ def __init__( self.iv_length = iv_length def as_dict(self) -> Dict[str, Any]: - """Converts the AES_GCM to a dictionary.""" + """Converts the AES_GCM to a dictionary. + + """ d: Dict[str, Any] = {} if self.key_length is not None: @@ -56,7 +57,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AES_GCM": - """Creates a AES_GCM from a dictionary.""" + """Creates a AES_GCM from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "key_length" in d: @@ -86,13 +89,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AES_GCM): return False - attributes: list[str] = [ - "key_length", - "tag_length", - "iv_length", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_length','tag_length','iv_length',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class AESDecryptInput: enc_alg: AES_GCM @@ -101,7 +102,6 @@ class AESDecryptInput: auth_tag: bytes | bytearray iv: bytes | bytearray aad: bytes | bytearray - def __init__( self, *, @@ -120,7 +120,9 @@ def __init__( self.aad = aad def as_dict(self) -> Dict[str, Any]: - """Converts the AESDecryptInput to a dictionary.""" + """Converts the AESDecryptInput to a dictionary. + + """ return { "enc_alg": self.enc_alg.as_dict(), "key": self.key, @@ -132,7 +134,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AESDecryptInput": - """Creates a AESDecryptInput from a dictionary.""" + """Creates a AESDecryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "enc_alg": AES_GCM.from_dict(d["enc_alg"]), "key": d["key"], @@ -169,16 +173,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AESDecryptInput): return False - attributes: list[str] = [ - "enc_alg", - "key", - "cipher_txt", - "auth_tag", - "iv", - "aad", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['enc_alg','key','cipher_txt','auth_tag','iv','aad',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class AESEncryptInput: enc_alg: AES_GCM @@ -186,7 +185,6 @@ class AESEncryptInput: key: bytes | bytearray msg: bytes | bytearray aad: bytes | bytearray - def __init__( self, *, @@ -203,7 +201,9 @@ def __init__( self.aad = aad def as_dict(self) -> Dict[str, Any]: - """Converts the AESEncryptInput to a dictionary.""" + """Converts the AESEncryptInput to a dictionary. + + """ return { "enc_alg": self.enc_alg.as_dict(), "iv": self.iv, @@ -214,7 +214,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AESEncryptInput": - """Creates a AESEncryptInput from a dictionary.""" + """Creates a AESEncryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "enc_alg": AES_GCM.from_dict(d["enc_alg"]), "iv": d["iv"], @@ -247,20 +249,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AESEncryptInput): return False - attributes: list[str] = [ - "enc_alg", - "iv", - "key", - "msg", - "aad", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['enc_alg','iv','key','msg','aad',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class AESEncryptOutput: cipher_text: bytes | bytearray auth_tag: bytes | bytearray - def __init__( self, *, @@ -271,7 +268,9 @@ def __init__( self.auth_tag = auth_tag def as_dict(self) -> Dict[str, Any]: - """Converts the AESEncryptOutput to a dictionary.""" + """Converts the AESEncryptOutput to a dictionary. + + """ return { "cipher_text": self.cipher_text, "auth_tag": self.auth_tag, @@ -279,7 +278,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AESEncryptOutput": - """Creates a AESEncryptOutput from a dictionary.""" + """Creates a AESEncryptOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "cipher_text": d["cipher_text"], "auth_tag": d["auth_tag"], @@ -300,18 +301,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AESEncryptOutput): return False - attributes: list[str] = [ - "cipher_text", - "auth_tag", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['cipher_text','auth_tag',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class AesKdfCtrInput: ikm: bytes | bytearray expected_length: int nonce: Optional[bytes | bytearray] - def __init__( self, *, @@ -327,7 +326,9 @@ def __init__( self.nonce = nonce def as_dict(self) -> Dict[str, Any]: - """Converts the AesKdfCtrInput to a dictionary.""" + """Converts the AesKdfCtrInput to a dictionary. + + """ d: Dict[str, Any] = { "ikm": self.ikm, } @@ -342,7 +343,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AesKdfCtrInput": - """Creates a AesKdfCtrInput from a dictionary.""" + """Creates a AesKdfCtrInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "ikm": d["ikm"], } @@ -371,13 +374,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AesKdfCtrInput): return False - attributes: list[str] = [ - "ikm", - "expected_length", - "nonce", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ikm','expected_length','nonce',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ECDHCurveSpec: ECC_NIST_P256 = "ECC_NIST_P256" @@ -392,10 +393,8 @@ class ECDHCurveSpec: # values may be added in the future. values = frozenset({"ECC_NIST_P256", "ECC_NIST_P384", "ECC_NIST_P521", "SM2"}) - class ECCPublicKey: der: bytes | bytearray - def __init__( self, *, @@ -404,14 +403,18 @@ def __init__( self.der = der def as_dict(self) -> Dict[str, Any]: - """Converts the ECCPublicKey to a dictionary.""" + """Converts the ECCPublicKey to a dictionary. + + """ return { "der": self.der, } @staticmethod def from_dict(d: Dict[str, Any]) -> "ECCPublicKey": - """Creates a ECCPublicKey from a dictionary.""" + """Creates a ECCPublicKey from a dictionary. + + """ kwargs: Dict[str, Any] = { "der": d["der"], } @@ -428,16 +431,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ECCPublicKey): return False - attributes: list[str] = [ - "der", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['der',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CompressPublicKeyInput: public_key: ECCPublicKey ecc_curve: str - def __init__( self, *, @@ -448,7 +450,9 @@ def __init__( self.ecc_curve = ecc_curve def as_dict(self) -> Dict[str, Any]: - """Converts the CompressPublicKeyInput to a dictionary.""" + """Converts the CompressPublicKeyInput to a dictionary. + + """ return { "public_key": self.public_key.as_dict(), "ecc_curve": self.ecc_curve, @@ -456,7 +460,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "CompressPublicKeyInput": - """Creates a CompressPublicKeyInput from a dictionary.""" + """Creates a CompressPublicKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "public_key": ECCPublicKey.from_dict(d["public_key"]), "ecc_curve": d["ecc_curve"], @@ -477,16 +483,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CompressPublicKeyInput): return False - attributes: list[str] = [ - "public_key", - "ecc_curve", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['public_key','ecc_curve',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class CompressPublicKeyOutput: compressed_public_key: bytes | bytearray - def __init__( self, *, @@ -495,14 +499,18 @@ def __init__( self.compressed_public_key = compressed_public_key def as_dict(self) -> Dict[str, Any]: - """Converts the CompressPublicKeyOutput to a dictionary.""" + """Converts the CompressPublicKeyOutput to a dictionary. + + """ return { "compressed_public_key": self.compressed_public_key, } @staticmethod def from_dict(d: Dict[str, Any]) -> "CompressPublicKeyOutput": - """Creates a CompressPublicKeyOutput from a dictionary.""" + """Creates a CompressPublicKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "compressed_public_key": d["compressed_public_key"], } @@ -519,16 +527,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, CompressPublicKeyOutput): return False - attributes: list[str] = [ - "compressed_public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['compressed_public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DecompressPublicKeyInput: compressed_public_key: bytes | bytearray ecc_curve: str - def __init__( self, *, @@ -539,7 +546,9 @@ def __init__( self.ecc_curve = ecc_curve def as_dict(self) -> Dict[str, Any]: - """Converts the DecompressPublicKeyInput to a dictionary.""" + """Converts the DecompressPublicKeyInput to a dictionary. + + """ return { "compressed_public_key": self.compressed_public_key, "ecc_curve": self.ecc_curve, @@ -547,7 +556,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DecompressPublicKeyInput": - """Creates a DecompressPublicKeyInput from a dictionary.""" + """Creates a DecompressPublicKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "compressed_public_key": d["compressed_public_key"], "ecc_curve": d["ecc_curve"], @@ -568,16 +579,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DecompressPublicKeyInput): return False - attributes: list[str] = [ - "compressed_public_key", - "ecc_curve", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['compressed_public_key','ecc_curve',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DecompressPublicKeyOutput: public_key: ECCPublicKey - def __init__( self, *, @@ -586,14 +595,18 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the DecompressPublicKeyOutput to a dictionary.""" + """Converts the DecompressPublicKeyOutput to a dictionary. + + """ return { "public_key": self.public_key.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "DecompressPublicKeyOutput": - """Creates a DecompressPublicKeyOutput from a dictionary.""" + """Creates a DecompressPublicKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "public_key": ECCPublicKey.from_dict(d["public_key"]), } @@ -610,15 +623,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DecompressPublicKeyOutput): return False - attributes: list[str] = [ - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ECCPrivateKey: pem: bytes | bytearray - def __init__( self, *, @@ -627,14 +639,18 @@ def __init__( self.pem = pem def as_dict(self) -> Dict[str, Any]: - """Converts the ECCPrivateKey to a dictionary.""" + """Converts the ECCPrivateKey to a dictionary. + + """ return { "pem": self.pem, } @staticmethod def from_dict(d: Dict[str, Any]) -> "ECCPrivateKey": - """Creates a ECCPrivateKey from a dictionary.""" + """Creates a ECCPrivateKey from a dictionary. + + """ kwargs: Dict[str, Any] = { "pem": d["pem"], } @@ -651,17 +667,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ECCPrivateKey): return False - attributes: list[str] = [ - "pem", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['pem',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DeriveSharedSecretInput: ecc_curve: str private_key: ECCPrivateKey public_key: ECCPublicKey - def __init__( self, *, @@ -674,7 +689,9 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the DeriveSharedSecretInput to a dictionary.""" + """Converts the DeriveSharedSecretInput to a dictionary. + + """ return { "ecc_curve": self.ecc_curve, "private_key": self.private_key.as_dict(), @@ -683,7 +700,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DeriveSharedSecretInput": - """Creates a DeriveSharedSecretInput from a dictionary.""" + """Creates a DeriveSharedSecretInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "ecc_curve": d["ecc_curve"], "private_key": ECCPrivateKey.from_dict(d["private_key"]), @@ -708,17 +727,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DeriveSharedSecretInput): return False - attributes: list[str] = [ - "ecc_curve", - "private_key", - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ecc_curve','private_key','public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DeriveSharedSecretOutput: shared_secret: bytes | bytearray - def __init__( self, *, @@ -727,14 +743,18 @@ def __init__( self.shared_secret = shared_secret def as_dict(self) -> Dict[str, Any]: - """Converts the DeriveSharedSecretOutput to a dictionary.""" + """Converts the DeriveSharedSecretOutput to a dictionary. + + """ return { "shared_secret": self.shared_secret, } @staticmethod def from_dict(d: Dict[str, Any]) -> "DeriveSharedSecretOutput": - """Creates a DeriveSharedSecretOutput from a dictionary.""" + """Creates a DeriveSharedSecretOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "shared_secret": d["shared_secret"], } @@ -751,11 +771,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DeriveSharedSecretOutput): return False - attributes: list[str] = [ - "shared_secret", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['shared_secret',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class DigestAlgorithm: SHA_512 = "SHA_512" @@ -768,11 +788,9 @@ class DigestAlgorithm: # values may be added in the future. values = frozenset({"SHA_512", "SHA_384", "SHA_256"}) - class DigestInput: digest_algorithm: str message: bytes | bytearray - def __init__( self, *, @@ -783,7 +801,9 @@ def __init__( self.message = message def as_dict(self) -> Dict[str, Any]: - """Converts the DigestInput to a dictionary.""" + """Converts the DigestInput to a dictionary. + + """ return { "digest_algorithm": self.digest_algorithm, "message": self.message, @@ -791,7 +811,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "DigestInput": - """Creates a DigestInput from a dictionary.""" + """Creates a DigestInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "digest_algorithm": d["digest_algorithm"], "message": d["message"], @@ -812,12 +834,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, DigestInput): return False - attributes: list[str] = [ - "digest_algorithm", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['digest_algorithm','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ECDSASignatureAlgorithm: ECDSA_P384 = "ECDSA_P384" @@ -828,12 +849,10 @@ class ECDSASignatureAlgorithm: # values may be added in the future. values = frozenset({"ECDSA_P384", "ECDSA_P256"}) - class ECDSASignInput: signature_algorithm: str signing_key: bytes | bytearray message: bytes | bytearray - def __init__( self, *, @@ -846,7 +865,9 @@ def __init__( self.message = message def as_dict(self) -> Dict[str, Any]: - """Converts the ECDSASignInput to a dictionary.""" + """Converts the ECDSASignInput to a dictionary. + + """ return { "signature_algorithm": self.signature_algorithm, "signing_key": self.signing_key, @@ -855,7 +876,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "ECDSASignInput": - """Creates a ECDSASignInput from a dictionary.""" + """Creates a ECDSASignInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "signature_algorithm": d["signature_algorithm"], "signing_key": d["signing_key"], @@ -880,20 +903,17 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ECDSASignInput): return False - attributes: list[str] = [ - "signature_algorithm", - "signing_key", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['signature_algorithm','signing_key','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ECDSAVerifyInput: signature_algorithm: str verification_key: bytes | bytearray message: bytes | bytearray signature: bytes | bytearray - def __init__( self, *, @@ -908,7 +928,9 @@ def __init__( self.signature = signature def as_dict(self) -> Dict[str, Any]: - """Converts the ECDSAVerifyInput to a dictionary.""" + """Converts the ECDSAVerifyInput to a dictionary. + + """ return { "signature_algorithm": self.signature_algorithm, "verification_key": self.verification_key, @@ -918,7 +940,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "ECDSAVerifyInput": - """Creates a ECDSAVerifyInput from a dictionary.""" + """Creates a ECDSAVerifyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "signature_algorithm": d["signature_algorithm"], "verification_key": d["verification_key"], @@ -947,18 +971,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ECDSAVerifyInput): return False - attributes: list[str] = [ - "signature_algorithm", - "verification_key", - "message", - "signature", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['signature_algorithm','verification_key','message','signature',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GenerateECCKeyPairInput: ecc_curve: str - def __init__( self, *, @@ -967,14 +987,18 @@ def __init__( self.ecc_curve = ecc_curve def as_dict(self) -> Dict[str, Any]: - """Converts the GenerateECCKeyPairInput to a dictionary.""" + """Converts the GenerateECCKeyPairInput to a dictionary. + + """ return { "ecc_curve": self.ecc_curve, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GenerateECCKeyPairInput": - """Creates a GenerateECCKeyPairInput from a dictionary.""" + """Creates a GenerateECCKeyPairInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "ecc_curve": d["ecc_curve"], } @@ -991,17 +1015,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GenerateECCKeyPairInput): return False - attributes: list[str] = [ - "ecc_curve", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ecc_curve',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GenerateECCKeyPairOutput: ecc_curve: str private_key: ECCPrivateKey public_key: ECCPublicKey - def __init__( self, *, @@ -1014,7 +1037,9 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the GenerateECCKeyPairOutput to a dictionary.""" + """Converts the GenerateECCKeyPairOutput to a dictionary. + + """ return { "ecc_curve": self.ecc_curve, "private_key": self.private_key.as_dict(), @@ -1023,7 +1048,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GenerateECCKeyPairOutput": - """Creates a GenerateECCKeyPairOutput from a dictionary.""" + """Creates a GenerateECCKeyPairOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "ecc_curve": d["ecc_curve"], "private_key": ECCPrivateKey.from_dict(d["private_key"]), @@ -1048,17 +1075,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GenerateECCKeyPairOutput): return False - attributes: list[str] = [ - "ecc_curve", - "private_key", - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ecc_curve','private_key','public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GenerateECDSASignatureKeyInput: signature_algorithm: str - def __init__( self, *, @@ -1067,14 +1091,18 @@ def __init__( self.signature_algorithm = signature_algorithm def as_dict(self) -> Dict[str, Any]: - """Converts the GenerateECDSASignatureKeyInput to a dictionary.""" + """Converts the GenerateECDSASignatureKeyInput to a dictionary. + + """ return { "signature_algorithm": self.signature_algorithm, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GenerateECDSASignatureKeyInput": - """Creates a GenerateECDSASignatureKeyInput from a dictionary.""" + """Creates a GenerateECDSASignatureKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "signature_algorithm": d["signature_algorithm"], } @@ -1091,17 +1119,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GenerateECDSASignatureKeyInput): return False - attributes: list[str] = [ - "signature_algorithm", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['signature_algorithm',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GenerateECDSASignatureKeyOutput: signature_algorithm: str verification_key: bytes | bytearray signing_key: bytes | bytearray - def __init__( self, *, @@ -1114,7 +1141,9 @@ def __init__( self.signing_key = signing_key def as_dict(self) -> Dict[str, Any]: - """Converts the GenerateECDSASignatureKeyOutput to a dictionary.""" + """Converts the GenerateECDSASignatureKeyOutput to a dictionary. + + """ return { "signature_algorithm": self.signature_algorithm, "verification_key": self.verification_key, @@ -1123,7 +1152,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GenerateECDSASignatureKeyOutput": - """Creates a GenerateECDSASignatureKeyOutput from a dictionary.""" + """Creates a GenerateECDSASignatureKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "signature_algorithm": d["signature_algorithm"], "verification_key": d["verification_key"], @@ -1148,17 +1179,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GenerateECDSASignatureKeyOutput): return False - attributes: list[str] = [ - "signature_algorithm", - "verification_key", - "signing_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['signature_algorithm','verification_key','signing_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GenerateRandomBytesInput: length: int - def __init__( self, *, @@ -1170,7 +1198,9 @@ def __init__( self.length = length def as_dict(self) -> Dict[str, Any]: - """Converts the GenerateRandomBytesInput to a dictionary.""" + """Converts the GenerateRandomBytesInput to a dictionary. + + """ d: Dict[str, Any] = {} if self.length is not None: @@ -1180,7 +1210,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GenerateRandomBytesInput": - """Creates a GenerateRandomBytesInput from a dictionary.""" + """Creates a GenerateRandomBytesInput from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "length" in d: @@ -1198,15 +1230,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GenerateRandomBytesInput): return False - attributes: list[str] = [ - "length", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['length',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GenerateRSAKeyPairInput: length_bits: int - def __init__( self, *, @@ -1221,7 +1252,9 @@ def __init__( self.length_bits = length_bits def as_dict(self) -> Dict[str, Any]: - """Converts the GenerateRSAKeyPairInput to a dictionary.""" + """Converts the GenerateRSAKeyPairInput to a dictionary. + + """ d: Dict[str, Any] = {} if self.length_bits is not None: @@ -1231,7 +1264,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GenerateRSAKeyPairInput": - """Creates a GenerateRSAKeyPairInput from a dictionary.""" + """Creates a GenerateRSAKeyPairInput from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "length_bits" in d: @@ -1249,16 +1284,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GenerateRSAKeyPairInput): return False - attributes: list[str] = [ - "length_bits", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['length_bits',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class RSAPrivateKey: length_bits: int pem: bytes | bytearray - def __init__( self, *, @@ -1272,7 +1306,9 @@ def __init__( self.length_bits = length_bits def as_dict(self) -> Dict[str, Any]: - """Converts the RSAPrivateKey to a dictionary.""" + """Converts the RSAPrivateKey to a dictionary. + + """ d: Dict[str, Any] = { "pem": self.pem, } @@ -1284,7 +1320,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RSAPrivateKey": - """Creates a RSAPrivateKey from a dictionary.""" + """Creates a RSAPrivateKey from a dictionary. + + """ kwargs: Dict[str, Any] = { "pem": d["pem"], } @@ -1307,17 +1345,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RSAPrivateKey): return False - attributes: list[str] = [ - "length_bits", - "pem", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['length_bits','pem',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class RSAPublicKey: length_bits: int pem: bytes | bytearray - def __init__( self, *, @@ -1331,7 +1367,9 @@ def __init__( self.length_bits = length_bits def as_dict(self) -> Dict[str, Any]: - """Converts the RSAPublicKey to a dictionary.""" + """Converts the RSAPublicKey to a dictionary. + + """ d: Dict[str, Any] = { "pem": self.pem, } @@ -1343,7 +1381,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RSAPublicKey": - """Creates a RSAPublicKey from a dictionary.""" + """Creates a RSAPublicKey from a dictionary. + + """ kwargs: Dict[str, Any] = { "pem": d["pem"], } @@ -1366,17 +1406,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RSAPublicKey): return False - attributes: list[str] = [ - "length_bits", - "pem", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['length_bits','pem',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GenerateRSAKeyPairOutput: public_key: RSAPublicKey private_key: RSAPrivateKey - def __init__( self, *, @@ -1387,7 +1425,9 @@ def __init__( self.private_key = private_key def as_dict(self) -> Dict[str, Any]: - """Converts the GenerateRSAKeyPairOutput to a dictionary.""" + """Converts the GenerateRSAKeyPairOutput to a dictionary. + + """ return { "public_key": self.public_key.as_dict(), "private_key": self.private_key.as_dict(), @@ -1395,7 +1435,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GenerateRSAKeyPairOutput": - """Creates a GenerateRSAKeyPairOutput from a dictionary.""" + """Creates a GenerateRSAKeyPairOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "public_key": RSAPublicKey.from_dict(d["public_key"]), "private_key": RSAPrivateKey.from_dict(d["private_key"]), @@ -1416,17 +1458,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GenerateRSAKeyPairOutput): return False - attributes: list[str] = [ - "public_key", - "private_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['public_key','private_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetPublicKeyFromPrivateKeyInput: ecc_curve: str private_key: ECCPrivateKey - def __init__( self, *, @@ -1437,7 +1477,9 @@ def __init__( self.private_key = private_key def as_dict(self) -> Dict[str, Any]: - """Converts the GetPublicKeyFromPrivateKeyInput to a dictionary.""" + """Converts the GetPublicKeyFromPrivateKeyInput to a dictionary. + + """ return { "ecc_curve": self.ecc_curve, "private_key": self.private_key.as_dict(), @@ -1445,7 +1487,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GetPublicKeyFromPrivateKeyInput": - """Creates a GetPublicKeyFromPrivateKeyInput from a dictionary.""" + """Creates a GetPublicKeyFromPrivateKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "ecc_curve": d["ecc_curve"], "private_key": ECCPrivateKey.from_dict(d["private_key"]), @@ -1466,18 +1510,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetPublicKeyFromPrivateKeyInput): return False - attributes: list[str] = [ - "ecc_curve", - "private_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ecc_curve','private_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetPublicKeyFromPrivateKeyOutput: ecc_curve: str private_key: ECCPrivateKey public_key: bytes | bytearray - def __init__( self, *, @@ -1490,7 +1532,9 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the GetPublicKeyFromPrivateKeyOutput to a dictionary.""" + """Converts the GetPublicKeyFromPrivateKeyOutput to a dictionary. + + """ return { "ecc_curve": self.ecc_curve, "private_key": self.private_key.as_dict(), @@ -1499,7 +1543,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GetPublicKeyFromPrivateKeyOutput": - """Creates a GetPublicKeyFromPrivateKeyOutput from a dictionary.""" + """Creates a GetPublicKeyFromPrivateKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "ecc_curve": d["ecc_curve"], "private_key": ECCPrivateKey.from_dict(d["private_key"]), @@ -1524,17 +1570,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetPublicKeyFromPrivateKeyOutput): return False - attributes: list[str] = [ - "ecc_curve", - "private_key", - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ecc_curve','private_key','public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetRSAKeyModulusLengthInput: public_key: bytes | bytearray - def __init__( self, *, @@ -1543,14 +1586,18 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the GetRSAKeyModulusLengthInput to a dictionary.""" + """Converts the GetRSAKeyModulusLengthInput to a dictionary. + + """ return { "public_key": self.public_key, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetRSAKeyModulusLengthInput": - """Creates a GetRSAKeyModulusLengthInput from a dictionary.""" + """Creates a GetRSAKeyModulusLengthInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "public_key": d["public_key"], } @@ -1567,15 +1614,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetRSAKeyModulusLengthInput): return False - attributes: list[str] = [ - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetRSAKeyModulusLengthOutput: length: int - def __init__( self, *, @@ -1587,7 +1633,9 @@ def __init__( self.length = length def as_dict(self) -> Dict[str, Any]: - """Converts the GetRSAKeyModulusLengthOutput to a dictionary.""" + """Converts the GetRSAKeyModulusLengthOutput to a dictionary. + + """ d: Dict[str, Any] = {} if self.length is not None: @@ -1597,7 +1645,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "GetRSAKeyModulusLengthOutput": - """Creates a GetRSAKeyModulusLengthOutput from a dictionary.""" + """Creates a GetRSAKeyModulusLengthOutput from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "length" in d: @@ -1615,11 +1665,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetRSAKeyModulusLengthOutput): return False - attributes: list[str] = [ - "length", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['length',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class HkdfInput: digest_algorithm: str @@ -1627,7 +1677,6 @@ class HkdfInput: ikm: bytes | bytearray info: bytes | bytearray expected_length: int - def __init__( self, *, @@ -1647,7 +1696,9 @@ def __init__( self.expected_length = expected_length def as_dict(self) -> Dict[str, Any]: - """Converts the HkdfInput to a dictionary.""" + """Converts the HkdfInput to a dictionary. + + """ d: Dict[str, Any] = { "digest_algorithm": self.digest_algorithm, "ikm": self.ikm, @@ -1664,7 +1715,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "HkdfInput": - """Creates a HkdfInput from a dictionary.""" + """Creates a HkdfInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "digest_algorithm": d["digest_algorithm"], "ikm": d["ikm"], @@ -1701,22 +1754,17 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, HkdfInput): return False - attributes: list[str] = [ - "digest_algorithm", - "salt", - "ikm", - "info", - "expected_length", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['digest_algorithm','salt','ikm','info','expected_length',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class HkdfExpandInput: digest_algorithm: str prk: bytes | bytearray info: bytes | bytearray expected_length: int - def __init__( self, *, @@ -1734,7 +1782,9 @@ def __init__( self.expected_length = expected_length def as_dict(self) -> Dict[str, Any]: - """Converts the HkdfExpandInput to a dictionary.""" + """Converts the HkdfExpandInput to a dictionary. + + """ d: Dict[str, Any] = { "digest_algorithm": self.digest_algorithm, "prk": self.prk, @@ -1748,7 +1798,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "HkdfExpandInput": - """Creates a HkdfExpandInput from a dictionary.""" + """Creates a HkdfExpandInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "digest_algorithm": d["digest_algorithm"], "prk": d["prk"], @@ -1779,20 +1831,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, HkdfExpandInput): return False - attributes: list[str] = [ - "digest_algorithm", - "prk", - "info", - "expected_length", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['digest_algorithm','prk','info','expected_length',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class HkdfExtractInput: digest_algorithm: str salt: Optional[bytes | bytearray] ikm: bytes | bytearray - def __init__( self, *, @@ -1805,7 +1853,9 @@ def __init__( self.salt = salt def as_dict(self) -> Dict[str, Any]: - """Converts the HkdfExtractInput to a dictionary.""" + """Converts the HkdfExtractInput to a dictionary. + + """ d: Dict[str, Any] = { "digest_algorithm": self.digest_algorithm, "ikm": self.ikm, @@ -1818,7 +1868,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "HkdfExtractInput": - """Creates a HkdfExtractInput from a dictionary.""" + """Creates a HkdfExtractInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "digest_algorithm": d["digest_algorithm"], "ikm": d["ikm"], @@ -1845,19 +1897,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, HkdfExtractInput): return False - attributes: list[str] = [ - "digest_algorithm", - "salt", - "ikm", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['digest_algorithm','salt','ikm',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class HMacInput: digest_algorithm: str key: bytes | bytearray message: bytes | bytearray - def __init__( self, *, @@ -1870,7 +1919,9 @@ def __init__( self.message = message def as_dict(self) -> Dict[str, Any]: - """Converts the HMacInput to a dictionary.""" + """Converts the HMacInput to a dictionary. + + """ return { "digest_algorithm": self.digest_algorithm, "key": self.key, @@ -1879,7 +1930,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "HMacInput": - """Creates a HMacInput from a dictionary.""" + """Creates a HMacInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "digest_algorithm": d["digest_algorithm"], "key": d["key"], @@ -1904,13 +1957,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, HMacInput): return False - attributes: list[str] = [ - "digest_algorithm", - "key", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['digest_algorithm','key','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KdfCtrInput: digest_algorithm: str @@ -1918,7 +1969,6 @@ class KdfCtrInput: expected_length: int purpose: Optional[bytes | bytearray] nonce: Optional[bytes | bytearray] - def __init__( self, *, @@ -1938,7 +1988,9 @@ def __init__( self.nonce = nonce def as_dict(self) -> Dict[str, Any]: - """Converts the KdfCtrInput to a dictionary.""" + """Converts the KdfCtrInput to a dictionary. + + """ d: Dict[str, Any] = { "digest_algorithm": self.digest_algorithm, "ikm": self.ikm, @@ -1957,7 +2009,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KdfCtrInput": - """Creates a KdfCtrInput from a dictionary.""" + """Creates a KdfCtrInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "digest_algorithm": d["digest_algorithm"], "ikm": d["ikm"], @@ -1996,19 +2050,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KdfCtrInput): return False - attributes: list[str] = [ - "digest_algorithm", - "ikm", - "expected_length", - "purpose", - "nonce", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['digest_algorithm','ikm','expected_length','purpose','nonce',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ParsePublicKeyInput: public_key: bytes | bytearray - def __init__( self, *, @@ -2017,14 +2066,18 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the ParsePublicKeyInput to a dictionary.""" + """Converts the ParsePublicKeyInput to a dictionary. + + """ return { "public_key": self.public_key, } @staticmethod def from_dict(d: Dict[str, Any]) -> "ParsePublicKeyInput": - """Creates a ParsePublicKeyInput from a dictionary.""" + """Creates a ParsePublicKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "public_key": d["public_key"], } @@ -2041,15 +2094,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ParsePublicKeyInput): return False - attributes: list[str] = [ - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ParsePublicKeyOutput: public_key: ECCPublicKey - def __init__( self, *, @@ -2058,14 +2110,18 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the ParsePublicKeyOutput to a dictionary.""" + """Converts the ParsePublicKeyOutput to a dictionary. + + """ return { "public_key": self.public_key.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "ParsePublicKeyOutput": - """Creates a ParsePublicKeyOutput from a dictionary.""" + """Creates a ParsePublicKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "public_key": ECCPublicKey.from_dict(d["public_key"]), } @@ -2082,11 +2138,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ParsePublicKeyOutput): return False - attributes: list[str] = [ - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class RSAPaddingMode: PKCS1 = "PKCS1" @@ -2101,16 +2157,12 @@ class RSAPaddingMode: # This set contains every possible value known at the time this was generated. New # values may be added in the future. - values = frozenset( - {"PKCS1", "OAEP_SHA1", "OAEP_SHA256", "OAEP_SHA384", "OAEP_SHA512"} - ) - + values = frozenset({"PKCS1", "OAEP_SHA1", "OAEP_SHA256", "OAEP_SHA384", "OAEP_SHA512"}) class RSADecryptInput: padding: str private_key: bytes | bytearray cipher_text: bytes | bytearray - def __init__( self, *, @@ -2123,7 +2175,9 @@ def __init__( self.cipher_text = cipher_text def as_dict(self) -> Dict[str, Any]: - """Converts the RSADecryptInput to a dictionary.""" + """Converts the RSADecryptInput to a dictionary. + + """ return { "padding": self.padding, "private_key": self.private_key, @@ -2132,7 +2186,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RSADecryptInput": - """Creates a RSADecryptInput from a dictionary.""" + """Creates a RSADecryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "padding": d["padding"], "private_key": d["private_key"], @@ -2157,19 +2213,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RSADecryptInput): return False - attributes: list[str] = [ - "padding", - "private_key", - "cipher_text", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['padding','private_key','cipher_text',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class RSAEncryptInput: padding: str public_key: bytes | bytearray plaintext: bytes | bytearray - def __init__( self, *, @@ -2182,7 +2235,9 @@ def __init__( self.plaintext = plaintext def as_dict(self) -> Dict[str, Any]: - """Converts the RSAEncryptInput to a dictionary.""" + """Converts the RSAEncryptInput to a dictionary. + + """ return { "padding": self.padding, "public_key": self.public_key, @@ -2191,7 +2246,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RSAEncryptInput": - """Creates a RSAEncryptInput from a dictionary.""" + """Creates a RSAEncryptInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "padding": d["padding"], "public_key": d["public_key"], @@ -2216,18 +2273,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RSAEncryptInput): return False - attributes: list[str] = [ - "padding", - "public_key", - "plaintext", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['padding','public_key','plaintext',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ValidatePublicKeyInput: ecc_curve: str public_key: bytes | bytearray - def __init__( self, *, @@ -2238,7 +2292,9 @@ def __init__( self.public_key = public_key def as_dict(self) -> Dict[str, Any]: - """Converts the ValidatePublicKeyInput to a dictionary.""" + """Converts the ValidatePublicKeyInput to a dictionary. + + """ return { "ecc_curve": self.ecc_curve, "public_key": self.public_key, @@ -2246,7 +2302,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "ValidatePublicKeyInput": - """Creates a ValidatePublicKeyInput from a dictionary.""" + """Creates a ValidatePublicKeyInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "ecc_curve": d["ecc_curve"], "public_key": d["public_key"], @@ -2267,16 +2325,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ValidatePublicKeyInput): return False - attributes: list[str] = [ - "ecc_curve", - "public_key", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['ecc_curve','public_key',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class ValidatePublicKeyOutput: success: bool - def __init__( self, *, @@ -2285,14 +2341,18 @@ def __init__( self.success = success def as_dict(self) -> Dict[str, Any]: - """Converts the ValidatePublicKeyOutput to a dictionary.""" + """Converts the ValidatePublicKeyOutput to a dictionary. + + """ return { "success": self.success, } @staticmethod def from_dict(d: Dict[str, Any]) -> "ValidatePublicKeyOutput": - """Creates a ValidatePublicKeyOutput from a dictionary.""" + """Creates a ValidatePublicKeyOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "success": d["success"], } @@ -2309,16 +2369,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, ValidatePublicKeyOutput): return False - attributes: list[str] = [ - "success", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['success',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class AES_CTR: key_length: int nonce_length: int - def __init__( self, *, @@ -2341,7 +2400,9 @@ def __init__( self.nonce_length = nonce_length def as_dict(self) -> Dict[str, Any]: - """Converts the AES_CTR to a dictionary.""" + """Converts the AES_CTR to a dictionary. + + """ d: Dict[str, Any] = {} if self.key_length is not None: @@ -2354,7 +2415,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "AES_CTR": - """Creates a AES_CTR from a dictionary.""" + """Creates a AES_CTR from a dictionary. + + """ kwargs: Dict[str, Any] = {} if "key_length" in d: @@ -2378,12 +2441,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, AES_CTR): return False - attributes: list[str] = [ - "key_length", - "nonce_length", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_length','nonce_length',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class Unit: pass diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/plugin.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/plugin.py index 2598d1a9c..8c5b7ed3f 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/plugin.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/plugin.py @@ -7,37 +7,29 @@ from smithy_python.exceptions import SmithyRetryException from .dafnyImplInterface import DafnyImplInterface - def set_config_impl(config: Config): - """Set the Dafny-compiled implementation in the Smithy-Python client Config - and load our custom NoRetriesStrategy.""" + """ + Set the Dafny-compiled implementation in the Smithy-Python client Config + and load our custom NoRetriesStrategy. + """ config.dafnyImplInterface = DafnyImplInterface() if isinstance(config, CryptoConfig): - from aws_cryptography_primitives.internaldafny.generated.AtomicPrimitives import ( - default__, - ) - - config.dafnyImplInterface.impl = default__.AtomicPrimitives( - smithy_config_to_dafny_config(config) - ).value + from aws_cryptography_primitives.internaldafny.generated.AtomicPrimitives import default__ + config.dafnyImplInterface.impl = default__.AtomicPrimitives(smithy_config_to_dafny_config(config)).value config.retry_strategy = NoRetriesStrategy() - class ZeroRetryDelayToken: - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not wait to retry. """ - retry_delay = 0 - class NoRetriesStrategy(RetryStrategy): - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not retry calling Dafny code. """ - def acquire_initial_retry_token(self): return ZeroRetryDelayToken() diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/serialize.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/serialize.py index 2e392d30a..6cb5ef2e5 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/serialize.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/serialize.py @@ -10,216 +10,73 @@ def _serialize_generate_random_bytes(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GenerateRandomBytes", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateRandomBytesInput( - input - ), - ) - + return DafnyRequest(operation_name="GenerateRandomBytes", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateRandomBytesInput(input)) def _serialize_digest(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="Digest", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestInput( - input - ), - ) - + return DafnyRequest(operation_name="Digest", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestInput(input)) def _serialize_h_mac(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="HMac", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HMacInput( - input - ), - ) - + return DafnyRequest(operation_name="HMac", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HMacInput(input)) def _serialize_hkdf_extract(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="HkdfExtract", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HkdfExtractInput( - input - ), - ) - + return DafnyRequest(operation_name="HkdfExtract", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HkdfExtractInput(input)) def _serialize_hkdf_expand(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="HkdfExpand", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HkdfExpandInput( - input - ), - ) - + return DafnyRequest(operation_name="HkdfExpand", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HkdfExpandInput(input)) def _serialize_hkdf(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="Hkdf", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HkdfInput( - input - ), - ) - + return DafnyRequest(operation_name="Hkdf", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_HkdfInput(input)) def _serialize_kdf_counter_mode(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="KdfCounterMode", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_KdfCtrInput( - input - ), - ) - + return DafnyRequest(operation_name="KdfCounterMode", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_KdfCtrInput(input)) def _serialize_aes_kdf_counter_mode(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="AesKdfCounterMode", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AesKdfCtrInput( - input - ), - ) - + return DafnyRequest(operation_name="AesKdfCounterMode", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AesKdfCtrInput(input)) def _serialize_aes_encrypt(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="AESEncrypt", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AESEncryptInput( - input - ), - ) - + return DafnyRequest(operation_name="AESEncrypt", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AESEncryptInput(input)) def _serialize_aes_decrypt(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="AESDecrypt", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AESDecryptInput( - input - ), - ) - + return DafnyRequest(operation_name="AESDecrypt", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AESDecryptInput(input)) def _serialize_generate_rsa_key_pair(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GenerateRSAKeyPair", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateRSAKeyPairInput( - input - ), - ) - + return DafnyRequest(operation_name="GenerateRSAKeyPair", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateRSAKeyPairInput(input)) def _serialize_get_rsa_key_modulus_length(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GetRSAKeyModulusLength", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GetRSAKeyModulusLengthInput( - input - ), - ) - + return DafnyRequest(operation_name="GetRSAKeyModulusLength", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GetRSAKeyModulusLengthInput(input)) def _serialize_rsa_decrypt(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="RSADecrypt", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSADecryptInput( - input - ), - ) - + return DafnyRequest(operation_name="RSADecrypt", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSADecryptInput(input)) def _serialize_rsa_encrypt(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="RSAEncrypt", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAEncryptInput( - input - ), - ) - + return DafnyRequest(operation_name="RSAEncrypt", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAEncryptInput(input)) def _serialize_generate_ecdsa_signature_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GenerateECDSASignatureKey", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateECDSASignatureKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="GenerateECDSASignatureKey", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateECDSASignatureKeyInput(input)) def _serialize_ecdsa_sign(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="ECDSASign", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignInput( - input - ), - ) - + return DafnyRequest(operation_name="ECDSASign", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignInput(input)) def _serialize_ecdsa_verify(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="ECDSAVerify", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSAVerifyInput( - input - ), - ) - + return DafnyRequest(operation_name="ECDSAVerify", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSAVerifyInput(input)) def _serialize_generate_ecc_key_pair(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GenerateECCKeyPair", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateECCKeyPairInput( - input - ), - ) - + return DafnyRequest(operation_name="GenerateECCKeyPair", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GenerateECCKeyPairInput(input)) def _serialize_get_public_key_from_private_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GetPublicKeyFromPrivateKey", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="GetPublicKeyFromPrivateKey", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput(input)) def _serialize_validate_public_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="ValidatePublicKey", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ValidatePublicKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="ValidatePublicKey", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ValidatePublicKeyInput(input)) def _serialize_derive_shared_secret(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="DeriveSharedSecret", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DeriveSharedSecretInput( - input - ), - ) - + return DafnyRequest(operation_name="DeriveSharedSecret", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DeriveSharedSecretInput(input)) def _serialize_compress_public_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CompressPublicKey", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_CompressPublicKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="CompressPublicKey", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_CompressPublicKeyInput(input)) def _serialize_decompress_public_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="DecompressPublicKey", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DecompressPublicKeyInput( - input - ), - ) - + return DafnyRequest(operation_name="DecompressPublicKey", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DecompressPublicKeyInput(input)) def _serialize_parse_public_key(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="ParsePublicKey", - dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ParsePublicKeyInput( - input - ), - ) + return DafnyRequest(operation_name="ParsePublicKey", dafny_operation_input=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ParsePublicKeyInput(input)) diff --git a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/smithy_to_dafny.py b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/smithy_to_dafny.py index 726fc76f7..758699a4d 100644 --- a/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/smithy_to_dafny.py +++ b/AwsCryptographyPrimitives/runtimes/python/src/aws_cryptography_primitives/smithygenerated/aws_cryptography_primitives/smithy_to_dafny.py @@ -73,125 +73,81 @@ def aws_cryptography_primitives_GenerateRandomBytesInput(native_input): length=native_input.length, ) - def aws_cryptography_primitives_DigestInput(native_input): return DafnyDigestInput( - digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.digest_algorithm - ), + digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.digest_algorithm), message=Seq(native_input.message), ) - def aws_cryptography_primitives_DigestAlgorithm(native_input): - if native_input == "SHA_512": + if native_input == 'SHA_512': return DigestAlgorithm_SHA__512() - elif native_input == "SHA_384": + elif native_input == 'SHA_384': return DigestAlgorithm_SHA__384() - elif native_input == "SHA_256": + elif native_input == 'SHA_256': return DigestAlgorithm_SHA__256() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_primitives_HMacInput(native_input): return DafnyHMacInput( - digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.digest_algorithm - ), + digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.digest_algorithm), key=Seq(native_input.key), message=Seq(native_input.message), ) - def aws_cryptography_primitives_HkdfExtractInput(native_input): return DafnyHkdfExtractInput( - digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.digest_algorithm - ), - salt=( - (Option_Some(Seq(native_input.salt))) - if (native_input.salt is not None) - else (Option_None()) - ), + digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.digest_algorithm), + salt=((Option_Some(Seq(native_input.salt))) if (native_input.salt is not None) else (Option_None())), ikm=Seq(native_input.ikm), ) - def aws_cryptography_primitives_HkdfExpandInput(native_input): return DafnyHkdfExpandInput( - digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.digest_algorithm - ), + digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.digest_algorithm), prk=Seq(native_input.prk), info=Seq(native_input.info), expectedLength=native_input.expected_length, ) - def aws_cryptography_primitives_HkdfInput(native_input): return DafnyHkdfInput( - digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.digest_algorithm - ), - salt=( - (Option_Some(Seq(native_input.salt))) - if (native_input.salt is not None) - else (Option_None()) - ), + digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.digest_algorithm), + salt=((Option_Some(Seq(native_input.salt))) if (native_input.salt is not None) else (Option_None())), ikm=Seq(native_input.ikm), info=Seq(native_input.info), expectedLength=native_input.expected_length, ) - def aws_cryptography_primitives_KdfCtrInput(native_input): return DafnyKdfCtrInput( - digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm( - native_input.digest_algorithm - ), + digestAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_DigestAlgorithm(native_input.digest_algorithm), ikm=Seq(native_input.ikm), expectedLength=native_input.expected_length, - purpose=( - (Option_Some(Seq(native_input.purpose))) - if (native_input.purpose is not None) - else (Option_None()) - ), - nonce=( - (Option_Some(Seq(native_input.nonce))) - if (native_input.nonce is not None) - else (Option_None()) - ), + purpose=((Option_Some(Seq(native_input.purpose))) if (native_input.purpose is not None) else (Option_None())), + nonce=((Option_Some(Seq(native_input.nonce))) if (native_input.nonce is not None) else (Option_None())), ) - def aws_cryptography_primitives_AesKdfCtrInput(native_input): return DafnyAesKdfCtrInput( ikm=Seq(native_input.ikm), expectedLength=native_input.expected_length, - nonce=( - (Option_Some(Seq(native_input.nonce))) - if (native_input.nonce is not None) - else (Option_None()) - ), + nonce=((Option_Some(Seq(native_input.nonce))) if (native_input.nonce is not None) else (Option_None())), ) - def aws_cryptography_primitives_AESEncryptInput(native_input): return DafnyAESEncryptInput( - encAlg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AES_GCM( - native_input.enc_alg - ), + encAlg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AES_GCM(native_input.enc_alg), iv=Seq(native_input.iv), key=Seq(native_input.key), msg=Seq(native_input.msg), aad=Seq(native_input.aad), ) - def aws_cryptography_primitives_AES_GCM(native_input): return DafnyAES_GCM( keyLength=native_input.key_length, @@ -199,12 +155,9 @@ def aws_cryptography_primitives_AES_GCM(native_input): ivLength=native_input.iv_length, ) - def aws_cryptography_primitives_AESDecryptInput(native_input): return DafnyAESDecryptInput( - encAlg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AES_GCM( - native_input.enc_alg - ), + encAlg=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_AES_GCM(native_input.enc_alg), key=Seq(native_input.key), cipherTxt=Seq(native_input.cipher_txt), authTag=Seq(native_input.auth_tag), @@ -212,355 +165,260 @@ def aws_cryptography_primitives_AESDecryptInput(native_input): aad=Seq(native_input.aad), ) - def aws_cryptography_primitives_GenerateRSAKeyPairInput(native_input): return DafnyGenerateRSAKeyPairInput( lengthBits=native_input.length_bits, ) - def aws_cryptography_primitives_GetRSAKeyModulusLengthInput(native_input): return DafnyGetRSAKeyModulusLengthInput( publicKey=Seq(native_input.public_key), ) - def aws_cryptography_primitives_RSADecryptInput(native_input): return DafnyRSADecryptInput( - padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPaddingMode( - native_input.padding - ), + padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPaddingMode(native_input.padding), privateKey=Seq(native_input.private_key), cipherText=Seq(native_input.cipher_text), ) - def aws_cryptography_primitives_RSAPaddingMode(native_input): - if native_input == "PKCS1": + if native_input == 'PKCS1': return RSAPaddingMode_PKCS1() - elif native_input == "OAEP_SHA1": + elif native_input == 'OAEP_SHA1': return RSAPaddingMode_OAEP__SHA1() - elif native_input == "OAEP_SHA256": + elif native_input == 'OAEP_SHA256': return RSAPaddingMode_OAEP__SHA256() - elif native_input == "OAEP_SHA384": + elif native_input == 'OAEP_SHA384': return RSAPaddingMode_OAEP__SHA384() - elif native_input == "OAEP_SHA512": + elif native_input == 'OAEP_SHA512': return RSAPaddingMode_OAEP__SHA512() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_primitives_RSAEncryptInput(native_input): return DafnyRSAEncryptInput( - padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPaddingMode( - native_input.padding - ), + padding=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPaddingMode(native_input.padding), publicKey=Seq(native_input.public_key), plaintext=Seq(native_input.plaintext), ) - def aws_cryptography_primitives_GenerateECDSASignatureKeyInput(native_input): return DafnyGenerateECDSASignatureKeyInput( - signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm( - native_input.signature_algorithm - ), + signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm(native_input.signature_algorithm), ) - def aws_cryptography_primitives_ECDSASignatureAlgorithm(native_input): - if native_input == "ECDSA_P384": + if native_input == 'ECDSA_P384': return ECDSASignatureAlgorithm_ECDSA__P384() - elif native_input == "ECDSA_P256": + elif native_input == 'ECDSA_P256': return ECDSASignatureAlgorithm_ECDSA__P256() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_primitives_ECDSASignInput(native_input): return DafnyECDSASignInput( - signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm( - native_input.signature_algorithm - ), + signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm(native_input.signature_algorithm), signingKey=Seq(native_input.signing_key), message=Seq(native_input.message), ) - def aws_cryptography_primitives_ECDSAVerifyInput(native_input): return DafnyECDSAVerifyInput( - signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm( - native_input.signature_algorithm - ), + signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm(native_input.signature_algorithm), verificationKey=Seq(native_input.verification_key), message=Seq(native_input.message), signature=Seq(native_input.signature), ) - def aws_cryptography_primitives_GenerateECCKeyPairInput(native_input): return DafnyGenerateECCKeyPairInput( - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), ) - def aws_cryptography_primitives_ECDHCurveSpec(native_input): - if native_input == "ECC_NIST_P256": + if native_input == 'ECC_NIST_P256': return ECDHCurveSpec_ECC__NIST__P256() - elif native_input == "ECC_NIST_P384": + elif native_input == 'ECC_NIST_P384': return ECDHCurveSpec_ECC__NIST__P384() - elif native_input == "ECC_NIST_P521": + elif native_input == 'ECC_NIST_P521': return ECDHCurveSpec_ECC__NIST__P521() - elif native_input == "SM2": + elif native_input == 'SM2': return ECDHCurveSpec_SM2() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') def aws_cryptography_primitives_GetPublicKeyFromPrivateKeyInput(native_input): return DafnyGetPublicKeyFromPrivateKeyInput( - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), - privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey( - native_input.private_key - ), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), + privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey(native_input.private_key), ) - def aws_cryptography_primitives_ECCPrivateKey(native_input): return DafnyECCPrivateKey( pem=Seq(native_input.pem), ) - def aws_cryptography_primitives_ValidatePublicKeyInput(native_input): return DafnyValidatePublicKeyInput( - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), publicKey=Seq(native_input.public_key), ) - def aws_cryptography_primitives_DeriveSharedSecretInput(native_input): return DafnyDeriveSharedSecretInput( - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), - privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey( - native_input.private_key - ), - publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey( - native_input.public_key - ), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), + privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey(native_input.private_key), + publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey(native_input.public_key), ) - def aws_cryptography_primitives_ECCPublicKey(native_input): return DafnyECCPublicKey( der=Seq(native_input.der), ) - def aws_cryptography_primitives_CompressPublicKeyInput(native_input): return DafnyCompressPublicKeyInput( - publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey( - native_input.public_key - ), - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), + publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey(native_input.public_key), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), ) - def aws_cryptography_primitives_DecompressPublicKeyInput(native_input): return DafnyDecompressPublicKeyInput( compressedPublicKey=Seq(native_input.compressed_public_key), - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), ) - def aws_cryptography_primitives_ParsePublicKeyInput(native_input): return DafnyParsePublicKeyInput( publicKey=Seq(native_input.public_key), ) - def aws_cryptography_primitives_GenerateRandomBytesOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_DigestOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_HMacOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_HkdfExtractOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_HkdfExpandOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_HkdfOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_KdfCtrOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_AesKdfCtrOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_AESEncryptOutput(native_input): return DafnyAESEncryptOutput( cipherText=Seq(native_input.cipher_text), authTag=Seq(native_input.auth_tag), ) - def aws_cryptography_primitives_AESDecryptOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_GenerateRSAKeyPairOutput(native_input): return DafnyGenerateRSAKeyPairOutput( - publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPublicKey( - native_input.public_key - ), - privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPrivateKey( - native_input.private_key - ), + publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPublicKey(native_input.public_key), + privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_RSAPrivateKey(native_input.private_key), ) - def aws_cryptography_primitives_RSAPublicKey(native_input): return DafnyRSAPublicKey( lengthBits=native_input.length_bits, pem=Seq(native_input.pem), ) - def aws_cryptography_primitives_RSAPrivateKey(native_input): return DafnyRSAPrivateKey( lengthBits=native_input.length_bits, pem=Seq(native_input.pem), ) - def aws_cryptography_primitives_GetRSAKeyModulusLengthOutput(native_input): return DafnyGetRSAKeyModulusLengthOutput( length=native_input.length, ) - def aws_cryptography_primitives_RSADecryptOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_RSAEncryptOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_GenerateECDSASignatureKeyOutput(native_input): return DafnyGenerateECDSASignatureKeyOutput( - signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm( - native_input.signature_algorithm - ), + signatureAlgorithm=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDSASignatureAlgorithm(native_input.signature_algorithm), verificationKey=Seq(native_input.verification_key), signingKey=Seq(native_input.signing_key), ) - def aws_cryptography_primitives_ECDSASignOutput(native_input): return Seq(native_input) - def aws_cryptography_primitives_ECDSAVerifyOutput(native_input): return native_input - def aws_cryptography_primitives_GenerateECCKeyPairOutput(native_input): return DafnyGenerateECCKeyPairOutput( - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), - privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey( - native_input.private_key - ), - publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey( - native_input.public_key - ), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), + privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey(native_input.private_key), + publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey(native_input.public_key), ) - def aws_cryptography_primitives_GetPublicKeyFromPrivateKeyOutput(native_input): return DafnyGetPublicKeyFromPrivateKeyOutput( - eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec( - native_input.ecc_curve - ), - privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey( - native_input.private_key - ), + eccCurve=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECDHCurveSpec(native_input.ecc_curve), + privateKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPrivateKey(native_input.private_key), publicKey=Seq(native_input.public_key), ) - def aws_cryptography_primitives_ValidatePublicKeyOutput(native_input): return DafnyValidatePublicKeyOutput( success=native_input.success, ) - def aws_cryptography_primitives_DeriveSharedSecretOutput(native_input): return DafnyDeriveSharedSecretOutput( sharedSecret=Seq(native_input.shared_secret), ) - def aws_cryptography_primitives_CompressPublicKeyOutput(native_input): return DafnyCompressPublicKeyOutput( compressedPublicKey=Seq(native_input.compressed_public_key), ) - def aws_cryptography_primitives_DecompressPublicKeyOutput(native_input): return DafnyDecompressPublicKeyOutput( - publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey( - native_input.public_key - ), + publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey(native_input.public_key), ) - def aws_cryptography_primitives_ParsePublicKeyOutput(native_input): return DafnyParsePublicKeyOutput( - publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey( - native_input.public_key - ), + publicKey=aws_cryptography_primitives.smithygenerated.aws_cryptography_primitives.smithy_to_dafny.aws_cryptography_primitives_ECCPublicKey(native_input.public_key), ) - def aws_cryptography_primitives_CryptoConfig(native_input): - return DafnyCryptoConfig() + return DafnyCryptoConfig( + ) diff --git a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/__init__.py b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/__init__.py index 09be6133b..89d64801a 100644 --- a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/__init__.py +++ b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/__init__.py @@ -1,3 +1,4 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. + diff --git a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/aws_sdk_to_dafny.py b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/aws_sdk_to_dafny.py index 71af58dff..e19744c40 100644 --- a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/aws_sdk_to_dafny.py +++ b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/aws_sdk_to_dafny.py @@ -302,1036 +302,283 @@ def com_amazonaws_kms_AlreadyExistsException(native_input): return Error_AlreadyExistsException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CloudHsmClusterInUseException(native_input): return Error_CloudHsmClusterInUseException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException(native_input): return Error_CloudHsmClusterInvalidConfigurationException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CloudHsmClusterNotActiveException(native_input): return Error_CloudHsmClusterNotActiveException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CloudHsmClusterNotFoundException(native_input): return Error_CloudHsmClusterNotFoundException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CloudHsmClusterNotRelatedException(native_input): return Error_CloudHsmClusterNotRelatedException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_ConflictException(native_input): return Error_ConflictException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CustomKeyStoreHasCMKsException(native_input): return Error_CustomKeyStoreHasCMKsException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CustomKeyStoreInvalidStateException(native_input): return Error_CustomKeyStoreInvalidStateException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CustomKeyStoreNameInUseException(native_input): return Error_CustomKeyStoreNameInUseException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CustomKeyStoreNotFoundException(native_input): return Error_CustomKeyStoreNotFoundException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DependencyTimeoutException(native_input): return Error_DependencyTimeoutException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DisabledException(native_input): return Error_DisabledException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DryRunOperationException(native_input): return Error_DryRunOperationException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_ExpiredImportTokenException(native_input): return Error_ExpiredImportTokenException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_IncorrectKeyException(native_input): return Error_IncorrectKeyException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_IncorrectKeyMaterialException(native_input): return Error_IncorrectKeyMaterialException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_IncorrectTrustAnchorException(native_input): return Error_IncorrectTrustAnchorException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidAliasNameException(native_input): return Error_InvalidAliasNameException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidArnException(native_input): return Error_InvalidArnException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidCiphertextException(native_input): return Error_InvalidCiphertextException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidGrantIdException(native_input): return Error_InvalidGrantIdException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidGrantTokenException(native_input): return Error_InvalidGrantTokenException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidImportTokenException(native_input): return Error_InvalidImportTokenException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidKeyUsageException(native_input): return Error_InvalidKeyUsageException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_InvalidMarkerException(native_input): return Error_InvalidMarkerException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_KeyUnavailableException(native_input): return Error_KeyUnavailableException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_KMSInternalException(native_input): return Error_KMSInternalException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_KMSInvalidMacException(native_input): return Error_KMSInvalidMacException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_KMSInvalidSignatureException(native_input): return Error_KMSInvalidSignatureException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_KMSInvalidStateException(native_input): return Error_KMSInvalidStateException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_LimitExceededException(native_input): return Error_LimitExceededException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_MalformedPolicyDocumentException(native_input): return Error_MalformedPolicyDocumentException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_NotFoundException(native_input): return Error_NotFoundException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_TagException(native_input): return Error_TagException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_UnsupportedOperationException(native_input): return Error_UnsupportedOperationException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksKeyAlreadyInUseException(native_input): return Error_XksKeyAlreadyInUseException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksKeyInvalidConfigurationException(native_input): return Error_XksKeyInvalidConfigurationException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksKeyNotFoundException(native_input): return Error_XksKeyNotFoundException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException(native_input): return Error_XksProxyIncorrectAuthenticationCredentialException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyInvalidConfigurationException(native_input): return Error_XksProxyInvalidConfigurationException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyInvalidResponseException(native_input): return Error_XksProxyInvalidResponseException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyUriEndpointInUseException(native_input): return Error_XksProxyUriEndpointInUseException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyUriInUseException(native_input): return Error_XksProxyUriInUseException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyUriUnreachableException(native_input): return Error_XksProxyUriUnreachableException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException(native_input): return Error_XksProxyVpcEndpointServiceInUseException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - ) - - -def com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException( - native_input, -): - return Error_XksProxyVpcEndpointServiceInvalidConfigurationException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) +def com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException(native_input): + return Error_XksProxyVpcEndpointServiceInvalidConfigurationException( + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), + ) def com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException(native_input): return Error_XksProxyVpcEndpointServiceNotFoundException( - message=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Error"]["Message"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + message=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input['Error']["Message"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CancelKeyDeletionRequest(native_input): return DafnyCancelKeyDeletionRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CancelKeyDeletionResponse(native_input): return DafnyCancelKeyDeletionResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ConnectCustomKeyStoreRequest(native_input): return DafnyConnectCustomKeyStoreRequest( - CustomKeyStoreId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["CustomKeyStoreId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + CustomKeyStoreId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_ConnectCustomKeyStoreResponse(native_input): - return DafnyConnectCustomKeyStoreResponse() - + return DafnyConnectCustomKeyStoreResponse( + ) def com_amazonaws_kms_CreateAliasRequest(native_input): return DafnyCreateAliasRequest( - AliasName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["AliasName"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - TargetKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["TargetKeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + AliasName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AliasName"].encode('utf-16-be'))]*2)])), + TargetKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["TargetKeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CreateCustomKeyStoreRequest(native_input): return DafnyCreateCustomKeyStoreRequest( - CustomKeyStoreName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["CustomKeyStoreName"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - CloudHsmClusterId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CloudHsmClusterId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CloudHsmClusterId" in native_input.keys() - else Option_None() - ), - TrustAnchorCertificate=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["TrustAnchorCertificate"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "TrustAnchorCertificate" in native_input.keys() - else Option_None() - ), - KeyStorePassword=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["KeyStorePassword"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "KeyStorePassword" in native_input.keys() - else Option_None() - ), - CustomKeyStoreType=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreType( - native_input["CustomKeyStoreType"] - ) - ) - if "CustomKeyStoreType" in native_input.keys() - else Option_None() - ), - XksProxyUriEndpoint=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["XksProxyUriEndpoint"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "XksProxyUriEndpoint" in native_input.keys() - else Option_None() - ), - XksProxyUriPath=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["XksProxyUriPath"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "XksProxyUriPath" in native_input.keys() - else Option_None() - ), - XksProxyVpcEndpointServiceName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input[ - "XksProxyVpcEndpointServiceName" - ].encode("utf-16-be") - ) - ] - * 2 - ) - ] - ) - ) - ) - if "XksProxyVpcEndpointServiceName" in native_input.keys() - else Option_None() - ), - XksProxyAuthenticationCredential=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyAuthenticationCredentialType( - native_input["XksProxyAuthenticationCredential"] - ) - ) - if "XksProxyAuthenticationCredential" in native_input.keys() - else Option_None() - ), - XksProxyConnectivity=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConnectivityType( - native_input["XksProxyConnectivity"] - ) - ) - if "XksProxyConnectivity" in native_input.keys() - else Option_None() - ), + CustomKeyStoreName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreName"].encode('utf-16-be'))]*2)])), + CloudHsmClusterId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CloudHsmClusterId"].encode('utf-16-be'))]*2)]))) if "CloudHsmClusterId" in native_input.keys() else Option_None(), + TrustAnchorCertificate=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["TrustAnchorCertificate"].encode('utf-16-be'))]*2)]))) if "TrustAnchorCertificate" in native_input.keys() else Option_None(), + KeyStorePassword=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyStorePassword"].encode('utf-16-be'))]*2)]))) if "KeyStorePassword" in native_input.keys() else Option_None(), + CustomKeyStoreType=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreType(native_input["CustomKeyStoreType"])) if "CustomKeyStoreType" in native_input.keys() else Option_None(), + XksProxyUriEndpoint=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["XksProxyUriEndpoint"].encode('utf-16-be'))]*2)]))) if "XksProxyUriEndpoint" in native_input.keys() else Option_None(), + XksProxyUriPath=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["XksProxyUriPath"].encode('utf-16-be'))]*2)]))) if "XksProxyUriPath" in native_input.keys() else Option_None(), + XksProxyVpcEndpointServiceName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["XksProxyVpcEndpointServiceName"].encode('utf-16-be'))]*2)]))) if "XksProxyVpcEndpointServiceName" in native_input.keys() else Option_None(), + XksProxyAuthenticationCredential=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyAuthenticationCredentialType(native_input["XksProxyAuthenticationCredential"])) if "XksProxyAuthenticationCredential" in native_input.keys() else Option_None(), + XksProxyConnectivity=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConnectivityType(native_input["XksProxyConnectivity"])) if "XksProxyConnectivity" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_CustomKeyStoreType(native_input): # Convert CustomKeyStoreType if native_input == "AWS_CLOUDHSM": @@ -1341,33 +588,12 @@ def com_amazonaws_kms_CustomKeyStoreType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_XksProxyAuthenticationCredentialType(native_input): return DafnyXksProxyAuthenticationCredentialType( - AccessKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["AccessKeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - RawSecretAccessKey=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["RawSecretAccessKey"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + AccessKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AccessKeyId"].encode('utf-16-be'))]*2)])), + RawSecretAccessKey=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["RawSecretAccessKey"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_XksProxyConnectivityType(native_input): # Convert XksProxyConnectivityType if native_input == "PUBLIC_ENDPOINT": @@ -1377,143 +603,23 @@ def com_amazonaws_kms_XksProxyConnectivityType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_CreateCustomKeyStoreResponse(native_input): return DafnyCreateCustomKeyStoreResponse( - CustomKeyStoreId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreId" in native_input.keys() - else Option_None() - ), + CustomKeyStoreId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreId" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_CreateGrantRequest(native_input): return DafnyCreateGrantRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - GranteePrincipal=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GranteePrincipal"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - RetiringPrincipal=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["RetiringPrincipal"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "RetiringPrincipal" in native_input.keys() - else Option_None() - ), - Operations=Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantOperation( - list_element - ) - for list_element in native_input["Operations"] - ] - ), - Constraints=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantConstraints( - native_input["Constraints"] - ) - ) - if "Constraints" in native_input.keys() - else Option_None() - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - Name=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Name"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Name" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + GranteePrincipal=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GranteePrincipal"].encode('utf-16-be'))]*2)])), + RetiringPrincipal=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["RetiringPrincipal"].encode('utf-16-be'))]*2)]))) if "RetiringPrincipal" in native_input.keys() else Option_None(), + Operations=Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantOperation(list_element) for list_element in native_input["Operations"]]), + Constraints=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantConstraints(native_input["Constraints"])) if "Constraints" in native_input.keys() else Option_None(), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + Name=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Name"].encode('utf-16-be'))]*2)]))) if "Name" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GrantOperation(native_input): # Convert GrantOperation if native_input == "Decrypt": @@ -1553,252 +659,33 @@ def com_amazonaws_kms_GrantOperation(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_GrantConstraints(native_input): return DafnyGrantConstraints( - EncryptionContextSubset=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input[ - "EncryptionContextSubset" - ].items() - } - ) - ) - if "EncryptionContextSubset" in native_input.keys() - else Option_None() - ), - EncryptionContextEquals=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input[ - "EncryptionContextEquals" - ].items() - } - ) - ) - if "EncryptionContextEquals" in native_input.keys() - else Option_None() - ), + EncryptionContextSubset=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContextSubset"].items() })) if "EncryptionContextSubset" in native_input.keys() else Option_None(), + EncryptionContextEquals=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContextEquals"].items() })) if "EncryptionContextEquals" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_CreateGrantResponse(native_input): return DafnyCreateGrantResponse( - GrantToken=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GrantToken"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "GrantToken" in native_input.keys() - else Option_None() - ), - GrantId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GrantId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "GrantId" in native_input.keys() - else Option_None() - ), + GrantToken=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GrantToken"].encode('utf-16-be'))]*2)]))) if "GrantToken" in native_input.keys() else Option_None(), + GrantId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GrantId"].encode('utf-16-be'))]*2)]))) if "GrantId" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_CreateKeyRequest(native_input): return DafnyCreateKeyRequest( - Policy=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Policy"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Policy" in native_input.keys() - else Option_None() - ), - Description=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Description"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "Description" in native_input.keys() - else Option_None() - ), - KeyUsage=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUsageType( - native_input["KeyUsage"] - ) - ) - if "KeyUsage" in native_input.keys() - else Option_None() - ), - CustomerMasterKeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomerMasterKeySpec( - native_input["CustomerMasterKeySpec"] - ) - ) - if "CustomerMasterKeySpec" in native_input.keys() - else Option_None() - ), - KeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeySpec( - native_input["KeySpec"] - ) - ) - if "KeySpec" in native_input.keys() - else Option_None() - ), - Origin=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_OriginType( - native_input["Origin"] - ) - ) - if "Origin" in native_input.keys() - else Option_None() - ), - CustomKeyStoreId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreId" in native_input.keys() - else Option_None() - ), - BypassPolicyLockoutSafetyCheck=( - Option_Some(native_input["BypassPolicyLockoutSafetyCheck"]) - if "BypassPolicyLockoutSafetyCheck" in native_input.keys() - else Option_None() - ), - Tags=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag( - list_element - ) - for list_element in native_input["Tags"] - ] - ) - ) - if "Tags" in native_input.keys() - else Option_None() - ), - MultiRegion=( - Option_Some(native_input["MultiRegion"]) - if "MultiRegion" in native_input.keys() - else Option_None() - ), - XksKeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["XksKeyId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "XksKeyId" in native_input.keys() - else Option_None() - ), + Policy=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Policy"].encode('utf-16-be'))]*2)]))) if "Policy" in native_input.keys() else Option_None(), + Description=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Description"].encode('utf-16-be'))]*2)]))) if "Description" in native_input.keys() else Option_None(), + KeyUsage=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUsageType(native_input["KeyUsage"])) if "KeyUsage" in native_input.keys() else Option_None(), + CustomerMasterKeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomerMasterKeySpec(native_input["CustomerMasterKeySpec"])) if "CustomerMasterKeySpec" in native_input.keys() else Option_None(), + KeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeySpec(native_input["KeySpec"])) if "KeySpec" in native_input.keys() else Option_None(), + Origin=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_OriginType(native_input["Origin"])) if "Origin" in native_input.keys() else Option_None(), + CustomKeyStoreId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreId" in native_input.keys() else Option_None(), + BypassPolicyLockoutSafetyCheck=Option_Some(native_input["BypassPolicyLockoutSafetyCheck"]) if "BypassPolicyLockoutSafetyCheck" in native_input.keys() else Option_None(), + Tags=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag(list_element) for list_element in native_input["Tags"]])) if "Tags" in native_input.keys() else Option_None(), + MultiRegion=Option_Some(native_input["MultiRegion"]) if "MultiRegion" in native_input.keys() else Option_None(), + XksKeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["XksKeyId"].encode('utf-16-be'))]*2)]))) if "XksKeyId" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_KeyUsageType(native_input): # Convert KeyUsageType if native_input == "SIGN_VERIFY": @@ -1812,7 +699,6 @@ def com_amazonaws_kms_KeyUsageType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_CustomerMasterKeySpec(native_input): # Convert CustomerMasterKeySpec if native_input == "RSA_2048": @@ -1844,7 +730,6 @@ def com_amazonaws_kms_CustomerMasterKeySpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_KeySpec(native_input): # Convert KeySpec if native_input == "RSA_2048": @@ -1876,7 +761,6 @@ def com_amazonaws_kms_KeySpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_OriginType(native_input): # Convert OriginType if native_input == "AWS_KMS": @@ -1890,328 +774,46 @@ def com_amazonaws_kms_OriginType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_Tag(native_input): return DafnyTag( - TagKey=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["TagKey"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - TagValue=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["TagValue"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + TagKey=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["TagKey"].encode('utf-16-be'))]*2)])), + TagValue=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["TagValue"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_CreateKeyResponse(native_input): return DafnyCreateKeyResponse( - KeyMetadata=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyMetadata( - native_input["KeyMetadata"] - ) - ) - if "KeyMetadata" in native_input.keys() - else Option_None() - ), + KeyMetadata=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyMetadata(native_input["KeyMetadata"])) if "KeyMetadata" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_KeyMetadata(native_input): return DafnyKeyMetadata( - AWSAccountId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["AWSAccountId"].encode("utf-16-be") - ) - ] - * 2 - ) - ] - ) - ) - ) - if "AWSAccountId" in native_input.keys() - else Option_None() - ), - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - Arn=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Arn"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Arn" in native_input.keys() - else Option_None() - ), - CreationDate=( - Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) - if "CreationDate" in native_input.keys() - else Option_None() - ), - Enabled=( - Option_Some(native_input["Enabled"]) - if "Enabled" in native_input.keys() - else Option_None() - ), - Description=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Description"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "Description" in native_input.keys() - else Option_None() - ), - KeyUsage=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUsageType( - native_input["KeyUsage"] - ) - ) - if "KeyUsage" in native_input.keys() - else Option_None() - ), - KeyState=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyState( - native_input["KeyState"] - ) - ) - if "KeyState" in native_input.keys() - else Option_None() - ), - DeletionDate=( - Option_Some(_dafny.Seq(native_input["DeletionDate"].isoformat())) - if "DeletionDate" in native_input.keys() - else Option_None() - ), - ValidTo=( - Option_Some(_dafny.Seq(native_input["ValidTo"].isoformat())) - if "ValidTo" in native_input.keys() - else Option_None() - ), - Origin=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_OriginType( - native_input["Origin"] - ) - ) - if "Origin" in native_input.keys() - else Option_None() - ), - CustomKeyStoreId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreId" in native_input.keys() - else Option_None() - ), - CloudHsmClusterId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CloudHsmClusterId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CloudHsmClusterId" in native_input.keys() - else Option_None() - ), - ExpirationModel=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ExpirationModelType( - native_input["ExpirationModel"] - ) - ) - if "ExpirationModel" in native_input.keys() - else Option_None() - ), - KeyManager=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyManagerType( - native_input["KeyManager"] - ) - ) - if "KeyManager" in native_input.keys() - else Option_None() - ), - CustomerMasterKeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomerMasterKeySpec( - native_input["CustomerMasterKeySpec"] - ) - ) - if "CustomerMasterKeySpec" in native_input.keys() - else Option_None() - ), - KeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeySpec( - native_input["KeySpec"] - ) - ) - if "KeySpec" in native_input.keys() - else Option_None() - ), - EncryptionAlgorithms=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - list_element - ) - for list_element in native_input["EncryptionAlgorithms"] - ] - ) - ) - if "EncryptionAlgorithms" in native_input.keys() - else Option_None() - ), - SigningAlgorithms=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec( - list_element - ) - for list_element in native_input["SigningAlgorithms"] - ] - ) - ) - if "SigningAlgorithms" in native_input.keys() - else Option_None() - ), - KeyAgreementAlgorithms=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - list_element - ) - for list_element in native_input["KeyAgreementAlgorithms"] - ] - ) - ) - if "KeyAgreementAlgorithms" in native_input.keys() - else Option_None() - ), - MultiRegion=( - Option_Some(native_input["MultiRegion"]) - if "MultiRegion" in native_input.keys() - else Option_None() - ), - MultiRegionConfiguration=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionConfiguration( - native_input["MultiRegionConfiguration"] - ) - ) - if "MultiRegionConfiguration" in native_input.keys() - else Option_None() - ), - PendingDeletionWindowInDays=( - Option_Some(native_input["PendingDeletionWindowInDays"]) - if "PendingDeletionWindowInDays" in native_input.keys() - else Option_None() - ), - MacAlgorithms=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec( - list_element - ) - for list_element in native_input["MacAlgorithms"] - ] - ) - ) - if "MacAlgorithms" in native_input.keys() - else Option_None() - ), - XksKeyConfiguration=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyConfigurationType( - native_input["XksKeyConfiguration"] - ) - ) - if "XksKeyConfiguration" in native_input.keys() - else Option_None() - ), + AWSAccountId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AWSAccountId"].encode('utf-16-be'))]*2)]))) if "AWSAccountId" in native_input.keys() else Option_None(), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + Arn=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Arn"].encode('utf-16-be'))]*2)]))) if "Arn" in native_input.keys() else Option_None(), + CreationDate=Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) if "CreationDate" in native_input.keys() else Option_None(), + Enabled=Option_Some(native_input["Enabled"]) if "Enabled" in native_input.keys() else Option_None(), + Description=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Description"].encode('utf-16-be'))]*2)]))) if "Description" in native_input.keys() else Option_None(), + KeyUsage=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUsageType(native_input["KeyUsage"])) if "KeyUsage" in native_input.keys() else Option_None(), + KeyState=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyState(native_input["KeyState"])) if "KeyState" in native_input.keys() else Option_None(), + DeletionDate=Option_Some(_dafny.Seq(native_input["DeletionDate"].isoformat())) if "DeletionDate" in native_input.keys() else Option_None(), + ValidTo=Option_Some(_dafny.Seq(native_input["ValidTo"].isoformat())) if "ValidTo" in native_input.keys() else Option_None(), + Origin=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_OriginType(native_input["Origin"])) if "Origin" in native_input.keys() else Option_None(), + CustomKeyStoreId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreId" in native_input.keys() else Option_None(), + CloudHsmClusterId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CloudHsmClusterId"].encode('utf-16-be'))]*2)]))) if "CloudHsmClusterId" in native_input.keys() else Option_None(), + ExpirationModel=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ExpirationModelType(native_input["ExpirationModel"])) if "ExpirationModel" in native_input.keys() else Option_None(), + KeyManager=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyManagerType(native_input["KeyManager"])) if "KeyManager" in native_input.keys() else Option_None(), + CustomerMasterKeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomerMasterKeySpec(native_input["CustomerMasterKeySpec"])) if "CustomerMasterKeySpec" in native_input.keys() else Option_None(), + KeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeySpec(native_input["KeySpec"])) if "KeySpec" in native_input.keys() else Option_None(), + EncryptionAlgorithms=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(list_element) for list_element in native_input["EncryptionAlgorithms"]])) if "EncryptionAlgorithms" in native_input.keys() else Option_None(), + SigningAlgorithms=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec(list_element) for list_element in native_input["SigningAlgorithms"]])) if "SigningAlgorithms" in native_input.keys() else Option_None(), + KeyAgreementAlgorithms=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec(list_element) for list_element in native_input["KeyAgreementAlgorithms"]])) if "KeyAgreementAlgorithms" in native_input.keys() else Option_None(), + MultiRegion=Option_Some(native_input["MultiRegion"]) if "MultiRegion" in native_input.keys() else Option_None(), + MultiRegionConfiguration=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionConfiguration(native_input["MultiRegionConfiguration"])) if "MultiRegionConfiguration" in native_input.keys() else Option_None(), + PendingDeletionWindowInDays=Option_Some(native_input["PendingDeletionWindowInDays"]) if "PendingDeletionWindowInDays" in native_input.keys() else Option_None(), + MacAlgorithms=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec(list_element) for list_element in native_input["MacAlgorithms"]])) if "MacAlgorithms" in native_input.keys() else Option_None(), + XksKeyConfiguration=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyConfigurationType(native_input["XksKeyConfiguration"])) if "XksKeyConfiguration" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_KeyState(native_input): # Convert KeyState if native_input == "Creating": @@ -2233,7 +835,6 @@ def com_amazonaws_kms_KeyState(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_ExpirationModelType(native_input): # Convert ExpirationModelType if native_input == "KEY_MATERIAL_EXPIRES": @@ -2243,7 +844,6 @@ def com_amazonaws_kms_ExpirationModelType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_KeyManagerType(native_input): # Convert KeyManagerType if native_input == "AWS": @@ -2253,7 +853,6 @@ def com_amazonaws_kms_KeyManagerType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_EncryptionAlgorithmSpec(native_input): # Convert EncryptionAlgorithmSpec if native_input == "SYMMETRIC_DEFAULT": @@ -2265,7 +864,6 @@ def com_amazonaws_kms_EncryptionAlgorithmSpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_SigningAlgorithmSpec(native_input): # Convert SigningAlgorithmSpec if native_input == "RSASSA_PSS_SHA_256": @@ -2291,7 +889,6 @@ def com_amazonaws_kms_SigningAlgorithmSpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_KeyAgreementAlgorithmSpec(native_input): # Convert KeyAgreementAlgorithmSpec if native_input == "ECDH": @@ -2299,44 +896,13 @@ def com_amazonaws_kms_KeyAgreementAlgorithmSpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_MultiRegionConfiguration(native_input): return DafnyMultiRegionConfiguration( - MultiRegionKeyType=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionKeyType( - native_input["MultiRegionKeyType"] - ) - ) - if "MultiRegionKeyType" in native_input.keys() - else Option_None() - ), - PrimaryKey=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionKey( - native_input["PrimaryKey"] - ) - ) - if "PrimaryKey" in native_input.keys() - else Option_None() - ), - ReplicaKeys=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionKey( - list_element - ) - for list_element in native_input["ReplicaKeys"] - ] - ) - ) - if "ReplicaKeys" in native_input.keys() - else Option_None() - ), + MultiRegionKeyType=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionKeyType(native_input["MultiRegionKeyType"])) if "MultiRegionKeyType" in native_input.keys() else Option_None(), + PrimaryKey=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionKey(native_input["PrimaryKey"])) if "PrimaryKey" in native_input.keys() else Option_None(), + ReplicaKeys=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MultiRegionKey(list_element) for list_element in native_input["ReplicaKeys"]])) if "ReplicaKeys" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_MacAlgorithmSpec(native_input): # Convert MacAlgorithmSpec if native_input == "HMAC_SHA_224": @@ -2350,28 +916,11 @@ def com_amazonaws_kms_MacAlgorithmSpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_XksKeyConfigurationType(native_input): return DafnyXksKeyConfigurationType( - Id=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Id"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Id" in native_input.keys() - else Option_None() - ), + Id=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Id"].encode('utf-16-be'))]*2)]))) if "Id" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_MultiRegionKeyType(native_input): # Convert MultiRegionKeyType if native_input == "PRIMARY": @@ -2381,159 +930,29 @@ def com_amazonaws_kms_MultiRegionKeyType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_MultiRegionKey(native_input): return DafnyMultiRegionKey( - Arn=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Arn"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Arn" in native_input.keys() - else Option_None() - ), - Region=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Region"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Region" in native_input.keys() - else Option_None() - ), + Arn=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Arn"].encode('utf-16-be'))]*2)]))) if "Arn" in native_input.keys() else Option_None(), + Region=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Region"].encode('utf-16-be'))]*2)]))) if "Region" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DecryptRequest(native_input): return DafnyDecryptRequest( CiphertextBlob=Seq(native_input["CiphertextBlob"]), - EncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input["EncryptionContext"].items() - } - ) - ) - if "EncryptionContext" in native_input.keys() - else Option_None() - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - EncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["EncryptionAlgorithm"] - ) - ) - if "EncryptionAlgorithm" in native_input.keys() - else Option_None() - ), - Recipient=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo( - native_input["Recipient"] - ) - ) - if "Recipient" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + EncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContext"].items() })) if "EncryptionContext" in native_input.keys() else Option_None(), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + EncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["EncryptionAlgorithm"])) if "EncryptionAlgorithm" in native_input.keys() else Option_None(), + Recipient=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo(native_input["Recipient"])) if "Recipient" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_RecipientInfo(native_input): return DafnyRecipientInfo( - KeyEncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyEncryptionMechanism( - native_input["KeyEncryptionAlgorithm"] - ) - ) - if "KeyEncryptionAlgorithm" in native_input.keys() - else Option_None() - ), - AttestationDocument=( - Option_Some(Seq(native_input["AttestationDocument"])) - if "AttestationDocument" in native_input.keys() - else Option_None() - ), + KeyEncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyEncryptionMechanism(native_input["KeyEncryptionAlgorithm"])) if "KeyEncryptionAlgorithm" in native_input.keys() else Option_None(), + AttestationDocument=Option_Some(Seq(native_input["AttestationDocument"])) if "AttestationDocument" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_KeyEncryptionMechanism(native_input): # Convert KeyEncryptionMechanism if native_input == "RSAES_OAEP_SHA_256": @@ -2541,451 +960,80 @@ def com_amazonaws_kms_KeyEncryptionMechanism(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_DecryptResponse(native_input): return DafnyDecryptResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - Plaintext=( - Option_Some(Seq(native_input["Plaintext"])) - if "Plaintext" in native_input.keys() - else Option_None() - ), - EncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["EncryptionAlgorithm"] - ) - ) - if "EncryptionAlgorithm" in native_input.keys() - else Option_None() - ), - CiphertextForRecipient=( - Option_Some(Seq(native_input["CiphertextForRecipient"])) - if "CiphertextForRecipient" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + Plaintext=Option_Some(Seq(native_input["Plaintext"])) if "Plaintext" in native_input.keys() else Option_None(), + EncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["EncryptionAlgorithm"])) if "EncryptionAlgorithm" in native_input.keys() else Option_None(), + CiphertextForRecipient=Option_Some(Seq(native_input["CiphertextForRecipient"])) if "CiphertextForRecipient" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DeleteAliasRequest(native_input): return DafnyDeleteAliasRequest( - AliasName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["AliasName"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + AliasName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AliasName"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DeleteCustomKeyStoreRequest(native_input): return DafnyDeleteCustomKeyStoreRequest( - CustomKeyStoreId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["CustomKeyStoreId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + CustomKeyStoreId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DeleteCustomKeyStoreResponse(native_input): - return DafnyDeleteCustomKeyStoreResponse() - + return DafnyDeleteCustomKeyStoreResponse( + ) def com_amazonaws_kms_DeleteImportedKeyMaterialRequest(native_input): return DafnyDeleteImportedKeyMaterialRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DeriveSharedSecretRequest(native_input): return DafnyDeriveSharedSecretRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - KeyAgreementAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - native_input["KeyAgreementAlgorithm"] - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + KeyAgreementAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec(native_input["KeyAgreementAlgorithm"]), PublicKey=Seq(native_input["PublicKey"]), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), - Recipient=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo( - native_input["Recipient"] - ) - ) - if "Recipient" in native_input.keys() - else Option_None() - ), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), + Recipient=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo(native_input["Recipient"])) if "Recipient" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DeriveSharedSecretResponse(native_input): return DafnyDeriveSharedSecretResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - SharedSecret=( - Option_Some(Seq(native_input["SharedSecret"])) - if "SharedSecret" in native_input.keys() - else Option_None() - ), - CiphertextForRecipient=( - Option_Some(Seq(native_input["CiphertextForRecipient"])) - if "CiphertextForRecipient" in native_input.keys() - else Option_None() - ), - KeyAgreementAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - native_input["KeyAgreementAlgorithm"] - ) - ) - if "KeyAgreementAlgorithm" in native_input.keys() - else Option_None() - ), - KeyOrigin=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_OriginType( - native_input["KeyOrigin"] - ) - ) - if "KeyOrigin" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + SharedSecret=Option_Some(Seq(native_input["SharedSecret"])) if "SharedSecret" in native_input.keys() else Option_None(), + CiphertextForRecipient=Option_Some(Seq(native_input["CiphertextForRecipient"])) if "CiphertextForRecipient" in native_input.keys() else Option_None(), + KeyAgreementAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec(native_input["KeyAgreementAlgorithm"])) if "KeyAgreementAlgorithm" in native_input.keys() else Option_None(), + KeyOrigin=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_OriginType(native_input["KeyOrigin"])) if "KeyOrigin" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DescribeCustomKeyStoresRequest(native_input): return DafnyDescribeCustomKeyStoresRequest( - CustomKeyStoreId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreId" in native_input.keys() - else Option_None() - ), - CustomKeyStoreName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreName"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreName" in native_input.keys() - else Option_None() - ), - Limit=( - Option_Some(native_input["Limit"]) - if "Limit" in native_input.keys() - else Option_None() - ), - Marker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Marker"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Marker" in native_input.keys() - else Option_None() - ), + CustomKeyStoreId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreId" in native_input.keys() else Option_None(), + CustomKeyStoreName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreName"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreName" in native_input.keys() else Option_None(), + Limit=Option_Some(native_input["Limit"]) if "Limit" in native_input.keys() else Option_None(), + Marker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Marker"].encode('utf-16-be'))]*2)]))) if "Marker" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DescribeCustomKeyStoresResponse(native_input): return DafnyDescribeCustomKeyStoresResponse( - CustomKeyStores=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoresListEntry( - list_element - ) - for list_element in native_input["CustomKeyStores"] - ] - ) - ) - if "CustomKeyStores" in native_input.keys() - else Option_None() - ), - NextMarker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["NextMarker"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "NextMarker" in native_input.keys() - else Option_None() - ), - Truncated=( - Option_Some(native_input["Truncated"]) - if "Truncated" in native_input.keys() - else Option_None() - ), + CustomKeyStores=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoresListEntry(list_element) for list_element in native_input["CustomKeyStores"]])) if "CustomKeyStores" in native_input.keys() else Option_None(), + NextMarker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NextMarker"].encode('utf-16-be'))]*2)]))) if "NextMarker" in native_input.keys() else Option_None(), + Truncated=Option_Some(native_input["Truncated"]) if "Truncated" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_CustomKeyStoresListEntry(native_input): return DafnyCustomKeyStoresListEntry( - CustomKeyStoreId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreId" in native_input.keys() - else Option_None() - ), - CustomKeyStoreName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreName"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreName" in native_input.keys() - else Option_None() - ), - CloudHsmClusterId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CloudHsmClusterId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CloudHsmClusterId" in native_input.keys() - else Option_None() - ), - TrustAnchorCertificate=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["TrustAnchorCertificate"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "TrustAnchorCertificate" in native_input.keys() - else Option_None() - ), - ConnectionState=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConnectionStateType( - native_input["ConnectionState"] - ) - ) - if "ConnectionState" in native_input.keys() - else Option_None() - ), - ConnectionErrorCode=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConnectionErrorCodeType( - native_input["ConnectionErrorCode"] - ) - ) - if "ConnectionErrorCode" in native_input.keys() - else Option_None() - ), - CreationDate=( - Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) - if "CreationDate" in native_input.keys() - else Option_None() - ), - CustomKeyStoreType=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreType( - native_input["CustomKeyStoreType"] - ) - ) - if "CustomKeyStoreType" in native_input.keys() - else Option_None() - ), - XksProxyConfiguration=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConfigurationType( - native_input["XksProxyConfiguration"] - ) - ) - if "XksProxyConfiguration" in native_input.keys() - else Option_None() - ), + CustomKeyStoreId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreId" in native_input.keys() else Option_None(), + CustomKeyStoreName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreName"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreName" in native_input.keys() else Option_None(), + CloudHsmClusterId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CloudHsmClusterId"].encode('utf-16-be'))]*2)]))) if "CloudHsmClusterId" in native_input.keys() else Option_None(), + TrustAnchorCertificate=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["TrustAnchorCertificate"].encode('utf-16-be'))]*2)]))) if "TrustAnchorCertificate" in native_input.keys() else Option_None(), + ConnectionState=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConnectionStateType(native_input["ConnectionState"])) if "ConnectionState" in native_input.keys() else Option_None(), + ConnectionErrorCode=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConnectionErrorCodeType(native_input["ConnectionErrorCode"])) if "ConnectionErrorCode" in native_input.keys() else Option_None(), + CreationDate=Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) if "CreationDate" in native_input.keys() else Option_None(), + CustomKeyStoreType=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreType(native_input["CustomKeyStoreType"])) if "CustomKeyStoreType" in native_input.keys() else Option_None(), + XksProxyConfiguration=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConfigurationType(native_input["XksProxyConfiguration"])) if "XksProxyConfiguration" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ConnectionStateType(native_input): # Convert ConnectionStateType if native_input == "CONNECTED": @@ -3001,7 +1049,6 @@ def com_amazonaws_kms_ConnectionStateType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_ConnectionErrorCodeType(native_input): # Convert ConnectionErrorCodeType if native_input == "INVALID_CREDENTIALS": @@ -3035,9 +1082,7 @@ def com_amazonaws_kms_ConnectionErrorCodeType(native_input): elif native_input == "XKS_PROXY_INVALID_CONFIGURATION": return ConnectionErrorCodeType_XKS__PROXY__INVALID__CONFIGURATION() elif native_input == "XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION": - return ( - ConnectionErrorCodeType_XKS__VPC__ENDPOINT__SERVICE__INVALID__CONFIGURATION() - ) + return ConnectionErrorCodeType_XKS__VPC__ENDPOINT__SERVICE__INVALID__CONFIGURATION() elif native_input == "XKS_PROXY_TIMED_OUT": return ConnectionErrorCodeType_XKS__PROXY__TIMED__OUT() elif native_input == "XKS_PROXY_INVALID_TLS_CONFIGURATION": @@ -3045,439 +1090,84 @@ def com_amazonaws_kms_ConnectionErrorCodeType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_XksProxyConfigurationType(native_input): return DafnyXksProxyConfigurationType( - Connectivity=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConnectivityType( - native_input["Connectivity"] - ) - ) - if "Connectivity" in native_input.keys() - else Option_None() - ), - AccessKeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["AccessKeyId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "AccessKeyId" in native_input.keys() - else Option_None() - ), - UriEndpoint=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["UriEndpoint"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "UriEndpoint" in native_input.keys() - else Option_None() - ), - UriPath=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["UriPath"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "UriPath" in native_input.keys() - else Option_None() - ), - VpcEndpointServiceName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["VpcEndpointServiceName"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "VpcEndpointServiceName" in native_input.keys() - else Option_None() - ), + Connectivity=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConnectivityType(native_input["Connectivity"])) if "Connectivity" in native_input.keys() else Option_None(), + AccessKeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AccessKeyId"].encode('utf-16-be'))]*2)]))) if "AccessKeyId" in native_input.keys() else Option_None(), + UriEndpoint=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["UriEndpoint"].encode('utf-16-be'))]*2)]))) if "UriEndpoint" in native_input.keys() else Option_None(), + UriPath=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["UriPath"].encode('utf-16-be'))]*2)]))) if "UriPath" in native_input.keys() else Option_None(), + VpcEndpointServiceName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["VpcEndpointServiceName"].encode('utf-16-be'))]*2)]))) if "VpcEndpointServiceName" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DescribeKeyRequest(native_input): return DafnyDescribeKeyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DescribeKeyResponse(native_input): return DafnyDescribeKeyResponse( - KeyMetadata=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyMetadata( - native_input["KeyMetadata"] - ) - ) - if "KeyMetadata" in native_input.keys() - else Option_None() - ), + KeyMetadata=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyMetadata(native_input["KeyMetadata"])) if "KeyMetadata" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DisableKeyRequest(native_input): return DafnyDisableKeyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DisableKeyRotationRequest(native_input): return DafnyDisableKeyRotationRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DisconnectCustomKeyStoreRequest(native_input): return DafnyDisconnectCustomKeyStoreRequest( - CustomKeyStoreId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["CustomKeyStoreId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + CustomKeyStoreId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_DisconnectCustomKeyStoreResponse(native_input): - return DafnyDisconnectCustomKeyStoreResponse() - + return DafnyDisconnectCustomKeyStoreResponse( + ) def com_amazonaws_kms_EnableKeyRequest(native_input): return DafnyEnableKeyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_EnableKeyRotationRequest(native_input): return DafnyEnableKeyRotationRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - RotationPeriodInDays=( - Option_Some(native_input["RotationPeriodInDays"]) - if "RotationPeriodInDays" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + RotationPeriodInDays=Option_Some(native_input["RotationPeriodInDays"]) if "RotationPeriodInDays" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_EncryptRequest(native_input): return DafnyEncryptRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), Plaintext=Seq(native_input["Plaintext"]), - EncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input["EncryptionContext"].items() - } - ) - ) - if "EncryptionContext" in native_input.keys() - else Option_None() - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - EncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["EncryptionAlgorithm"] - ) - ) - if "EncryptionAlgorithm" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + EncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContext"].items() })) if "EncryptionContext" in native_input.keys() else Option_None(), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + EncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["EncryptionAlgorithm"])) if "EncryptionAlgorithm" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_EncryptResponse(native_input): return DafnyEncryptResponse( - CiphertextBlob=( - Option_Some(Seq(native_input["CiphertextBlob"])) - if "CiphertextBlob" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - EncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["EncryptionAlgorithm"] - ) - ) - if "EncryptionAlgorithm" in native_input.keys() - else Option_None() - ), + CiphertextBlob=Option_Some(Seq(native_input["CiphertextBlob"])) if "CiphertextBlob" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + EncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["EncryptionAlgorithm"])) if "EncryptionAlgorithm" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateDataKeyRequest(native_input): return DafnyGenerateDataKeyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - EncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input["EncryptionContext"].items() - } - ) - ) - if "EncryptionContext" in native_input.keys() - else Option_None() - ), - NumberOfBytes=( - Option_Some(native_input["NumberOfBytes"]) - if "NumberOfBytes" in native_input.keys() - else Option_None() - ), - KeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeySpec( - native_input["KeySpec"] - ) - ) - if "KeySpec" in native_input.keys() - else Option_None() - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - Recipient=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo( - native_input["Recipient"] - ) - ) - if "Recipient" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + EncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContext"].items() })) if "EncryptionContext" in native_input.keys() else Option_None(), + NumberOfBytes=Option_Some(native_input["NumberOfBytes"]) if "NumberOfBytes" in native_input.keys() else Option_None(), + KeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeySpec(native_input["KeySpec"])) if "KeySpec" in native_input.keys() else Option_None(), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + Recipient=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo(native_input["Recipient"])) if "Recipient" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DataKeySpec(native_input): # Convert DataKeySpec if native_input == "AES_256": @@ -3487,126 +1177,24 @@ def com_amazonaws_kms_DataKeySpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_GenerateDataKeyResponse(native_input): return DafnyGenerateDataKeyResponse( - CiphertextBlob=( - Option_Some(Seq(native_input["CiphertextBlob"])) - if "CiphertextBlob" in native_input.keys() - else Option_None() - ), - Plaintext=( - Option_Some(Seq(native_input["Plaintext"])) - if "Plaintext" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - CiphertextForRecipient=( - Option_Some(Seq(native_input["CiphertextForRecipient"])) - if "CiphertextForRecipient" in native_input.keys() - else Option_None() - ), + CiphertextBlob=Option_Some(Seq(native_input["CiphertextBlob"])) if "CiphertextBlob" in native_input.keys() else Option_None(), + Plaintext=Option_Some(Seq(native_input["Plaintext"])) if "Plaintext" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + CiphertextForRecipient=Option_Some(Seq(native_input["CiphertextForRecipient"])) if "CiphertextForRecipient" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateDataKeyPairRequest(native_input): return DafnyGenerateDataKeyPairRequest( - EncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input["EncryptionContext"].items() - } - ) - ) - if "EncryptionContext" in native_input.keys() - else Option_None() - ), - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - KeyPairSpec=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec( - native_input["KeyPairSpec"] - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - Recipient=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo( - native_input["Recipient"] - ) - ) - if "Recipient" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + EncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContext"].items() })) if "EncryptionContext" in native_input.keys() else Option_None(), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + KeyPairSpec=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec(native_input["KeyPairSpec"]), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + Recipient=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo(native_input["Recipient"])) if "Recipient" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_DataKeyPairSpec(native_input): # Convert DataKeyPairSpec if native_input == "RSA_2048": @@ -3628,568 +1216,111 @@ def com_amazonaws_kms_DataKeyPairSpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_GenerateDataKeyPairResponse(native_input): return DafnyGenerateDataKeyPairResponse( - PrivateKeyCiphertextBlob=( - Option_Some(Seq(native_input["PrivateKeyCiphertextBlob"])) - if "PrivateKeyCiphertextBlob" in native_input.keys() - else Option_None() - ), - PrivateKeyPlaintext=( - Option_Some(Seq(native_input["PrivateKeyPlaintext"])) - if "PrivateKeyPlaintext" in native_input.keys() - else Option_None() - ), - PublicKey=( - Option_Some(Seq(native_input["PublicKey"])) - if "PublicKey" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - KeyPairSpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec( - native_input["KeyPairSpec"] - ) - ) - if "KeyPairSpec" in native_input.keys() - else Option_None() - ), - CiphertextForRecipient=( - Option_Some(Seq(native_input["CiphertextForRecipient"])) - if "CiphertextForRecipient" in native_input.keys() - else Option_None() - ), + PrivateKeyCiphertextBlob=Option_Some(Seq(native_input["PrivateKeyCiphertextBlob"])) if "PrivateKeyCiphertextBlob" in native_input.keys() else Option_None(), + PrivateKeyPlaintext=Option_Some(Seq(native_input["PrivateKeyPlaintext"])) if "PrivateKeyPlaintext" in native_input.keys() else Option_None(), + PublicKey=Option_Some(Seq(native_input["PublicKey"])) if "PublicKey" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + KeyPairSpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec(native_input["KeyPairSpec"])) if "KeyPairSpec" in native_input.keys() else Option_None(), + CiphertextForRecipient=Option_Some(Seq(native_input["CiphertextForRecipient"])) if "CiphertextForRecipient" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest(native_input): return DafnyGenerateDataKeyPairWithoutPlaintextRequest( - EncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input["EncryptionContext"].items() - } - ) - ) - if "EncryptionContext" in native_input.keys() - else Option_None() - ), - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - KeyPairSpec=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec( - native_input["KeyPairSpec"] - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + EncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContext"].items() })) if "EncryptionContext" in native_input.keys() else Option_None(), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + KeyPairSpec=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec(native_input["KeyPairSpec"]), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse(native_input): return DafnyGenerateDataKeyPairWithoutPlaintextResponse( - PrivateKeyCiphertextBlob=( - Option_Some(Seq(native_input["PrivateKeyCiphertextBlob"])) - if "PrivateKeyCiphertextBlob" in native_input.keys() - else Option_None() - ), - PublicKey=( - Option_Some(Seq(native_input["PublicKey"])) - if "PublicKey" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - KeyPairSpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec( - native_input["KeyPairSpec"] - ) - ) - if "KeyPairSpec" in native_input.keys() - else Option_None() - ), + PrivateKeyCiphertextBlob=Option_Some(Seq(native_input["PrivateKeyCiphertextBlob"])) if "PrivateKeyCiphertextBlob" in native_input.keys() else Option_None(), + PublicKey=Option_Some(Seq(native_input["PublicKey"])) if "PublicKey" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + KeyPairSpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeyPairSpec(native_input["KeyPairSpec"])) if "KeyPairSpec" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest(native_input): return DafnyGenerateDataKeyWithoutPlaintextRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - EncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input["EncryptionContext"].items() - } - ) - ) - if "EncryptionContext" in native_input.keys() - else Option_None() - ), - KeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeySpec( - native_input["KeySpec"] - ) - ) - if "KeySpec" in native_input.keys() - else Option_None() - ), - NumberOfBytes=( - Option_Some(native_input["NumberOfBytes"]) - if "NumberOfBytes" in native_input.keys() - else Option_None() - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + EncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["EncryptionContext"].items() })) if "EncryptionContext" in native_input.keys() else Option_None(), + KeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DataKeySpec(native_input["KeySpec"])) if "KeySpec" in native_input.keys() else Option_None(), + NumberOfBytes=Option_Some(native_input["NumberOfBytes"]) if "NumberOfBytes" in native_input.keys() else Option_None(), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse(native_input): return DafnyGenerateDataKeyWithoutPlaintextResponse( - CiphertextBlob=( - Option_Some(Seq(native_input["CiphertextBlob"])) - if "CiphertextBlob" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), + CiphertextBlob=Option_Some(Seq(native_input["CiphertextBlob"])) if "CiphertextBlob" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateMacRequest(native_input): return DafnyGenerateMacRequest( Message=Seq(native_input["Message"]), - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - MacAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec( - native_input["MacAlgorithm"] - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + MacAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec(native_input["MacAlgorithm"]), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateMacResponse(native_input): return DafnyGenerateMacResponse( - Mac=( - Option_Some(Seq(native_input["Mac"])) - if "Mac" in native_input.keys() - else Option_None() - ), - MacAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec( - native_input["MacAlgorithm"] - ) - ) - if "MacAlgorithm" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), + Mac=Option_Some(Seq(native_input["Mac"])) if "Mac" in native_input.keys() else Option_None(), + MacAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec(native_input["MacAlgorithm"])) if "MacAlgorithm" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateRandomRequest(native_input): return DafnyGenerateRandomRequest( - NumberOfBytes=( - Option_Some(native_input["NumberOfBytes"]) - if "NumberOfBytes" in native_input.keys() - else Option_None() - ), - CustomKeyStoreId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CustomKeyStoreId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CustomKeyStoreId" in native_input.keys() - else Option_None() - ), - Recipient=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo( - native_input["Recipient"] - ) - ) - if "Recipient" in native_input.keys() - else Option_None() - ), + NumberOfBytes=Option_Some(native_input["NumberOfBytes"]) if "NumberOfBytes" in native_input.keys() else Option_None(), + CustomKeyStoreId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)]))) if "CustomKeyStoreId" in native_input.keys() else Option_None(), + Recipient=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RecipientInfo(native_input["Recipient"])) if "Recipient" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GenerateRandomResponse(native_input): return DafnyGenerateRandomResponse( - Plaintext=( - Option_Some(Seq(native_input["Plaintext"])) - if "Plaintext" in native_input.keys() - else Option_None() - ), - CiphertextForRecipient=( - Option_Some(Seq(native_input["CiphertextForRecipient"])) - if "CiphertextForRecipient" in native_input.keys() - else Option_None() - ), + Plaintext=Option_Some(Seq(native_input["Plaintext"])) if "Plaintext" in native_input.keys() else Option_None(), + CiphertextForRecipient=Option_Some(Seq(native_input["CiphertextForRecipient"])) if "CiphertextForRecipient" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GetKeyPolicyRequest(native_input): return DafnyGetKeyPolicyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - PolicyName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["PolicyName"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "PolicyName" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + PolicyName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["PolicyName"].encode('utf-16-be'))]*2)]))) if "PolicyName" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GetKeyPolicyResponse(native_input): return DafnyGetKeyPolicyResponse( - Policy=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Policy"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Policy" in native_input.keys() - else Option_None() - ), - PolicyName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["PolicyName"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "PolicyName" in native_input.keys() - else Option_None() - ), + Policy=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Policy"].encode('utf-16-be'))]*2)]))) if "Policy" in native_input.keys() else Option_None(), + PolicyName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["PolicyName"].encode('utf-16-be'))]*2)]))) if "PolicyName" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GetKeyRotationStatusRequest(native_input): return DafnyGetKeyRotationStatusRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_GetKeyRotationStatusResponse(native_input): return DafnyGetKeyRotationStatusResponse( - KeyRotationEnabled=( - Option_Some(native_input["KeyRotationEnabled"]) - if "KeyRotationEnabled" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - RotationPeriodInDays=( - Option_Some(native_input["RotationPeriodInDays"]) - if "RotationPeriodInDays" in native_input.keys() - else Option_None() - ), - NextRotationDate=( - Option_Some(_dafny.Seq(native_input["NextRotationDate"].isoformat())) - if "NextRotationDate" in native_input.keys() - else Option_None() - ), - OnDemandRotationStartDate=( - Option_Some( - _dafny.Seq(native_input["OnDemandRotationStartDate"].isoformat()) - ) - if "OnDemandRotationStartDate" in native_input.keys() - else Option_None() - ), + KeyRotationEnabled=Option_Some(native_input["KeyRotationEnabled"]) if "KeyRotationEnabled" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + RotationPeriodInDays=Option_Some(native_input["RotationPeriodInDays"]) if "RotationPeriodInDays" in native_input.keys() else Option_None(), + NextRotationDate=Option_Some(_dafny.Seq(native_input["NextRotationDate"].isoformat())) if "NextRotationDate" in native_input.keys() else Option_None(), + OnDemandRotationStartDate=Option_Some(_dafny.Seq(native_input["OnDemandRotationStartDate"].isoformat())) if "OnDemandRotationStartDate" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GetParametersForImportRequest(native_input): return DafnyGetParametersForImportRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - WrappingAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_AlgorithmSpec( - native_input["WrappingAlgorithm"] - ), - WrappingKeySpec=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_WrappingKeySpec( - native_input["WrappingKeySpec"] - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + WrappingAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_AlgorithmSpec(native_input["WrappingAlgorithm"]), + WrappingKeySpec=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_WrappingKeySpec(native_input["WrappingKeySpec"]), ) - def com_amazonaws_kms_AlgorithmSpec(native_input): # Convert AlgorithmSpec if native_input == "RSAES_PKCS1_V1_5": @@ -4207,7 +1338,6 @@ def com_amazonaws_kms_AlgorithmSpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_WrappingKeySpec(native_input): # Convert WrappingKeySpec if native_input == "RSA_2048": @@ -4221,820 +1351,132 @@ def com_amazonaws_kms_WrappingKeySpec(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_GetParametersForImportResponse(native_input): return DafnyGetParametersForImportResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - ImportToken=( - Option_Some(Seq(native_input["ImportToken"])) - if "ImportToken" in native_input.keys() - else Option_None() - ), - PublicKey=( - Option_Some(Seq(native_input["PublicKey"])) - if "PublicKey" in native_input.keys() - else Option_None() - ), - ParametersValidTo=( - Option_Some(_dafny.Seq(native_input["ParametersValidTo"].isoformat())) - if "ParametersValidTo" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + ImportToken=Option_Some(Seq(native_input["ImportToken"])) if "ImportToken" in native_input.keys() else Option_None(), + PublicKey=Option_Some(Seq(native_input["PublicKey"])) if "PublicKey" in native_input.keys() else Option_None(), + ParametersValidTo=Option_Some(_dafny.Seq(native_input["ParametersValidTo"].isoformat())) if "ParametersValidTo" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GetPublicKeyRequest(native_input): return DafnyGetPublicKeyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GetPublicKeyResponse(native_input): return DafnyGetPublicKeyResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - PublicKey=( - Option_Some(Seq(native_input["PublicKey"])) - if "PublicKey" in native_input.keys() - else Option_None() - ), - CustomerMasterKeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomerMasterKeySpec( - native_input["CustomerMasterKeySpec"] - ) - ) - if "CustomerMasterKeySpec" in native_input.keys() - else Option_None() - ), - KeySpec=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeySpec( - native_input["KeySpec"] - ) - ) - if "KeySpec" in native_input.keys() - else Option_None() - ), - KeyUsage=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUsageType( - native_input["KeyUsage"] - ) - ) - if "KeyUsage" in native_input.keys() - else Option_None() - ), - EncryptionAlgorithms=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - list_element - ) - for list_element in native_input["EncryptionAlgorithms"] - ] - ) - ) - if "EncryptionAlgorithms" in native_input.keys() - else Option_None() - ), - SigningAlgorithms=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec( - list_element - ) - for list_element in native_input["SigningAlgorithms"] - ] - ) - ) - if "SigningAlgorithms" in native_input.keys() - else Option_None() - ), - KeyAgreementAlgorithms=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - list_element - ) - for list_element in native_input["KeyAgreementAlgorithms"] - ] - ) - ) - if "KeyAgreementAlgorithms" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + PublicKey=Option_Some(Seq(native_input["PublicKey"])) if "PublicKey" in native_input.keys() else Option_None(), + CustomerMasterKeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomerMasterKeySpec(native_input["CustomerMasterKeySpec"])) if "CustomerMasterKeySpec" in native_input.keys() else Option_None(), + KeySpec=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeySpec(native_input["KeySpec"])) if "KeySpec" in native_input.keys() else Option_None(), + KeyUsage=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUsageType(native_input["KeyUsage"])) if "KeyUsage" in native_input.keys() else Option_None(), + EncryptionAlgorithms=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(list_element) for list_element in native_input["EncryptionAlgorithms"]])) if "EncryptionAlgorithms" in native_input.keys() else Option_None(), + SigningAlgorithms=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec(list_element) for list_element in native_input["SigningAlgorithms"]])) if "SigningAlgorithms" in native_input.keys() else Option_None(), + KeyAgreementAlgorithms=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyAgreementAlgorithmSpec(list_element) for list_element in native_input["KeyAgreementAlgorithms"]])) if "KeyAgreementAlgorithms" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ImportKeyMaterialRequest(native_input): return DafnyImportKeyMaterialRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ImportToken=Seq(native_input["ImportToken"]), EncryptedKeyMaterial=Seq(native_input["EncryptedKeyMaterial"]), - ValidTo=( - Option_Some(_dafny.Seq(native_input["ValidTo"].isoformat())) - if "ValidTo" in native_input.keys() - else Option_None() - ), - ExpirationModel=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ExpirationModelType( - native_input["ExpirationModel"] - ) - ) - if "ExpirationModel" in native_input.keys() - else Option_None() - ), + ValidTo=Option_Some(_dafny.Seq(native_input["ValidTo"].isoformat())) if "ValidTo" in native_input.keys() else Option_None(), + ExpirationModel=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ExpirationModelType(native_input["ExpirationModel"])) if "ExpirationModel" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ImportKeyMaterialResponse(native_input): - return DafnyImportKeyMaterialResponse() - + return DafnyImportKeyMaterialResponse( + ) def com_amazonaws_kms_ListAliasesRequest(native_input): return DafnyListAliasesRequest( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - Limit=( - Option_Some(native_input["Limit"]) - if "Limit" in native_input.keys() - else Option_None() - ), - Marker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Marker"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Marker" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + Limit=Option_Some(native_input["Limit"]) if "Limit" in native_input.keys() else Option_None(), + Marker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Marker"].encode('utf-16-be'))]*2)]))) if "Marker" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListAliasesResponse(native_input): return DafnyListAliasesResponse( - Aliases=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_AliasListEntry( - list_element - ) - for list_element in native_input["Aliases"] - ] - ) - ) - if "Aliases" in native_input.keys() - else Option_None() - ), - NextMarker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["NextMarker"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "NextMarker" in native_input.keys() - else Option_None() - ), - Truncated=( - Option_Some(native_input["Truncated"]) - if "Truncated" in native_input.keys() - else Option_None() - ), + Aliases=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_AliasListEntry(list_element) for list_element in native_input["Aliases"]])) if "Aliases" in native_input.keys() else Option_None(), + NextMarker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NextMarker"].encode('utf-16-be'))]*2)]))) if "NextMarker" in native_input.keys() else Option_None(), + Truncated=Option_Some(native_input["Truncated"]) if "Truncated" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_AliasListEntry(native_input): return DafnyAliasListEntry( - AliasName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["AliasName"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "AliasName" in native_input.keys() - else Option_None() - ), - AliasArn=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["AliasArn"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "AliasArn" in native_input.keys() - else Option_None() - ), - TargetKeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["TargetKeyId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "TargetKeyId" in native_input.keys() - else Option_None() - ), - CreationDate=( - Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) - if "CreationDate" in native_input.keys() - else Option_None() - ), - LastUpdatedDate=( - Option_Some(_dafny.Seq(native_input["LastUpdatedDate"].isoformat())) - if "LastUpdatedDate" in native_input.keys() - else Option_None() - ), + AliasName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AliasName"].encode('utf-16-be'))]*2)]))) if "AliasName" in native_input.keys() else Option_None(), + AliasArn=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AliasArn"].encode('utf-16-be'))]*2)]))) if "AliasArn" in native_input.keys() else Option_None(), + TargetKeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["TargetKeyId"].encode('utf-16-be'))]*2)]))) if "TargetKeyId" in native_input.keys() else Option_None(), + CreationDate=Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) if "CreationDate" in native_input.keys() else Option_None(), + LastUpdatedDate=Option_Some(_dafny.Seq(native_input["LastUpdatedDate"].isoformat())) if "LastUpdatedDate" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListGrantsRequest(native_input): return DafnyListGrantsRequest( - Limit=( - Option_Some(native_input["Limit"]) - if "Limit" in native_input.keys() - else Option_None() - ), - Marker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Marker"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Marker" in native_input.keys() - else Option_None() - ), - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - GrantId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GrantId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "GrantId" in native_input.keys() - else Option_None() - ), - GranteePrincipal=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["GranteePrincipal"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "GranteePrincipal" in native_input.keys() - else Option_None() - ), + Limit=Option_Some(native_input["Limit"]) if "Limit" in native_input.keys() else Option_None(), + Marker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Marker"].encode('utf-16-be'))]*2)]))) if "Marker" in native_input.keys() else Option_None(), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + GrantId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GrantId"].encode('utf-16-be'))]*2)]))) if "GrantId" in native_input.keys() else Option_None(), + GranteePrincipal=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GranteePrincipal"].encode('utf-16-be'))]*2)]))) if "GranteePrincipal" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListGrantsResponse(native_input): return DafnyListGrantsResponse( - Grants=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantListEntry( - list_element - ) - for list_element in native_input["Grants"] - ] - ) - ) - if "Grants" in native_input.keys() - else Option_None() - ), - NextMarker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["NextMarker"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "NextMarker" in native_input.keys() - else Option_None() - ), - Truncated=( - Option_Some(native_input["Truncated"]) - if "Truncated" in native_input.keys() - else Option_None() - ), + Grants=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantListEntry(list_element) for list_element in native_input["Grants"]])) if "Grants" in native_input.keys() else Option_None(), + NextMarker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NextMarker"].encode('utf-16-be'))]*2)]))) if "NextMarker" in native_input.keys() else Option_None(), + Truncated=Option_Some(native_input["Truncated"]) if "Truncated" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_GrantListEntry(native_input): return DafnyGrantListEntry( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - GrantId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GrantId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "GrantId" in native_input.keys() - else Option_None() - ), - Name=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Name"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Name" in native_input.keys() - else Option_None() - ), - CreationDate=( - Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) - if "CreationDate" in native_input.keys() - else Option_None() - ), - GranteePrincipal=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["GranteePrincipal"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "GranteePrincipal" in native_input.keys() - else Option_None() - ), - RetiringPrincipal=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["RetiringPrincipal"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "RetiringPrincipal" in native_input.keys() - else Option_None() - ), - IssuingAccount=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["IssuingAccount"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "IssuingAccount" in native_input.keys() - else Option_None() - ), - Operations=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantOperation( - list_element - ) - for list_element in native_input["Operations"] - ] - ) - ) - if "Operations" in native_input.keys() - else Option_None() - ), - Constraints=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantConstraints( - native_input["Constraints"] - ) - ) - if "Constraints" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + GrantId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GrantId"].encode('utf-16-be'))]*2)]))) if "GrantId" in native_input.keys() else Option_None(), + Name=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Name"].encode('utf-16-be'))]*2)]))) if "Name" in native_input.keys() else Option_None(), + CreationDate=Option_Some(_dafny.Seq(native_input["CreationDate"].isoformat())) if "CreationDate" in native_input.keys() else Option_None(), + GranteePrincipal=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GranteePrincipal"].encode('utf-16-be'))]*2)]))) if "GranteePrincipal" in native_input.keys() else Option_None(), + RetiringPrincipal=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["RetiringPrincipal"].encode('utf-16-be'))]*2)]))) if "RetiringPrincipal" in native_input.keys() else Option_None(), + IssuingAccount=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["IssuingAccount"].encode('utf-16-be'))]*2)]))) if "IssuingAccount" in native_input.keys() else Option_None(), + Operations=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantOperation(list_element) for list_element in native_input["Operations"]])) if "Operations" in native_input.keys() else Option_None(), + Constraints=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GrantConstraints(native_input["Constraints"])) if "Constraints" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListKeyPoliciesRequest(native_input): return DafnyListKeyPoliciesRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - Limit=( - Option_Some(native_input["Limit"]) - if "Limit" in native_input.keys() - else Option_None() - ), - Marker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Marker"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Marker" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + Limit=Option_Some(native_input["Limit"]) if "Limit" in native_input.keys() else Option_None(), + Marker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Marker"].encode('utf-16-be'))]*2)]))) if "Marker" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListKeyPoliciesResponse(native_input): return DafnyListKeyPoliciesResponse( - PolicyNames=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["PolicyNames"] - ] - ) - ) - if "PolicyNames" in native_input.keys() - else Option_None() - ), - NextMarker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["NextMarker"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "NextMarker" in native_input.keys() - else Option_None() - ), - Truncated=( - Option_Some(native_input["Truncated"]) - if "Truncated" in native_input.keys() - else Option_None() - ), + PolicyNames=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["PolicyNames"]])) if "PolicyNames" in native_input.keys() else Option_None(), + NextMarker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NextMarker"].encode('utf-16-be'))]*2)]))) if "NextMarker" in native_input.keys() else Option_None(), + Truncated=Option_Some(native_input["Truncated"]) if "Truncated" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListKeyRotationsRequest(native_input): return DafnyListKeyRotationsRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - Limit=( - Option_Some(native_input["Limit"]) - if "Limit" in native_input.keys() - else Option_None() - ), - Marker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Marker"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Marker" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + Limit=Option_Some(native_input["Limit"]) if "Limit" in native_input.keys() else Option_None(), + Marker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Marker"].encode('utf-16-be'))]*2)]))) if "Marker" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListKeyRotationsResponse(native_input): return DafnyListKeyRotationsResponse( - Rotations=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RotationsListEntry( - list_element - ) - for list_element in native_input["Rotations"] - ] - ) - ) - if "Rotations" in native_input.keys() - else Option_None() - ), - NextMarker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["NextMarker"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "NextMarker" in native_input.keys() - else Option_None() - ), - Truncated=( - Option_Some(native_input["Truncated"]) - if "Truncated" in native_input.keys() - else Option_None() - ), + Rotations=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RotationsListEntry(list_element) for list_element in native_input["Rotations"]])) if "Rotations" in native_input.keys() else Option_None(), + NextMarker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NextMarker"].encode('utf-16-be'))]*2)]))) if "NextMarker" in native_input.keys() else Option_None(), + Truncated=Option_Some(native_input["Truncated"]) if "Truncated" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_RotationsListEntry(native_input): return DafnyRotationsListEntry( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - RotationDate=( - Option_Some(_dafny.Seq(native_input["RotationDate"].isoformat())) - if "RotationDate" in native_input.keys() - else Option_None() - ), - RotationType=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RotationType( - native_input["RotationType"] - ) - ) - if "RotationType" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + RotationDate=Option_Some(_dafny.Seq(native_input["RotationDate"].isoformat())) if "RotationDate" in native_input.keys() else Option_None(), + RotationType=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RotationType(native_input["RotationType"])) if "RotationType" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_RotationType(native_input): # Convert RotationType if native_input == "AUTOMATIC": @@ -5044,805 +1486,135 @@ def com_amazonaws_kms_RotationType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_ListKeysRequest(native_input): return DafnyListKeysRequest( - Limit=( - Option_Some(native_input["Limit"]) - if "Limit" in native_input.keys() - else Option_None() - ), - Marker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Marker"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Marker" in native_input.keys() - else Option_None() - ), + Limit=Option_Some(native_input["Limit"]) if "Limit" in native_input.keys() else Option_None(), + Marker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Marker"].encode('utf-16-be'))]*2)]))) if "Marker" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListKeysResponse(native_input): return DafnyListKeysResponse( - Keys=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyListEntry( - list_element - ) - for list_element in native_input["Keys"] - ] - ) - ) - if "Keys" in native_input.keys() - else Option_None() - ), - NextMarker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["NextMarker"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "NextMarker" in native_input.keys() - else Option_None() - ), - Truncated=( - Option_Some(native_input["Truncated"]) - if "Truncated" in native_input.keys() - else Option_None() - ), + Keys=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyListEntry(list_element) for list_element in native_input["Keys"]])) if "Keys" in native_input.keys() else Option_None(), + NextMarker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NextMarker"].encode('utf-16-be'))]*2)]))) if "NextMarker" in native_input.keys() else Option_None(), + Truncated=Option_Some(native_input["Truncated"]) if "Truncated" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_KeyListEntry(native_input): return DafnyKeyListEntry( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - KeyArn=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyArn"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyArn" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + KeyArn=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyArn"].encode('utf-16-be'))]*2)]))) if "KeyArn" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListResourceTagsRequest(native_input): return DafnyListResourceTagsRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - Limit=( - Option_Some(native_input["Limit"]) - if "Limit" in native_input.keys() - else Option_None() - ), - Marker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Marker"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Marker" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + Limit=Option_Some(native_input["Limit"]) if "Limit" in native_input.keys() else Option_None(), + Marker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Marker"].encode('utf-16-be'))]*2)]))) if "Marker" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ListResourceTagsResponse(native_input): return DafnyListResourceTagsResponse( - Tags=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag( - list_element - ) - for list_element in native_input["Tags"] - ] - ) - ) - if "Tags" in native_input.keys() - else Option_None() - ), - NextMarker=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["NextMarker"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "NextMarker" in native_input.keys() - else Option_None() - ), - Truncated=( - Option_Some(native_input["Truncated"]) - if "Truncated" in native_input.keys() - else Option_None() - ), + Tags=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag(list_element) for list_element in native_input["Tags"]])) if "Tags" in native_input.keys() else Option_None(), + NextMarker=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NextMarker"].encode('utf-16-be'))]*2)]))) if "NextMarker" in native_input.keys() else Option_None(), + Truncated=Option_Some(native_input["Truncated"]) if "Truncated" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_PutKeyPolicyRequest(native_input): return DafnyPutKeyPolicyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - PolicyName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["PolicyName"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "PolicyName" in native_input.keys() - else Option_None() - ), - Policy=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Policy"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - BypassPolicyLockoutSafetyCheck=( - Option_Some(native_input["BypassPolicyLockoutSafetyCheck"]) - if "BypassPolicyLockoutSafetyCheck" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + PolicyName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["PolicyName"].encode('utf-16-be'))]*2)]))) if "PolicyName" in native_input.keys() else Option_None(), + Policy=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Policy"].encode('utf-16-be'))]*2)])), + BypassPolicyLockoutSafetyCheck=Option_Some(native_input["BypassPolicyLockoutSafetyCheck"]) if "BypassPolicyLockoutSafetyCheck" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ReEncryptRequest(native_input): return DafnyReEncryptRequest( CiphertextBlob=Seq(native_input["CiphertextBlob"]), - SourceEncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input[ - "SourceEncryptionContext" - ].items() - } - ) - ) - if "SourceEncryptionContext" in native_input.keys() - else Option_None() - ), - SourceKeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["SourceKeyId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "SourceKeyId" in native_input.keys() - else Option_None() - ), - DestinationKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["DestinationKeyId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - DestinationEncryptionContext=( - Option_Some( - Map( - { - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(key.encode("utf-16-be"))] * 2 - ) - ] - ) - ): Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(value.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for (key, value) in native_input[ - "DestinationEncryptionContext" - ].items() - } - ) - ) - if "DestinationEncryptionContext" in native_input.keys() - else Option_None() - ), - SourceEncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["SourceEncryptionAlgorithm"] - ) - ) - if "SourceEncryptionAlgorithm" in native_input.keys() - else Option_None() - ), - DestinationEncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["DestinationEncryptionAlgorithm"] - ) - ) - if "DestinationEncryptionAlgorithm" in native_input.keys() - else Option_None() - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + SourceEncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["SourceEncryptionContext"].items() })) if "SourceEncryptionContext" in native_input.keys() else Option_None(), + SourceKeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["SourceKeyId"].encode('utf-16-be'))]*2)]))) if "SourceKeyId" in native_input.keys() else Option_None(), + DestinationKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["DestinationKeyId"].encode('utf-16-be'))]*2)])), + DestinationEncryptionContext=Option_Some(Map({Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(key.encode('utf-16-be'))]*2)])): Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(value.encode('utf-16-be'))]*2)])) for (key, value) in native_input["DestinationEncryptionContext"].items() })) if "DestinationEncryptionContext" in native_input.keys() else Option_None(), + SourceEncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["SourceEncryptionAlgorithm"])) if "SourceEncryptionAlgorithm" in native_input.keys() else Option_None(), + DestinationEncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["DestinationEncryptionAlgorithm"])) if "DestinationEncryptionAlgorithm" in native_input.keys() else Option_None(), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ReEncryptResponse(native_input): return DafnyReEncryptResponse( - CiphertextBlob=( - Option_Some(Seq(native_input["CiphertextBlob"])) - if "CiphertextBlob" in native_input.keys() - else Option_None() - ), - SourceKeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["SourceKeyId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "SourceKeyId" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - SourceEncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["SourceEncryptionAlgorithm"] - ) - ) - if "SourceEncryptionAlgorithm" in native_input.keys() - else Option_None() - ), - DestinationEncryptionAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input["DestinationEncryptionAlgorithm"] - ) - ) - if "DestinationEncryptionAlgorithm" in native_input.keys() - else Option_None() - ), + CiphertextBlob=Option_Some(Seq(native_input["CiphertextBlob"])) if "CiphertextBlob" in native_input.keys() else Option_None(), + SourceKeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["SourceKeyId"].encode('utf-16-be'))]*2)]))) if "SourceKeyId" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + SourceEncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["SourceEncryptionAlgorithm"])) if "SourceEncryptionAlgorithm" in native_input.keys() else Option_None(), + DestinationEncryptionAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input["DestinationEncryptionAlgorithm"])) if "DestinationEncryptionAlgorithm" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ReplicateKeyRequest(native_input): return DafnyReplicateKeyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - ReplicaRegion=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["ReplicaRegion"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - Policy=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Policy"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "Policy" in native_input.keys() - else Option_None() - ), - BypassPolicyLockoutSafetyCheck=( - Option_Some(native_input["BypassPolicyLockoutSafetyCheck"]) - if "BypassPolicyLockoutSafetyCheck" in native_input.keys() - else Option_None() - ), - Description=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Description"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "Description" in native_input.keys() - else Option_None() - ), - Tags=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag( - list_element - ) - for list_element in native_input["Tags"] - ] - ) - ) - if "Tags" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + ReplicaRegion=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["ReplicaRegion"].encode('utf-16-be'))]*2)])), + Policy=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Policy"].encode('utf-16-be'))]*2)]))) if "Policy" in native_input.keys() else Option_None(), + BypassPolicyLockoutSafetyCheck=Option_Some(native_input["BypassPolicyLockoutSafetyCheck"]) if "BypassPolicyLockoutSafetyCheck" in native_input.keys() else Option_None(), + Description=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Description"].encode('utf-16-be'))]*2)]))) if "Description" in native_input.keys() else Option_None(), + Tags=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag(list_element) for list_element in native_input["Tags"]])) if "Tags" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ReplicateKeyResponse(native_input): return DafnyReplicateKeyResponse( - ReplicaKeyMetadata=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyMetadata( - native_input["ReplicaKeyMetadata"] - ) - ) - if "ReplicaKeyMetadata" in native_input.keys() - else Option_None() - ), - ReplicaPolicy=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["ReplicaPolicy"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "ReplicaPolicy" in native_input.keys() - else Option_None() - ), - ReplicaTags=( - Option_Some( - Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag( - list_element - ) - for list_element in native_input["ReplicaTags"] - ] - ) - ) - if "ReplicaTags" in native_input.keys() - else Option_None() - ), + ReplicaKeyMetadata=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyMetadata(native_input["ReplicaKeyMetadata"])) if "ReplicaKeyMetadata" in native_input.keys() else Option_None(), + ReplicaPolicy=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["ReplicaPolicy"].encode('utf-16-be'))]*2)]))) if "ReplicaPolicy" in native_input.keys() else Option_None(), + ReplicaTags=Option_Some(Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag(list_element) for list_element in native_input["ReplicaTags"]])) if "ReplicaTags" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_RetireGrantRequest(native_input): return DafnyRetireGrantRequest( - GrantToken=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GrantToken"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ) - ) - if "GrantToken" in native_input.keys() - else Option_None() - ), - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - GrantId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GrantId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "GrantId" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + GrantToken=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GrantToken"].encode('utf-16-be'))]*2)]))) if "GrantToken" in native_input.keys() else Option_None(), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + GrantId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GrantId"].encode('utf-16-be'))]*2)]))) if "GrantId" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_RevokeGrantRequest(native_input): return DafnyRevokeGrantRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - GrantId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["GrantId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + GrantId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["GrantId"].encode('utf-16-be'))]*2)])), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_RotateKeyOnDemandRequest(native_input): return DafnyRotateKeyOnDemandRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_RotateKeyOnDemandResponse(native_input): return DafnyRotateKeyOnDemandResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ScheduleKeyDeletionRequest(native_input): return DafnyScheduleKeyDeletionRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - PendingWindowInDays=( - Option_Some(native_input["PendingWindowInDays"]) - if "PendingWindowInDays" in native_input.keys() - else Option_None() - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + PendingWindowInDays=Option_Some(native_input["PendingWindowInDays"]) if "PendingWindowInDays" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_ScheduleKeyDeletionResponse(native_input): return DafnyScheduleKeyDeletionResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - DeletionDate=( - Option_Some(_dafny.Seq(native_input["DeletionDate"].isoformat())) - if "DeletionDate" in native_input.keys() - else Option_None() - ), - KeyState=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyState( - native_input["KeyState"] - ) - ) - if "KeyState" in native_input.keys() - else Option_None() - ), - PendingWindowInDays=( - Option_Some(native_input["PendingWindowInDays"]) - if "PendingWindowInDays" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + DeletionDate=Option_Some(_dafny.Seq(native_input["DeletionDate"].isoformat())) if "DeletionDate" in native_input.keys() else Option_None(), + KeyState=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyState(native_input["KeyState"])) if "KeyState" in native_input.keys() else Option_None(), + PendingWindowInDays=Option_Some(native_input["PendingWindowInDays"]) if "PendingWindowInDays" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_SignRequest(native_input): return DafnySignRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), Message=Seq(native_input["Message"]), - MessageType=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MessageType( - native_input["MessageType"] - ) - ) - if "MessageType" in native_input.keys() - else Option_None() - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - SigningAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec( - native_input["SigningAlgorithm"] - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + MessageType=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MessageType(native_input["MessageType"])) if "MessageType" in native_input.keys() else Option_None(), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + SigningAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec(native_input["SigningAlgorithm"]), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_MessageType(native_input): # Convert MessageType if native_input == "RAW": @@ -5852,512 +1624,91 @@ def com_amazonaws_kms_MessageType(native_input): else: raise ValueError("No recognized enum value in enum type: " + native_input) - def com_amazonaws_kms_SignResponse(native_input): return DafnySignResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - Signature=( - Option_Some(Seq(native_input["Signature"])) - if "Signature" in native_input.keys() - else Option_None() - ), - SigningAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec( - native_input["SigningAlgorithm"] - ) - ) - if "SigningAlgorithm" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + Signature=Option_Some(Seq(native_input["Signature"])) if "Signature" in native_input.keys() else Option_None(), + SigningAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec(native_input["SigningAlgorithm"])) if "SigningAlgorithm" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_TagResourceRequest(native_input): return DafnyTagResourceRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - Tags=Seq( - [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag( - list_element - ) - for list_element in native_input["Tags"] - ] - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + Tags=Seq([aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_Tag(list_element) for list_element in native_input["Tags"]]), ) - def com_amazonaws_kms_UntagResourceRequest(native_input): return DafnyUntagResourceRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - TagKeys=Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["TagKeys"] - ] - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + TagKeys=Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["TagKeys"]]), ) - def com_amazonaws_kms_UpdateAliasRequest(native_input): return DafnyUpdateAliasRequest( - AliasName=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["AliasName"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - TargetKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["TargetKeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + AliasName=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["AliasName"].encode('utf-16-be'))]*2)])), + TargetKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["TargetKeyId"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_UpdateCustomKeyStoreRequest(native_input): return DafnyUpdateCustomKeyStoreRequest( - CustomKeyStoreId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["CustomKeyStoreId"].encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - NewCustomKeyStoreName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["NewCustomKeyStoreName"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "NewCustomKeyStoreName" in native_input.keys() - else Option_None() - ), - KeyStorePassword=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["KeyStorePassword"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "KeyStorePassword" in native_input.keys() - else Option_None() - ), - CloudHsmClusterId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["CloudHsmClusterId"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "CloudHsmClusterId" in native_input.keys() - else Option_None() - ), - XksProxyUriEndpoint=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["XksProxyUriEndpoint"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "XksProxyUriEndpoint" in native_input.keys() - else Option_None() - ), - XksProxyUriPath=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input["XksProxyUriPath"].encode( - "utf-16-be" - ) - ) - ] - * 2 - ) - ] - ) - ) - ) - if "XksProxyUriPath" in native_input.keys() - else Option_None() - ), - XksProxyVpcEndpointServiceName=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[ - iter( - native_input[ - "XksProxyVpcEndpointServiceName" - ].encode("utf-16-be") - ) - ] - * 2 - ) - ] - ) - ) - ) - if "XksProxyVpcEndpointServiceName" in native_input.keys() - else Option_None() - ), - XksProxyAuthenticationCredential=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyAuthenticationCredentialType( - native_input["XksProxyAuthenticationCredential"] - ) - ) - if "XksProxyAuthenticationCredential" in native_input.keys() - else Option_None() - ), - XksProxyConnectivity=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConnectivityType( - native_input["XksProxyConnectivity"] - ) - ) - if "XksProxyConnectivity" in native_input.keys() - else Option_None() - ), + CustomKeyStoreId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CustomKeyStoreId"].encode('utf-16-be'))]*2)])), + NewCustomKeyStoreName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["NewCustomKeyStoreName"].encode('utf-16-be'))]*2)]))) if "NewCustomKeyStoreName" in native_input.keys() else Option_None(), + KeyStorePassword=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyStorePassword"].encode('utf-16-be'))]*2)]))) if "KeyStorePassword" in native_input.keys() else Option_None(), + CloudHsmClusterId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["CloudHsmClusterId"].encode('utf-16-be'))]*2)]))) if "CloudHsmClusterId" in native_input.keys() else Option_None(), + XksProxyUriEndpoint=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["XksProxyUriEndpoint"].encode('utf-16-be'))]*2)]))) if "XksProxyUriEndpoint" in native_input.keys() else Option_None(), + XksProxyUriPath=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["XksProxyUriPath"].encode('utf-16-be'))]*2)]))) if "XksProxyUriPath" in native_input.keys() else Option_None(), + XksProxyVpcEndpointServiceName=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["XksProxyVpcEndpointServiceName"].encode('utf-16-be'))]*2)]))) if "XksProxyVpcEndpointServiceName" in native_input.keys() else Option_None(), + XksProxyAuthenticationCredential=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyAuthenticationCredentialType(native_input["XksProxyAuthenticationCredential"])) if "XksProxyAuthenticationCredential" in native_input.keys() else Option_None(), + XksProxyConnectivity=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyConnectivityType(native_input["XksProxyConnectivity"])) if "XksProxyConnectivity" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_UpdateCustomKeyStoreResponse(native_input): - return DafnyUpdateCustomKeyStoreResponse() - + return DafnyUpdateCustomKeyStoreResponse( + ) def com_amazonaws_kms_UpdateKeyDescriptionRequest(native_input): return DafnyUpdateKeyDescriptionRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - Description=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["Description"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + Description=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["Description"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_UpdatePrimaryRegionRequest(native_input): return DafnyUpdatePrimaryRegionRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - PrimaryRegion=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["PrimaryRegion"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + PrimaryRegion=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["PrimaryRegion"].encode('utf-16-be'))]*2)])), ) - def com_amazonaws_kms_VerifyRequest(native_input): return DafnyVerifyRequest( - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), Message=Seq(native_input["Message"]), - MessageType=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MessageType( - native_input["MessageType"] - ) - ) - if "MessageType" in native_input.keys() - else Option_None() - ), + MessageType=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MessageType(native_input["MessageType"])) if "MessageType" in native_input.keys() else Option_None(), Signature=Seq(native_input["Signature"]), - SigningAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec( - native_input["SigningAlgorithm"] - ), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + SigningAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec(native_input["SigningAlgorithm"]), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_VerifyResponse(native_input): return DafnyVerifyResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - SignatureValid=( - Option_Some(native_input["SignatureValid"]) - if "SignatureValid" in native_input.keys() - else Option_None() - ), - SigningAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec( - native_input["SigningAlgorithm"] - ) - ) - if "SigningAlgorithm" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + SignatureValid=Option_Some(native_input["SignatureValid"]) if "SignatureValid" in native_input.keys() else Option_None(), + SigningAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SigningAlgorithmSpec(native_input["SigningAlgorithm"])) if "SigningAlgorithm" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_VerifyMacRequest(native_input): return DafnyVerifyMacRequest( Message=Seq(native_input["Message"]), - KeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ), - MacAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec( - native_input["MacAlgorithm"] - ), + KeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)])), + MacAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec(native_input["MacAlgorithm"]), Mac=Seq(native_input["Mac"]), - GrantTokens=( - Option_Some( - Seq( - [ - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(list_element.encode("utf-16-be"))] * 2 - ) - ] - ) - ) - for list_element in native_input["GrantTokens"] - ] - ) - ) - if "GrantTokens" in native_input.keys() - else Option_None() - ), - DryRun=( - Option_Some(native_input["DryRun"]) - if "DryRun" in native_input.keys() - else Option_None() - ), + GrantTokens=Option_Some(Seq([Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(list_element.encode('utf-16-be'))]*2)])) for list_element in native_input["GrantTokens"]])) if "GrantTokens" in native_input.keys() else Option_None(), + DryRun=Option_Some(native_input["DryRun"]) if "DryRun" in native_input.keys() else Option_None(), ) - def com_amazonaws_kms_VerifyMacResponse(native_input): return DafnyVerifyMacResponse( - KeyId=( - Option_Some( - Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input["KeyId"].encode("utf-16-be"))] * 2 - ) - ] - ) - ) - ) - if "KeyId" in native_input.keys() - else Option_None() - ), - MacValid=( - Option_Some(native_input["MacValid"]) - if "MacValid" in native_input.keys() - else Option_None() - ), - MacAlgorithm=( - Option_Some( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec( - native_input["MacAlgorithm"] - ) - ) - if "MacAlgorithm" in native_input.keys() - else Option_None() - ), + KeyId=Option_Some(Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input["KeyId"].encode('utf-16-be'))]*2)]))) if "KeyId" in native_input.keys() else Option_None(), + MacValid=Option_Some(native_input["MacValid"]) if "MacValid" in native_input.keys() else Option_None(), + MacAlgorithm=Option_Some(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MacAlgorithmSpec(native_input["MacAlgorithm"])) if "MacAlgorithm" in native_input.keys() else Option_None(), ) diff --git a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/dafny_to_aws_sdk.py b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/dafny_to_aws_sdk.py index ec3b1ec54..92f8bbbbc 100644 --- a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/dafny_to_aws_sdk.py +++ b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/dafny_to_aws_sdk.py @@ -147,527 +147,366 @@ def com_amazonaws_kms_AlreadyExistsException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CloudHsmClusterInUseException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CloudHsmClusterNotActiveException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CloudHsmClusterNotFoundException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CloudHsmClusterNotRelatedException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_ConflictException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CustomKeyStoreHasCMKsException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CustomKeyStoreInvalidStateException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CustomKeyStoreNameInUseException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CustomKeyStoreNotFoundException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_DependencyTimeoutException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_DisabledException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_DryRunOperationException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_ExpiredImportTokenException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_IncorrectKeyException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_IncorrectKeyMaterialException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_IncorrectTrustAnchorException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidAliasNameException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidArnException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidCiphertextException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidGrantIdException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidGrantTokenException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidImportTokenException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidKeyUsageException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_InvalidMarkerException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_KeyUnavailableException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_KMSInternalException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_KMSInvalidMacException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_KMSInvalidSignatureException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_KMSInvalidStateException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_LimitExceededException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_MalformedPolicyDocumentException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_NotFoundException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_TagException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_UnsupportedOperationException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksKeyAlreadyInUseException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksKeyInvalidConfigurationException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksKeyNotFoundException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyInvalidConfigurationException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyInvalidResponseException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyUriEndpointInUseException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyUriInUseException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyUriUnreachableException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - -def com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException( - dafny_input, -): +def com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException(dafny_input): output = {} if dafny_input.message.is_Some: - output["message"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.message.value - ).decode("utf-16-be") + output["message"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.message.value).decode('utf-16-be') return output - def com_amazonaws_kms_CancelKeyDeletionRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') return output - def com_amazonaws_kms_CancelKeyDeletionResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') return output - def com_amazonaws_kms_ConnectCustomKeyStoreRequest(dafny_input): output = {} - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId).decode('utf-16-be') return output - def com_amazonaws_kms_ConnectCustomKeyStoreResponse(dafny_input): output = {} return output - def com_amazonaws_kms_CreateAliasRequest(dafny_input): output = {} - output["AliasName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AliasName - ).decode("utf-16-be") - output["TargetKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.TargetKeyId - ).decode("utf-16-be") + output["AliasName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AliasName).decode('utf-16-be') + output["TargetKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.TargetKeyId).decode('utf-16-be') return output - def com_amazonaws_kms_CustomKeyStoreType(dafny_input): # Convert CustomKeyStoreType if isinstance(dafny_input, CustomKeyStoreType_AWS__CLOUDHSM): @@ -679,18 +518,12 @@ def com_amazonaws_kms_CustomKeyStoreType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_XksProxyAuthenticationCredentialType(dafny_input): output = {} - output["AccessKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AccessKeyId - ).decode("utf-16-be") - output["RawSecretAccessKey"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.RawSecretAccessKey - ).decode("utf-16-be") + output["AccessKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AccessKeyId).decode('utf-16-be') + output["RawSecretAccessKey"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.RawSecretAccessKey).decode('utf-16-be') return output - def com_amazonaws_kms_XksProxyConnectivityType(dafny_input): # Convert XksProxyConnectivityType if isinstance(dafny_input, XksProxyConnectivityType_PUBLIC__ENDPOINT): @@ -702,77 +535,45 @@ def com_amazonaws_kms_XksProxyConnectivityType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_CreateCustomKeyStoreRequest(dafny_input): output = {} - output["CustomKeyStoreName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreName - ).decode("utf-16-be") + output["CustomKeyStoreName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreName).decode('utf-16-be') if dafny_input.CloudHsmClusterId.is_Some: - output["CloudHsmClusterId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CloudHsmClusterId.value - ).decode("utf-16-be") + output["CloudHsmClusterId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CloudHsmClusterId.value).decode('utf-16-be') if dafny_input.TrustAnchorCertificate.is_Some: - output["TrustAnchorCertificate"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.TrustAnchorCertificate.value - ).decode("utf-16-be") + output["TrustAnchorCertificate"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.TrustAnchorCertificate.value).decode('utf-16-be') if dafny_input.KeyStorePassword.is_Some: - output["KeyStorePassword"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyStorePassword.value - ).decode("utf-16-be") + output["KeyStorePassword"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyStorePassword.value).decode('utf-16-be') if dafny_input.CustomKeyStoreType.is_Some: - output["CustomKeyStoreType"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomKeyStoreType( - dafny_input.CustomKeyStoreType.value - ) - ) + output["CustomKeyStoreType"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomKeyStoreType(dafny_input.CustomKeyStoreType.value) if dafny_input.XksProxyUriEndpoint.is_Some: - output["XksProxyUriEndpoint"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.XksProxyUriEndpoint.value - ).decode("utf-16-be") + output["XksProxyUriEndpoint"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.XksProxyUriEndpoint.value).decode('utf-16-be') if dafny_input.XksProxyUriPath.is_Some: - output["XksProxyUriPath"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.XksProxyUriPath.value - ).decode("utf-16-be") + output["XksProxyUriPath"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.XksProxyUriPath.value).decode('utf-16-be') if dafny_input.XksProxyVpcEndpointServiceName.is_Some: - output["XksProxyVpcEndpointServiceName"] = b"".join( - ord(c).to_bytes(2, "big") - for c in dafny_input.XksProxyVpcEndpointServiceName.value - ).decode("utf-16-be") + output["XksProxyVpcEndpointServiceName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.XksProxyVpcEndpointServiceName.value).decode('utf-16-be') if dafny_input.XksProxyAuthenticationCredential.is_Some: - output["XksProxyAuthenticationCredential"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyAuthenticationCredentialType( - dafny_input.XksProxyAuthenticationCredential.value - ) - ) + output["XksProxyAuthenticationCredential"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyAuthenticationCredentialType(dafny_input.XksProxyAuthenticationCredential.value) if dafny_input.XksProxyConnectivity.is_Some: - output["XksProxyConnectivity"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConnectivityType( - dafny_input.XksProxyConnectivity.value - ) - ) + output["XksProxyConnectivity"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConnectivityType(dafny_input.XksProxyConnectivity.value) return output - def com_amazonaws_kms_CreateCustomKeyStoreResponse(dafny_input): output = {} if dafny_input.CustomKeyStoreId.is_Some: - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId.value - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId.value).decode('utf-16-be') return output - def com_amazonaws_kms_GrantOperation(dafny_input): # Convert GrantOperation if isinstance(dafny_input, GrantOperation_Decrypt): @@ -829,88 +630,48 @@ def com_amazonaws_kms_GrantOperation(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_GrantConstraints(dafny_input): output = {} if dafny_input.EncryptionContextSubset.is_Some: - output["EncryptionContextSubset"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContextSubset.value.items - } + output["EncryptionContextSubset"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContextSubset.value.items } if dafny_input.EncryptionContextEquals.is_Some: - output["EncryptionContextEquals"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContextEquals.value.items - } + output["EncryptionContextEquals"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContextEquals.value.items } return output - def com_amazonaws_kms_CreateGrantRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["GranteePrincipal"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GranteePrincipal - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["GranteePrincipal"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GranteePrincipal).decode('utf-16-be') if dafny_input.RetiringPrincipal.is_Some: - output["RetiringPrincipal"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.RetiringPrincipal.value - ).decode("utf-16-be") - - output["Operations"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantOperation( - list_element - ) - for list_element in dafny_input.Operations - ] + output["RetiringPrincipal"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.RetiringPrincipal.value).decode('utf-16-be') + + output["Operations"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantOperation(list_element) for list_element in dafny_input.Operations] if dafny_input.Constraints.is_Some: - output["Constraints"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantConstraints( - dafny_input.Constraints.value - ) - ) + output["Constraints"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantConstraints(dafny_input.Constraints.value) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.Name.is_Some: - output["Name"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Name.value - ).decode("utf-16-be") + output["Name"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Name.value).decode('utf-16-be') if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_CreateGrantResponse(dafny_input): output = {} if dafny_input.GrantToken.is_Some: - output["GrantToken"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GrantToken.value - ).decode("utf-16-be") + output["GrantToken"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GrantToken.value).decode('utf-16-be') if dafny_input.GrantId.is_Some: - output["GrantId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GrantId.value - ).decode("utf-16-be") + output["GrantId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GrantId.value).decode('utf-16-be') return output - def com_amazonaws_kms_KeyUsageType(dafny_input): # Convert KeyUsageType if isinstance(dafny_input, KeyUsageType_SIGN__VERIFY): @@ -928,7 +689,6 @@ def com_amazonaws_kms_KeyUsageType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_CustomerMasterKeySpec(dafny_input): # Convert CustomerMasterKeySpec if isinstance(dafny_input, CustomerMasterKeySpec_RSA__2048): @@ -973,7 +733,6 @@ def com_amazonaws_kms_CustomerMasterKeySpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_KeySpec(dafny_input): # Convert KeySpec if isinstance(dafny_input, KeySpec_RSA__2048): @@ -1018,7 +777,6 @@ def com_amazonaws_kms_KeySpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_OriginType(dafny_input): # Convert OriginType if isinstance(dafny_input, OriginType_AWS__KMS): @@ -1036,241 +794,126 @@ def com_amazonaws_kms_OriginType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_Tag(dafny_input): output = {} - output["TagKey"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.TagKey - ).decode("utf-16-be") - output["TagValue"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.TagValue - ).decode("utf-16-be") + output["TagKey"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.TagKey).decode('utf-16-be') + output["TagValue"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.TagValue).decode('utf-16-be') return output - def com_amazonaws_kms_CreateKeyRequest(dafny_input): output = {} if dafny_input.Policy.is_Some: - output["Policy"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Policy.value - ).decode("utf-16-be") + output["Policy"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Policy.value).decode('utf-16-be') if dafny_input.Description.is_Some: - output["Description"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Description.value - ).decode("utf-16-be") + output["Description"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Description.value).decode('utf-16-be') if dafny_input.KeyUsage.is_Some: - output["KeyUsage"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyUsageType( - dafny_input.KeyUsage.value - ) - ) + output["KeyUsage"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyUsageType(dafny_input.KeyUsage.value) if dafny_input.CustomerMasterKeySpec.is_Some: - output["CustomerMasterKeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomerMasterKeySpec( - dafny_input.CustomerMasterKeySpec.value - ) - ) + output["CustomerMasterKeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomerMasterKeySpec(dafny_input.CustomerMasterKeySpec.value) if dafny_input.KeySpec.is_Some: - output["KeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeySpec( - dafny_input.KeySpec.value - ) - ) + output["KeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeySpec(dafny_input.KeySpec.value) if dafny_input.Origin.is_Some: - output["Origin"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_OriginType( - dafny_input.Origin.value - ) - ) + output["Origin"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_OriginType(dafny_input.Origin.value) if dafny_input.CustomKeyStoreId.is_Some: - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId.value - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId.value).decode('utf-16-be') if dafny_input.BypassPolicyLockoutSafetyCheck.is_Some: - output["BypassPolicyLockoutSafetyCheck"] = ( - dafny_input.BypassPolicyLockoutSafetyCheck.value - ) + output["BypassPolicyLockoutSafetyCheck"] = dafny_input.BypassPolicyLockoutSafetyCheck.value if dafny_input.Tags.is_Some: - output["Tags"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag( - list_element - ) - for list_element in dafny_input.Tags.value - ] + output["Tags"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag(list_element) for list_element in dafny_input.Tags.value] if dafny_input.MultiRegion.is_Some: output["MultiRegion"] = dafny_input.MultiRegion.value if dafny_input.XksKeyId.is_Some: - output["XksKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.XksKeyId.value - ).decode("utf-16-be") + output["XksKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.XksKeyId.value).decode('utf-16-be') return output - def com_amazonaws_kms_KeyMetadata(dafny_input): output = {} if dafny_input.AWSAccountId.is_Some: - output["AWSAccountId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AWSAccountId.value - ).decode("utf-16-be") + output["AWSAccountId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AWSAccountId.value).decode('utf-16-be') - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.Arn.is_Some: - output["Arn"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Arn.value - ).decode("utf-16-be") + output["Arn"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Arn.value).decode('utf-16-be') if dafny_input.CreationDate.is_Some: - output["CreationDate"] = datetime.fromisoformat( - dafny_input.CreationDate.value.VerbatimString(False) - ) + output["CreationDate"] = datetime.fromisoformat(dafny_input.CreationDate.value.VerbatimString(False)) if dafny_input.Enabled.is_Some: output["Enabled"] = dafny_input.Enabled.value if dafny_input.Description.is_Some: - output["Description"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Description.value - ).decode("utf-16-be") + output["Description"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Description.value).decode('utf-16-be') if dafny_input.KeyUsage.is_Some: - output["KeyUsage"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyUsageType( - dafny_input.KeyUsage.value - ) - ) + output["KeyUsage"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyUsageType(dafny_input.KeyUsage.value) if dafny_input.KeyState.is_Some: - output["KeyState"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyState( - dafny_input.KeyState.value - ) - ) + output["KeyState"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyState(dafny_input.KeyState.value) if dafny_input.DeletionDate.is_Some: - output["DeletionDate"] = datetime.fromisoformat( - dafny_input.DeletionDate.value.VerbatimString(False) - ) + output["DeletionDate"] = datetime.fromisoformat(dafny_input.DeletionDate.value.VerbatimString(False)) if dafny_input.ValidTo.is_Some: - output["ValidTo"] = datetime.fromisoformat( - dafny_input.ValidTo.value.VerbatimString(False) - ) + output["ValidTo"] = datetime.fromisoformat(dafny_input.ValidTo.value.VerbatimString(False)) if dafny_input.Origin.is_Some: - output["Origin"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_OriginType( - dafny_input.Origin.value - ) - ) + output["Origin"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_OriginType(dafny_input.Origin.value) if dafny_input.CustomKeyStoreId.is_Some: - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId.value - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId.value).decode('utf-16-be') if dafny_input.CloudHsmClusterId.is_Some: - output["CloudHsmClusterId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CloudHsmClusterId.value - ).decode("utf-16-be") + output["CloudHsmClusterId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CloudHsmClusterId.value).decode('utf-16-be') if dafny_input.ExpirationModel.is_Some: - output["ExpirationModel"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ExpirationModelType( - dafny_input.ExpirationModel.value - ) - ) + output["ExpirationModel"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ExpirationModelType(dafny_input.ExpirationModel.value) if dafny_input.KeyManager.is_Some: - output["KeyManager"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyManagerType( - dafny_input.KeyManager.value - ) - ) + output["KeyManager"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyManagerType(dafny_input.KeyManager.value) if dafny_input.CustomerMasterKeySpec.is_Some: - output["CustomerMasterKeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomerMasterKeySpec( - dafny_input.CustomerMasterKeySpec.value - ) - ) + output["CustomerMasterKeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomerMasterKeySpec(dafny_input.CustomerMasterKeySpec.value) if dafny_input.KeySpec.is_Some: - output["KeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeySpec( - dafny_input.KeySpec.value - ) - ) + output["KeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeySpec(dafny_input.KeySpec.value) if dafny_input.EncryptionAlgorithms.is_Some: - output["EncryptionAlgorithms"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - list_element - ) - for list_element in dafny_input.EncryptionAlgorithms.value - ] + output["EncryptionAlgorithms"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(list_element) for list_element in dafny_input.EncryptionAlgorithms.value] if dafny_input.SigningAlgorithms.is_Some: - output["SigningAlgorithms"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec( - list_element - ) - for list_element in dafny_input.SigningAlgorithms.value - ] + output["SigningAlgorithms"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec(list_element) for list_element in dafny_input.SigningAlgorithms.value] if dafny_input.KeyAgreementAlgorithms.is_Some: - output["KeyAgreementAlgorithms"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - list_element - ) - for list_element in dafny_input.KeyAgreementAlgorithms.value - ] + output["KeyAgreementAlgorithms"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec(list_element) for list_element in dafny_input.KeyAgreementAlgorithms.value] if dafny_input.MultiRegion.is_Some: output["MultiRegion"] = dafny_input.MultiRegion.value if dafny_input.MultiRegionConfiguration.is_Some: - output["MultiRegionConfiguration"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionConfiguration( - dafny_input.MultiRegionConfiguration.value - ) - ) + output["MultiRegionConfiguration"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionConfiguration(dafny_input.MultiRegionConfiguration.value) if dafny_input.PendingDeletionWindowInDays.is_Some: - output["PendingDeletionWindowInDays"] = ( - dafny_input.PendingDeletionWindowInDays.value - ) + output["PendingDeletionWindowInDays"] = dafny_input.PendingDeletionWindowInDays.value if dafny_input.MacAlgorithms.is_Some: - output["MacAlgorithms"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec( - list_element - ) - for list_element in dafny_input.MacAlgorithms.value - ] + output["MacAlgorithms"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec(list_element) for list_element in dafny_input.MacAlgorithms.value] if dafny_input.XksKeyConfiguration.is_Some: - output["XksKeyConfiguration"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksKeyConfigurationType( - dafny_input.XksKeyConfiguration.value - ) - ) + output["XksKeyConfiguration"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksKeyConfigurationType(dafny_input.XksKeyConfiguration.value) return output - def com_amazonaws_kms_KeyState(dafny_input): # Convert KeyState if isinstance(dafny_input, KeyState_Creating): @@ -1300,7 +943,6 @@ def com_amazonaws_kms_KeyState(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_ExpirationModelType(dafny_input): # Convert ExpirationModelType if isinstance(dafny_input, ExpirationModelType_KEY__MATERIAL__EXPIRES): @@ -1312,7 +954,6 @@ def com_amazonaws_kms_ExpirationModelType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_KeyManagerType(dafny_input): # Convert KeyManagerType if isinstance(dafny_input, KeyManagerType_AWS): @@ -1324,7 +965,6 @@ def com_amazonaws_kms_KeyManagerType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input): # Convert EncryptionAlgorithmSpec if isinstance(dafny_input, EncryptionAlgorithmSpec_SYMMETRIC__DEFAULT): @@ -1339,7 +979,6 @@ def com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_SigningAlgorithmSpec(dafny_input): # Convert SigningAlgorithmSpec if isinstance(dafny_input, SigningAlgorithmSpec_RSASSA__PSS__SHA__256): @@ -1375,7 +1014,6 @@ def com_amazonaws_kms_SigningAlgorithmSpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_KeyAgreementAlgorithmSpec(dafny_input): # Convert KeyAgreementAlgorithmSpec if isinstance(dafny_input, KeyAgreementAlgorithmSpec_ECDH): @@ -1384,34 +1022,19 @@ def com_amazonaws_kms_KeyAgreementAlgorithmSpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_MultiRegionConfiguration(dafny_input): output = {} if dafny_input.MultiRegionKeyType.is_Some: - output["MultiRegionKeyType"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionKeyType( - dafny_input.MultiRegionKeyType.value - ) - ) + output["MultiRegionKeyType"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionKeyType(dafny_input.MultiRegionKeyType.value) if dafny_input.PrimaryKey.is_Some: - output["PrimaryKey"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionKey( - dafny_input.PrimaryKey.value - ) - ) + output["PrimaryKey"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionKey(dafny_input.PrimaryKey.value) if dafny_input.ReplicaKeys.is_Some: - output["ReplicaKeys"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionKey( - list_element - ) - for list_element in dafny_input.ReplicaKeys.value - ] + output["ReplicaKeys"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MultiRegionKey(list_element) for list_element in dafny_input.ReplicaKeys.value] return output - def com_amazonaws_kms_MacAlgorithmSpec(dafny_input): # Convert MacAlgorithmSpec if isinstance(dafny_input, MacAlgorithmSpec_HMAC__SHA__224): @@ -1429,17 +1052,13 @@ def com_amazonaws_kms_MacAlgorithmSpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_XksKeyConfigurationType(dafny_input): output = {} if dafny_input.Id.is_Some: - output["Id"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Id.value - ).decode("utf-16-be") + output["Id"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Id.value).decode('utf-16-be') return output - def com_amazonaws_kms_MultiRegionKeyType(dafny_input): # Convert MultiRegionKeyType if isinstance(dafny_input, MultiRegionKeyType_PRIMARY): @@ -1451,49 +1070,33 @@ def com_amazonaws_kms_MultiRegionKeyType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_MultiRegionKey(dafny_input): output = {} if dafny_input.Arn.is_Some: - output["Arn"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Arn.value - ).decode("utf-16-be") + output["Arn"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Arn.value).decode('utf-16-be') if dafny_input.Region.is_Some: - output["Region"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Region.value - ).decode("utf-16-be") + output["Region"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Region.value).decode('utf-16-be') return output - def com_amazonaws_kms_CreateKeyResponse(dafny_input): output = {} if dafny_input.KeyMetadata.is_Some: - output["KeyMetadata"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyMetadata( - dafny_input.KeyMetadata.value - ) - ) + output["KeyMetadata"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyMetadata(dafny_input.KeyMetadata.value) return output - def com_amazonaws_kms_RecipientInfo(dafny_input): output = {} if dafny_input.KeyEncryptionAlgorithm.is_Some: - output["KeyEncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyEncryptionMechanism( - dafny_input.KeyEncryptionAlgorithm.value - ) - ) + output["KeyEncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyEncryptionMechanism(dafny_input.KeyEncryptionAlgorithm.value) if dafny_input.AttestationDocument.is_Some: output["AttestationDocument"] = bytes(dafny_input.AttestationDocument.value) return output - def com_amazonaws_kms_KeyEncryptionMechanism(dafny_input): # Convert KeyEncryptionMechanism if isinstance(dafny_input, KeyEncryptionMechanism_RSAES__OAEP__SHA__256): @@ -1502,250 +1105,146 @@ def com_amazonaws_kms_KeyEncryptionMechanism(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_DecryptRequest(dafny_input): output = {} output["CiphertextBlob"] = bytes(dafny_input.CiphertextBlob) if dafny_input.EncryptionContext.is_Some: - output["EncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContext.value.items - } + output["EncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContext.value.items } if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.EncryptionAlgorithm.is_Some: - output["EncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.EncryptionAlgorithm.value - ) - ) + output["EncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.EncryptionAlgorithm.value) if dafny_input.Recipient.is_Some: - output["Recipient"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo( - dafny_input.Recipient.value - ) - ) + output["Recipient"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo(dafny_input.Recipient.value) if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_DecryptResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.Plaintext.is_Some: output["Plaintext"] = bytes(dafny_input.Plaintext.value) if dafny_input.EncryptionAlgorithm.is_Some: - output["EncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.EncryptionAlgorithm.value - ) - ) + output["EncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.EncryptionAlgorithm.value) if dafny_input.CiphertextForRecipient.is_Some: - output["CiphertextForRecipient"] = bytes( - dafny_input.CiphertextForRecipient.value - ) + output["CiphertextForRecipient"] = bytes(dafny_input.CiphertextForRecipient.value) return output - def com_amazonaws_kms_DeleteAliasRequest(dafny_input): output = {} - output["AliasName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AliasName - ).decode("utf-16-be") + output["AliasName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AliasName).decode('utf-16-be') return output - def com_amazonaws_kms_DeleteCustomKeyStoreRequest(dafny_input): output = {} - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId).decode('utf-16-be') return output - def com_amazonaws_kms_DeleteCustomKeyStoreResponse(dafny_input): output = {} return output - def com_amazonaws_kms_DeleteImportedKeyMaterialRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') return output - def com_amazonaws_kms_DeriveSharedSecretRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["KeyAgreementAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - dafny_input.KeyAgreementAlgorithm - ) - ) + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["KeyAgreementAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec(dafny_input.KeyAgreementAlgorithm) output["PublicKey"] = bytes(dafny_input.PublicKey) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value if dafny_input.Recipient.is_Some: - output["Recipient"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo( - dafny_input.Recipient.value - ) - ) + output["Recipient"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo(dafny_input.Recipient.value) return output - def com_amazonaws_kms_DeriveSharedSecretResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.SharedSecret.is_Some: output["SharedSecret"] = bytes(dafny_input.SharedSecret.value) if dafny_input.CiphertextForRecipient.is_Some: - output["CiphertextForRecipient"] = bytes( - dafny_input.CiphertextForRecipient.value - ) + output["CiphertextForRecipient"] = bytes(dafny_input.CiphertextForRecipient.value) if dafny_input.KeyAgreementAlgorithm.is_Some: - output["KeyAgreementAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - dafny_input.KeyAgreementAlgorithm.value - ) - ) + output["KeyAgreementAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec(dafny_input.KeyAgreementAlgorithm.value) if dafny_input.KeyOrigin.is_Some: - output["KeyOrigin"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_OriginType( - dafny_input.KeyOrigin.value - ) - ) + output["KeyOrigin"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_OriginType(dafny_input.KeyOrigin.value) return output - def com_amazonaws_kms_DescribeCustomKeyStoresRequest(dafny_input): output = {} if dafny_input.CustomKeyStoreId.is_Some: - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId.value - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId.value).decode('utf-16-be') if dafny_input.CustomKeyStoreName.is_Some: - output["CustomKeyStoreName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreName.value - ).decode("utf-16-be") + output["CustomKeyStoreName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreName.value).decode('utf-16-be') if dafny_input.Limit.is_Some: output["Limit"] = dafny_input.Limit.value if dafny_input.Marker.is_Some: - output["Marker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Marker.value - ).decode("utf-16-be") + output["Marker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Marker.value).decode('utf-16-be') return output - def com_amazonaws_kms_CustomKeyStoresListEntry(dafny_input): output = {} if dafny_input.CustomKeyStoreId.is_Some: - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId.value - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId.value).decode('utf-16-be') if dafny_input.CustomKeyStoreName.is_Some: - output["CustomKeyStoreName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreName.value - ).decode("utf-16-be") + output["CustomKeyStoreName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreName.value).decode('utf-16-be') if dafny_input.CloudHsmClusterId.is_Some: - output["CloudHsmClusterId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CloudHsmClusterId.value - ).decode("utf-16-be") + output["CloudHsmClusterId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CloudHsmClusterId.value).decode('utf-16-be') if dafny_input.TrustAnchorCertificate.is_Some: - output["TrustAnchorCertificate"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.TrustAnchorCertificate.value - ).decode("utf-16-be") + output["TrustAnchorCertificate"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.TrustAnchorCertificate.value).decode('utf-16-be') if dafny_input.ConnectionState.is_Some: - output["ConnectionState"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ConnectionStateType( - dafny_input.ConnectionState.value - ) - ) + output["ConnectionState"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ConnectionStateType(dafny_input.ConnectionState.value) if dafny_input.ConnectionErrorCode.is_Some: - output["ConnectionErrorCode"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ConnectionErrorCodeType( - dafny_input.ConnectionErrorCode.value - ) - ) + output["ConnectionErrorCode"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ConnectionErrorCodeType(dafny_input.ConnectionErrorCode.value) if dafny_input.CreationDate.is_Some: - output["CreationDate"] = datetime.fromisoformat( - dafny_input.CreationDate.value.VerbatimString(False) - ) + output["CreationDate"] = datetime.fromisoformat(dafny_input.CreationDate.value.VerbatimString(False)) if dafny_input.CustomKeyStoreType.is_Some: - output["CustomKeyStoreType"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomKeyStoreType( - dafny_input.CustomKeyStoreType.value - ) - ) + output["CustomKeyStoreType"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomKeyStoreType(dafny_input.CustomKeyStoreType.value) if dafny_input.XksProxyConfiguration.is_Some: - output["XksProxyConfiguration"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConfigurationType( - dafny_input.XksProxyConfiguration.value - ) - ) + output["XksProxyConfiguration"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConfigurationType(dafny_input.XksProxyConfiguration.value) return output - def com_amazonaws_kms_ConnectionStateType(dafny_input): # Convert ConnectionStateType if isinstance(dafny_input, ConnectionStateType_CONNECTED): @@ -1766,7 +1265,6 @@ def com_amazonaws_kms_ConnectionStateType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_ConnectionErrorCodeType(dafny_input): # Convert ConnectionErrorCodeType if isinstance(dafny_input, ConnectionErrorCodeType_INVALID__CREDENTIALS): @@ -1796,9 +1294,7 @@ def com_amazonaws_kms_ConnectionErrorCodeType(dafny_input): elif isinstance(dafny_input, ConnectionErrorCodeType_SUBNET__NOT__FOUND): return "SUBNET_NOT_FOUND" - elif isinstance( - dafny_input, ConnectionErrorCodeType_INSUFFICIENT__FREE__ADDRESSES__IN__SUBNET - ): + elif isinstance(dafny_input, ConnectionErrorCodeType_INSUFFICIENT__FREE__ADDRESSES__IN__SUBNET): return "INSUFFICIENT_FREE_ADDRESSES_IN_SUBNET" elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__PROXY__ACCESS__DENIED): @@ -1807,221 +1303,137 @@ def com_amazonaws_kms_ConnectionErrorCodeType(dafny_input): elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__PROXY__NOT__REACHABLE): return "XKS_PROXY_NOT_REACHABLE" - elif isinstance( - dafny_input, ConnectionErrorCodeType_XKS__VPC__ENDPOINT__SERVICE__NOT__FOUND - ): + elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__VPC__ENDPOINT__SERVICE__NOT__FOUND): return "XKS_VPC_ENDPOINT_SERVICE_NOT_FOUND" elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__PROXY__INVALID__RESPONSE): return "XKS_PROXY_INVALID_RESPONSE" - elif isinstance( - dafny_input, ConnectionErrorCodeType_XKS__PROXY__INVALID__CONFIGURATION - ): + elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__PROXY__INVALID__CONFIGURATION): return "XKS_PROXY_INVALID_CONFIGURATION" - elif isinstance( - dafny_input, - ConnectionErrorCodeType_XKS__VPC__ENDPOINT__SERVICE__INVALID__CONFIGURATION, - ): + elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__VPC__ENDPOINT__SERVICE__INVALID__CONFIGURATION): return "XKS_VPC_ENDPOINT_SERVICE_INVALID_CONFIGURATION" elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__PROXY__TIMED__OUT): return "XKS_PROXY_TIMED_OUT" - elif isinstance( - dafny_input, ConnectionErrorCodeType_XKS__PROXY__INVALID__TLS__CONFIGURATION - ): + elif isinstance(dafny_input, ConnectionErrorCodeType_XKS__PROXY__INVALID__TLS__CONFIGURATION): return "XKS_PROXY_INVALID_TLS_CONFIGURATION" else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_XksProxyConfigurationType(dafny_input): output = {} if dafny_input.Connectivity.is_Some: - output["Connectivity"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConnectivityType( - dafny_input.Connectivity.value - ) - ) + output["Connectivity"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConnectivityType(dafny_input.Connectivity.value) if dafny_input.AccessKeyId.is_Some: - output["AccessKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AccessKeyId.value - ).decode("utf-16-be") + output["AccessKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AccessKeyId.value).decode('utf-16-be') if dafny_input.UriEndpoint.is_Some: - output["UriEndpoint"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.UriEndpoint.value - ).decode("utf-16-be") + output["UriEndpoint"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.UriEndpoint.value).decode('utf-16-be') if dafny_input.UriPath.is_Some: - output["UriPath"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.UriPath.value - ).decode("utf-16-be") + output["UriPath"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.UriPath.value).decode('utf-16-be') if dafny_input.VpcEndpointServiceName.is_Some: - output["VpcEndpointServiceName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.VpcEndpointServiceName.value - ).decode("utf-16-be") + output["VpcEndpointServiceName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.VpcEndpointServiceName.value).decode('utf-16-be') return output - def com_amazonaws_kms_DescribeCustomKeyStoresResponse(dafny_input): output = {} if dafny_input.CustomKeyStores.is_Some: - output["CustomKeyStores"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomKeyStoresListEntry( - list_element - ) - for list_element in dafny_input.CustomKeyStores.value - ] + output["CustomKeyStores"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomKeyStoresListEntry(list_element) for list_element in dafny_input.CustomKeyStores.value] if dafny_input.NextMarker.is_Some: - output["NextMarker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NextMarker.value - ).decode("utf-16-be") + output["NextMarker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NextMarker.value).decode('utf-16-be') if dafny_input.Truncated.is_Some: output["Truncated"] = dafny_input.Truncated.value return output - def com_amazonaws_kms_DescribeKeyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] return output - def com_amazonaws_kms_DescribeKeyResponse(dafny_input): output = {} if dafny_input.KeyMetadata.is_Some: - output["KeyMetadata"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyMetadata( - dafny_input.KeyMetadata.value - ) - ) + output["KeyMetadata"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyMetadata(dafny_input.KeyMetadata.value) return output - def com_amazonaws_kms_DisableKeyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') return output - def com_amazonaws_kms_DisableKeyRotationRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') return output - def com_amazonaws_kms_DisconnectCustomKeyStoreRequest(dafny_input): output = {} - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId).decode('utf-16-be') return output - def com_amazonaws_kms_DisconnectCustomKeyStoreResponse(dafny_input): output = {} return output - def com_amazonaws_kms_EnableKeyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') return output - def com_amazonaws_kms_EnableKeyRotationRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.RotationPeriodInDays.is_Some: output["RotationPeriodInDays"] = dafny_input.RotationPeriodInDays.value return output - def com_amazonaws_kms_EncryptRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') output["Plaintext"] = bytes(dafny_input.Plaintext) if dafny_input.EncryptionContext.is_Some: - output["EncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContext.value.items - } + output["EncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContext.value.items } if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.EncryptionAlgorithm.is_Some: - output["EncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.EncryptionAlgorithm.value - ) - ) + output["EncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.EncryptionAlgorithm.value) if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_EncryptResponse(dafny_input): output = {} if dafny_input.CiphertextBlob.is_Some: output["CiphertextBlob"] = bytes(dafny_input.CiphertextBlob.value) if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.EncryptionAlgorithm.is_Some: - output["EncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.EncryptionAlgorithm.value - ) - ) + output["EncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.EncryptionAlgorithm.value) return output - def com_amazonaws_kms_DataKeySpec(dafny_input): # Convert DataKeySpec if isinstance(dafny_input, DataKeySpec_AES__256): @@ -2033,51 +1445,29 @@ def com_amazonaws_kms_DataKeySpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_GenerateDataKeyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.EncryptionContext.is_Some: - output["EncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContext.value.items - } + output["EncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContext.value.items } if dafny_input.NumberOfBytes.is_Some: output["NumberOfBytes"] = dafny_input.NumberOfBytes.value if dafny_input.KeySpec.is_Some: - output["KeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeySpec( - dafny_input.KeySpec.value - ) - ) + output["KeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeySpec(dafny_input.KeySpec.value) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.Recipient.is_Some: - output["Recipient"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo( - dafny_input.Recipient.value - ) - ) + output["Recipient"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo(dafny_input.Recipient.value) if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_GenerateDataKeyResponse(dafny_input): output = {} if dafny_input.CiphertextBlob.is_Some: @@ -2087,18 +1477,13 @@ def com_amazonaws_kms_GenerateDataKeyResponse(dafny_input): output["Plaintext"] = bytes(dafny_input.Plaintext.value) if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.CiphertextForRecipient.is_Some: - output["CiphertextForRecipient"] = bytes( - dafny_input.CiphertextForRecipient.value - ) + output["CiphertextForRecipient"] = bytes(dafny_input.CiphertextForRecipient.value) return output - def com_amazonaws_kms_DataKeyPairSpec(dafny_input): # Convert DataKeyPairSpec if isinstance(dafny_input, DataKeyPairSpec_RSA__2048): @@ -2128,52 +1513,28 @@ def com_amazonaws_kms_DataKeyPairSpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_GenerateDataKeyPairRequest(dafny_input): output = {} if dafny_input.EncryptionContext.is_Some: - output["EncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContext.value.items - } - - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["KeyPairSpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec( - dafny_input.KeyPairSpec - ) - ) + output["EncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContext.value.items } + + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["KeyPairSpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec(dafny_input.KeyPairSpec) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.Recipient.is_Some: - output["Recipient"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo( - dafny_input.Recipient.value - ) - ) + output["Recipient"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo(dafny_input.Recipient.value) if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_GenerateDataKeyPairResponse(dafny_input): output = {} if dafny_input.PrivateKeyCiphertextBlob.is_Some: - output["PrivateKeyCiphertextBlob"] = bytes( - dafny_input.PrivateKeyCiphertextBlob.value - ) + output["PrivateKeyCiphertextBlob"] = bytes(dafny_input.PrivateKeyCiphertextBlob.value) if dafny_input.PrivateKeyPlaintext.is_Some: output["PrivateKeyPlaintext"] = bytes(dafny_input.PrivateKeyPlaintext.value) @@ -2182,272 +1543,168 @@ def com_amazonaws_kms_GenerateDataKeyPairResponse(dafny_input): output["PublicKey"] = bytes(dafny_input.PublicKey.value) if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.KeyPairSpec.is_Some: - output["KeyPairSpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec( - dafny_input.KeyPairSpec.value - ) - ) + output["KeyPairSpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec(dafny_input.KeyPairSpec.value) if dafny_input.CiphertextForRecipient.is_Some: - output["CiphertextForRecipient"] = bytes( - dafny_input.CiphertextForRecipient.value - ) + output["CiphertextForRecipient"] = bytes(dafny_input.CiphertextForRecipient.value) return output - def com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest(dafny_input): output = {} if dafny_input.EncryptionContext.is_Some: - output["EncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContext.value.items - } - - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["KeyPairSpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec( - dafny_input.KeyPairSpec - ) - ) + output["EncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContext.value.items } + + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["KeyPairSpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec(dafny_input.KeyPairSpec) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse(dafny_input): output = {} if dafny_input.PrivateKeyCiphertextBlob.is_Some: - output["PrivateKeyCiphertextBlob"] = bytes( - dafny_input.PrivateKeyCiphertextBlob.value - ) + output["PrivateKeyCiphertextBlob"] = bytes(dafny_input.PrivateKeyCiphertextBlob.value) if dafny_input.PublicKey.is_Some: output["PublicKey"] = bytes(dafny_input.PublicKey.value) if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.KeyPairSpec.is_Some: - output["KeyPairSpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec( - dafny_input.KeyPairSpec.value - ) - ) + output["KeyPairSpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeyPairSpec(dafny_input.KeyPairSpec.value) return output - def com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.EncryptionContext.is_Some: - output["EncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.EncryptionContext.value.items - } + output["EncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.EncryptionContext.value.items } if dafny_input.KeySpec.is_Some: - output["KeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeySpec( - dafny_input.KeySpec.value - ) - ) + output["KeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DataKeySpec(dafny_input.KeySpec.value) if dafny_input.NumberOfBytes.is_Some: output["NumberOfBytes"] = dafny_input.NumberOfBytes.value if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse(dafny_input): output = {} if dafny_input.CiphertextBlob.is_Some: output["CiphertextBlob"] = bytes(dafny_input.CiphertextBlob.value) if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') return output - def com_amazonaws_kms_GenerateMacRequest(dafny_input): output = {} output["Message"] = bytes(dafny_input.Message) - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["MacAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec( - dafny_input.MacAlgorithm - ) - ) + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["MacAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec(dafny_input.MacAlgorithm) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_GenerateMacResponse(dafny_input): output = {} if dafny_input.Mac.is_Some: output["Mac"] = bytes(dafny_input.Mac.value) if dafny_input.MacAlgorithm.is_Some: - output["MacAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec( - dafny_input.MacAlgorithm.value - ) - ) + output["MacAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec(dafny_input.MacAlgorithm.value) if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') return output - def com_amazonaws_kms_GenerateRandomRequest(dafny_input): output = {} if dafny_input.NumberOfBytes.is_Some: output["NumberOfBytes"] = dafny_input.NumberOfBytes.value if dafny_input.CustomKeyStoreId.is_Some: - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId.value - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId.value).decode('utf-16-be') if dafny_input.Recipient.is_Some: - output["Recipient"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo( - dafny_input.Recipient.value - ) - ) + output["Recipient"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RecipientInfo(dafny_input.Recipient.value) return output - def com_amazonaws_kms_GenerateRandomResponse(dafny_input): output = {} if dafny_input.Plaintext.is_Some: output["Plaintext"] = bytes(dafny_input.Plaintext.value) if dafny_input.CiphertextForRecipient.is_Some: - output["CiphertextForRecipient"] = bytes( - dafny_input.CiphertextForRecipient.value - ) + output["CiphertextForRecipient"] = bytes(dafny_input.CiphertextForRecipient.value) return output - def com_amazonaws_kms_GetKeyPolicyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.PolicyName.is_Some: - output["PolicyName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.PolicyName.value - ).decode("utf-16-be") + output["PolicyName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.PolicyName.value).decode('utf-16-be') return output - def com_amazonaws_kms_GetKeyPolicyResponse(dafny_input): output = {} if dafny_input.Policy.is_Some: - output["Policy"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Policy.value - ).decode("utf-16-be") + output["Policy"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Policy.value).decode('utf-16-be') if dafny_input.PolicyName.is_Some: - output["PolicyName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.PolicyName.value - ).decode("utf-16-be") + output["PolicyName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.PolicyName.value).decode('utf-16-be') return output - def com_amazonaws_kms_GetKeyRotationStatusRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') return output - def com_amazonaws_kms_GetKeyRotationStatusResponse(dafny_input): output = {} if dafny_input.KeyRotationEnabled.is_Some: output["KeyRotationEnabled"] = dafny_input.KeyRotationEnabled.value if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.RotationPeriodInDays.is_Some: output["RotationPeriodInDays"] = dafny_input.RotationPeriodInDays.value if dafny_input.NextRotationDate.is_Some: - output["NextRotationDate"] = datetime.fromisoformat( - dafny_input.NextRotationDate.value.VerbatimString(False) - ) + output["NextRotationDate"] = datetime.fromisoformat(dafny_input.NextRotationDate.value.VerbatimString(False)) if dafny_input.OnDemandRotationStartDate.is_Some: - output["OnDemandRotationStartDate"] = datetime.fromisoformat( - dafny_input.OnDemandRotationStartDate.value.VerbatimString(False) - ) + output["OnDemandRotationStartDate"] = datetime.fromisoformat(dafny_input.OnDemandRotationStartDate.value.VerbatimString(False)) return output - def com_amazonaws_kms_AlgorithmSpec(dafny_input): # Convert AlgorithmSpec if isinstance(dafny_input, AlgorithmSpec_RSAES__PKCS1__V1__5): @@ -2471,7 +1728,6 @@ def com_amazonaws_kms_AlgorithmSpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_WrappingKeySpec(dafny_input): # Convert WrappingKeySpec if isinstance(dafny_input, WrappingKeySpec_RSA__2048): @@ -2489,31 +1745,17 @@ def com_amazonaws_kms_WrappingKeySpec(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_GetParametersForImportRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["WrappingAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_AlgorithmSpec( - dafny_input.WrappingAlgorithm - ) - ) - output["WrappingKeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_WrappingKeySpec( - dafny_input.WrappingKeySpec - ) - ) + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["WrappingAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_AlgorithmSpec(dafny_input.WrappingAlgorithm) + output["WrappingKeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_WrappingKeySpec(dafny_input.WrappingKeySpec) return output - def com_amazonaws_kms_GetParametersForImportResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.ImportToken.is_Some: output["ImportToken"] = bytes(dafny_input.ImportToken.value) @@ -2522,360 +1764,217 @@ def com_amazonaws_kms_GetParametersForImportResponse(dafny_input): output["PublicKey"] = bytes(dafny_input.PublicKey.value) if dafny_input.ParametersValidTo.is_Some: - output["ParametersValidTo"] = datetime.fromisoformat( - dafny_input.ParametersValidTo.value.VerbatimString(False) - ) + output["ParametersValidTo"] = datetime.fromisoformat(dafny_input.ParametersValidTo.value.VerbatimString(False)) return output - def com_amazonaws_kms_GetPublicKeyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] return output - def com_amazonaws_kms_GetPublicKeyResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.PublicKey.is_Some: output["PublicKey"] = bytes(dafny_input.PublicKey.value) if dafny_input.CustomerMasterKeySpec.is_Some: - output["CustomerMasterKeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomerMasterKeySpec( - dafny_input.CustomerMasterKeySpec.value - ) - ) + output["CustomerMasterKeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CustomerMasterKeySpec(dafny_input.CustomerMasterKeySpec.value) if dafny_input.KeySpec.is_Some: - output["KeySpec"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeySpec( - dafny_input.KeySpec.value - ) - ) + output["KeySpec"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeySpec(dafny_input.KeySpec.value) if dafny_input.KeyUsage.is_Some: - output["KeyUsage"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyUsageType( - dafny_input.KeyUsage.value - ) - ) + output["KeyUsage"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyUsageType(dafny_input.KeyUsage.value) if dafny_input.EncryptionAlgorithms.is_Some: - output["EncryptionAlgorithms"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - list_element - ) - for list_element in dafny_input.EncryptionAlgorithms.value - ] + output["EncryptionAlgorithms"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(list_element) for list_element in dafny_input.EncryptionAlgorithms.value] if dafny_input.SigningAlgorithms.is_Some: - output["SigningAlgorithms"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec( - list_element - ) - for list_element in dafny_input.SigningAlgorithms.value - ] + output["SigningAlgorithms"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec(list_element) for list_element in dafny_input.SigningAlgorithms.value] if dafny_input.KeyAgreementAlgorithms.is_Some: - output["KeyAgreementAlgorithms"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec( - list_element - ) - for list_element in dafny_input.KeyAgreementAlgorithms.value - ] + output["KeyAgreementAlgorithms"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyAgreementAlgorithmSpec(list_element) for list_element in dafny_input.KeyAgreementAlgorithms.value] return output - def com_amazonaws_kms_ImportKeyMaterialRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') output["ImportToken"] = bytes(dafny_input.ImportToken) output["EncryptedKeyMaterial"] = bytes(dafny_input.EncryptedKeyMaterial) if dafny_input.ValidTo.is_Some: - output["ValidTo"] = datetime.fromisoformat( - dafny_input.ValidTo.value.VerbatimString(False) - ) + output["ValidTo"] = datetime.fromisoformat(dafny_input.ValidTo.value.VerbatimString(False)) if dafny_input.ExpirationModel.is_Some: - output["ExpirationModel"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ExpirationModelType( - dafny_input.ExpirationModel.value - ) - ) + output["ExpirationModel"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ExpirationModelType(dafny_input.ExpirationModel.value) return output - def com_amazonaws_kms_ImportKeyMaterialResponse(dafny_input): output = {} return output - def com_amazonaws_kms_ListAliasesRequest(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.Limit.is_Some: output["Limit"] = dafny_input.Limit.value if dafny_input.Marker.is_Some: - output["Marker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Marker.value - ).decode("utf-16-be") + output["Marker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Marker.value).decode('utf-16-be') return output - def com_amazonaws_kms_AliasListEntry(dafny_input): output = {} if dafny_input.AliasName.is_Some: - output["AliasName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AliasName.value - ).decode("utf-16-be") + output["AliasName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AliasName.value).decode('utf-16-be') if dafny_input.AliasArn.is_Some: - output["AliasArn"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AliasArn.value - ).decode("utf-16-be") + output["AliasArn"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AliasArn.value).decode('utf-16-be') if dafny_input.TargetKeyId.is_Some: - output["TargetKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.TargetKeyId.value - ).decode("utf-16-be") + output["TargetKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.TargetKeyId.value).decode('utf-16-be') if dafny_input.CreationDate.is_Some: - output["CreationDate"] = datetime.fromisoformat( - dafny_input.CreationDate.value.VerbatimString(False) - ) + output["CreationDate"] = datetime.fromisoformat(dafny_input.CreationDate.value.VerbatimString(False)) if dafny_input.LastUpdatedDate.is_Some: - output["LastUpdatedDate"] = datetime.fromisoformat( - dafny_input.LastUpdatedDate.value.VerbatimString(False) - ) + output["LastUpdatedDate"] = datetime.fromisoformat(dafny_input.LastUpdatedDate.value.VerbatimString(False)) return output - def com_amazonaws_kms_ListAliasesResponse(dafny_input): output = {} if dafny_input.Aliases.is_Some: - output["Aliases"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_AliasListEntry( - list_element - ) - for list_element in dafny_input.Aliases.value - ] + output["Aliases"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_AliasListEntry(list_element) for list_element in dafny_input.Aliases.value] if dafny_input.NextMarker.is_Some: - output["NextMarker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NextMarker.value - ).decode("utf-16-be") + output["NextMarker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NextMarker.value).decode('utf-16-be') if dafny_input.Truncated.is_Some: output["Truncated"] = dafny_input.Truncated.value return output - def com_amazonaws_kms_ListGrantsRequest(dafny_input): output = {} if dafny_input.Limit.is_Some: output["Limit"] = dafny_input.Limit.value if dafny_input.Marker.is_Some: - output["Marker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Marker.value - ).decode("utf-16-be") + output["Marker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Marker.value).decode('utf-16-be') - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.GrantId.is_Some: - output["GrantId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GrantId.value - ).decode("utf-16-be") + output["GrantId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GrantId.value).decode('utf-16-be') if dafny_input.GranteePrincipal.is_Some: - output["GranteePrincipal"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GranteePrincipal.value - ).decode("utf-16-be") + output["GranteePrincipal"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GranteePrincipal.value).decode('utf-16-be') return output - def com_amazonaws_kms_GrantListEntry(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.GrantId.is_Some: - output["GrantId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GrantId.value - ).decode("utf-16-be") + output["GrantId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GrantId.value).decode('utf-16-be') if dafny_input.Name.is_Some: - output["Name"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Name.value - ).decode("utf-16-be") + output["Name"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Name.value).decode('utf-16-be') if dafny_input.CreationDate.is_Some: - output["CreationDate"] = datetime.fromisoformat( - dafny_input.CreationDate.value.VerbatimString(False) - ) + output["CreationDate"] = datetime.fromisoformat(dafny_input.CreationDate.value.VerbatimString(False)) if dafny_input.GranteePrincipal.is_Some: - output["GranteePrincipal"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GranteePrincipal.value - ).decode("utf-16-be") + output["GranteePrincipal"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GranteePrincipal.value).decode('utf-16-be') if dafny_input.RetiringPrincipal.is_Some: - output["RetiringPrincipal"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.RetiringPrincipal.value - ).decode("utf-16-be") + output["RetiringPrincipal"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.RetiringPrincipal.value).decode('utf-16-be') if dafny_input.IssuingAccount.is_Some: - output["IssuingAccount"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.IssuingAccount.value - ).decode("utf-16-be") + output["IssuingAccount"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.IssuingAccount.value).decode('utf-16-be') if dafny_input.Operations.is_Some: - output["Operations"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantOperation( - list_element - ) - for list_element in dafny_input.Operations.value - ] + output["Operations"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantOperation(list_element) for list_element in dafny_input.Operations.value] if dafny_input.Constraints.is_Some: - output["Constraints"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantConstraints( - dafny_input.Constraints.value - ) - ) + output["Constraints"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantConstraints(dafny_input.Constraints.value) return output - def com_amazonaws_kms_ListGrantsResponse(dafny_input): output = {} if dafny_input.Grants.is_Some: - output["Grants"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantListEntry( - list_element - ) - for list_element in dafny_input.Grants.value - ] + output["Grants"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GrantListEntry(list_element) for list_element in dafny_input.Grants.value] if dafny_input.NextMarker.is_Some: - output["NextMarker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NextMarker.value - ).decode("utf-16-be") + output["NextMarker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NextMarker.value).decode('utf-16-be') if dafny_input.Truncated.is_Some: output["Truncated"] = dafny_input.Truncated.value return output - def com_amazonaws_kms_ListKeyPoliciesRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.Limit.is_Some: output["Limit"] = dafny_input.Limit.value if dafny_input.Marker.is_Some: - output["Marker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Marker.value - ).decode("utf-16-be") + output["Marker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Marker.value).decode('utf-16-be') return output - def com_amazonaws_kms_ListKeyPoliciesResponse(dafny_input): output = {} if dafny_input.PolicyNames.is_Some: - output["PolicyNames"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.PolicyNames.value - ] + output["PolicyNames"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.PolicyNames.value] if dafny_input.NextMarker.is_Some: - output["NextMarker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NextMarker.value - ).decode("utf-16-be") + output["NextMarker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NextMarker.value).decode('utf-16-be') if dafny_input.Truncated.is_Some: output["Truncated"] = dafny_input.Truncated.value return output - def com_amazonaws_kms_ListKeyRotationsRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.Limit.is_Some: output["Limit"] = dafny_input.Limit.value if dafny_input.Marker.is_Some: - output["Marker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Marker.value - ).decode("utf-16-be") + output["Marker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Marker.value).decode('utf-16-be') return output - def com_amazonaws_kms_RotationsListEntry(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.RotationDate.is_Some: - output["RotationDate"] = datetime.fromisoformat( - dafny_input.RotationDate.value.VerbatimString(False) - ) + output["RotationDate"] = datetime.fromisoformat(dafny_input.RotationDate.value.VerbatimString(False)) if dafny_input.RotationType.is_Some: - output["RotationType"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RotationType( - dafny_input.RotationType.value - ) - ) + output["RotationType"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RotationType(dafny_input.RotationType.value) return output - def com_amazonaws_kms_RotationType(dafny_input): # Convert RotationType if isinstance(dafny_input, RotationType_AUTOMATIC): @@ -2887,372 +1986,226 @@ def com_amazonaws_kms_RotationType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_ListKeyRotationsResponse(dafny_input): output = {} if dafny_input.Rotations.is_Some: - output["Rotations"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RotationsListEntry( - list_element - ) - for list_element in dafny_input.Rotations.value - ] + output["Rotations"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RotationsListEntry(list_element) for list_element in dafny_input.Rotations.value] if dafny_input.NextMarker.is_Some: - output["NextMarker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NextMarker.value - ).decode("utf-16-be") + output["NextMarker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NextMarker.value).decode('utf-16-be') if dafny_input.Truncated.is_Some: output["Truncated"] = dafny_input.Truncated.value return output - def com_amazonaws_kms_ListKeysRequest(dafny_input): output = {} if dafny_input.Limit.is_Some: output["Limit"] = dafny_input.Limit.value if dafny_input.Marker.is_Some: - output["Marker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Marker.value - ).decode("utf-16-be") + output["Marker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Marker.value).decode('utf-16-be') return output - def com_amazonaws_kms_KeyListEntry(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.KeyArn.is_Some: - output["KeyArn"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyArn.value - ).decode("utf-16-be") + output["KeyArn"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyArn.value).decode('utf-16-be') return output - def com_amazonaws_kms_ListKeysResponse(dafny_input): output = {} if dafny_input.Keys.is_Some: - output["Keys"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyListEntry( - list_element - ) - for list_element in dafny_input.Keys.value - ] + output["Keys"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyListEntry(list_element) for list_element in dafny_input.Keys.value] if dafny_input.NextMarker.is_Some: - output["NextMarker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NextMarker.value - ).decode("utf-16-be") + output["NextMarker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NextMarker.value).decode('utf-16-be') if dafny_input.Truncated.is_Some: output["Truncated"] = dafny_input.Truncated.value return output - def com_amazonaws_kms_ListResourceTagsRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.Limit.is_Some: output["Limit"] = dafny_input.Limit.value if dafny_input.Marker.is_Some: - output["Marker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Marker.value - ).decode("utf-16-be") + output["Marker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Marker.value).decode('utf-16-be') return output - def com_amazonaws_kms_ListResourceTagsResponse(dafny_input): output = {} if dafny_input.Tags.is_Some: - output["Tags"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag( - list_element - ) - for list_element in dafny_input.Tags.value - ] + output["Tags"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag(list_element) for list_element in dafny_input.Tags.value] if dafny_input.NextMarker.is_Some: - output["NextMarker"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NextMarker.value - ).decode("utf-16-be") + output["NextMarker"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NextMarker.value).decode('utf-16-be') if dafny_input.Truncated.is_Some: output["Truncated"] = dafny_input.Truncated.value return output - def com_amazonaws_kms_PutKeyPolicyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.PolicyName.is_Some: - output["PolicyName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.PolicyName.value - ).decode("utf-16-be") + output["PolicyName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.PolicyName.value).decode('utf-16-be') - output["Policy"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Policy - ).decode("utf-16-be") + output["Policy"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Policy).decode('utf-16-be') if dafny_input.BypassPolicyLockoutSafetyCheck.is_Some: - output["BypassPolicyLockoutSafetyCheck"] = ( - dafny_input.BypassPolicyLockoutSafetyCheck.value - ) + output["BypassPolicyLockoutSafetyCheck"] = dafny_input.BypassPolicyLockoutSafetyCheck.value return output - def com_amazonaws_kms_ReEncryptRequest(dafny_input): output = {} output["CiphertextBlob"] = bytes(dafny_input.CiphertextBlob) if dafny_input.SourceEncryptionContext.is_Some: - output["SourceEncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.SourceEncryptionContext.value.items - } + output["SourceEncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.SourceEncryptionContext.value.items } if dafny_input.SourceKeyId.is_Some: - output["SourceKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.SourceKeyId.value - ).decode("utf-16-be") + output["SourceKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.SourceKeyId.value).decode('utf-16-be') - output["DestinationKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.DestinationKeyId - ).decode("utf-16-be") + output["DestinationKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.DestinationKeyId).decode('utf-16-be') if dafny_input.DestinationEncryptionContext.is_Some: - output["DestinationEncryptionContext"] = { - b"".join(ord(c).to_bytes(2, "big") for c in key) - .decode("utf-16-be"): b"".join(ord(c).to_bytes(2, "big") for c in value) - .decode("utf-16-be") - for (key, value) in dafny_input.DestinationEncryptionContext.value.items - } + output["DestinationEncryptionContext"] = {b''.join(ord(c).to_bytes(2, 'big') for c in key).decode('utf-16-be'): b''.join(ord(c).to_bytes(2, 'big') for c in value).decode('utf-16-be') for (key, value) in dafny_input.DestinationEncryptionContext.value.items } if dafny_input.SourceEncryptionAlgorithm.is_Some: - output["SourceEncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.SourceEncryptionAlgorithm.value - ) - ) + output["SourceEncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.SourceEncryptionAlgorithm.value) if dafny_input.DestinationEncryptionAlgorithm.is_Some: - output["DestinationEncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.DestinationEncryptionAlgorithm.value - ) - ) + output["DestinationEncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.DestinationEncryptionAlgorithm.value) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_ReEncryptResponse(dafny_input): output = {} if dafny_input.CiphertextBlob.is_Some: output["CiphertextBlob"] = bytes(dafny_input.CiphertextBlob.value) if dafny_input.SourceKeyId.is_Some: - output["SourceKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.SourceKeyId.value - ).decode("utf-16-be") + output["SourceKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.SourceKeyId.value).decode('utf-16-be') if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.SourceEncryptionAlgorithm.is_Some: - output["SourceEncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.SourceEncryptionAlgorithm.value - ) - ) + output["SourceEncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.SourceEncryptionAlgorithm.value) if dafny_input.DestinationEncryptionAlgorithm.is_Some: - output["DestinationEncryptionAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.DestinationEncryptionAlgorithm.value - ) - ) + output["DestinationEncryptionAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.DestinationEncryptionAlgorithm.value) return output - def com_amazonaws_kms_ReplicateKeyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["ReplicaRegion"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.ReplicaRegion - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["ReplicaRegion"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.ReplicaRegion).decode('utf-16-be') if dafny_input.Policy.is_Some: - output["Policy"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Policy.value - ).decode("utf-16-be") + output["Policy"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Policy.value).decode('utf-16-be') if dafny_input.BypassPolicyLockoutSafetyCheck.is_Some: - output["BypassPolicyLockoutSafetyCheck"] = ( - dafny_input.BypassPolicyLockoutSafetyCheck.value - ) + output["BypassPolicyLockoutSafetyCheck"] = dafny_input.BypassPolicyLockoutSafetyCheck.value if dafny_input.Description.is_Some: - output["Description"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Description.value - ).decode("utf-16-be") + output["Description"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Description.value).decode('utf-16-be') if dafny_input.Tags.is_Some: - output["Tags"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag( - list_element - ) - for list_element in dafny_input.Tags.value - ] + output["Tags"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag(list_element) for list_element in dafny_input.Tags.value] return output - def com_amazonaws_kms_ReplicateKeyResponse(dafny_input): output = {} if dafny_input.ReplicaKeyMetadata.is_Some: - output["ReplicaKeyMetadata"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyMetadata( - dafny_input.ReplicaKeyMetadata.value - ) - ) + output["ReplicaKeyMetadata"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyMetadata(dafny_input.ReplicaKeyMetadata.value) if dafny_input.ReplicaPolicy.is_Some: - output["ReplicaPolicy"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.ReplicaPolicy.value - ).decode("utf-16-be") + output["ReplicaPolicy"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.ReplicaPolicy.value).decode('utf-16-be') if dafny_input.ReplicaTags.is_Some: - output["ReplicaTags"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag( - list_element - ) - for list_element in dafny_input.ReplicaTags.value - ] + output["ReplicaTags"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag(list_element) for list_element in dafny_input.ReplicaTags.value] return output - def com_amazonaws_kms_RetireGrantRequest(dafny_input): output = {} if dafny_input.GrantToken.is_Some: - output["GrantToken"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GrantToken.value - ).decode("utf-16-be") + output["GrantToken"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GrantToken.value).decode('utf-16-be') if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.GrantId.is_Some: - output["GrantId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GrantId.value - ).decode("utf-16-be") + output["GrantId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GrantId.value).decode('utf-16-be') if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_RevokeGrantRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["GrantId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.GrantId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["GrantId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.GrantId).decode('utf-16-be') if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_RotateKeyOnDemandRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') return output - def com_amazonaws_kms_RotateKeyOnDemandResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') return output - def com_amazonaws_kms_ScheduleKeyDeletionRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') if dafny_input.PendingWindowInDays.is_Some: output["PendingWindowInDays"] = dafny_input.PendingWindowInDays.value return output - def com_amazonaws_kms_ScheduleKeyDeletionResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.DeletionDate.is_Some: - output["DeletionDate"] = datetime.fromisoformat( - dafny_input.DeletionDate.value.VerbatimString(False) - ) + output["DeletionDate"] = datetime.fromisoformat(dafny_input.DeletionDate.value.VerbatimString(False)) if dafny_input.KeyState.is_Some: - output["KeyState"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyState( - dafny_input.KeyState.value - ) - ) + output["KeyState"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_KeyState(dafny_input.KeyState.value) if dafny_input.PendingWindowInDays.is_Some: output["PendingWindowInDays"] = dafny_input.PendingWindowInDays.value return output - def com_amazonaws_kms_MessageType(dafny_input): # Convert MessageType if isinstance(dafny_input, MessageType_RAW): @@ -3264,270 +2217,151 @@ def com_amazonaws_kms_MessageType(dafny_input): else: raise ValueError("No recognized enum value in enum type: " + dafny_input) - def com_amazonaws_kms_SignRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') output["Message"] = bytes(dafny_input.Message) if dafny_input.MessageType.is_Some: - output["MessageType"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MessageType( - dafny_input.MessageType.value - ) - ) + output["MessageType"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MessageType(dafny_input.MessageType.value) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] - - output["SigningAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec( - dafny_input.SigningAlgorithm - ) - ) + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] + + output["SigningAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec(dafny_input.SigningAlgorithm) if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_SignResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.Signature.is_Some: output["Signature"] = bytes(dafny_input.Signature.value) if dafny_input.SigningAlgorithm.is_Some: - output["SigningAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec( - dafny_input.SigningAlgorithm.value - ) - ) + output["SigningAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec(dafny_input.SigningAlgorithm.value) return output - def com_amazonaws_kms_TagResourceRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["Tags"] = [ - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag( - list_element - ) - for list_element in dafny_input.Tags - ] + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["Tags"] = [aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_Tag(list_element) for list_element in dafny_input.Tags] return output - def com_amazonaws_kms_UntagResourceRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["TagKeys"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode("utf-16-be") - for list_element in dafny_input.TagKeys - ] + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["TagKeys"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.TagKeys] return output - def com_amazonaws_kms_UpdateAliasRequest(dafny_input): output = {} - output["AliasName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.AliasName - ).decode("utf-16-be") - output["TargetKeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.TargetKeyId - ).decode("utf-16-be") + output["AliasName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.AliasName).decode('utf-16-be') + output["TargetKeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.TargetKeyId).decode('utf-16-be') return output - def com_amazonaws_kms_UpdateCustomKeyStoreRequest(dafny_input): output = {} - output["CustomKeyStoreId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CustomKeyStoreId - ).decode("utf-16-be") + output["CustomKeyStoreId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CustomKeyStoreId).decode('utf-16-be') if dafny_input.NewCustomKeyStoreName.is_Some: - output["NewCustomKeyStoreName"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.NewCustomKeyStoreName.value - ).decode("utf-16-be") + output["NewCustomKeyStoreName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.NewCustomKeyStoreName.value).decode('utf-16-be') if dafny_input.KeyStorePassword.is_Some: - output["KeyStorePassword"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyStorePassword.value - ).decode("utf-16-be") + output["KeyStorePassword"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyStorePassword.value).decode('utf-16-be') if dafny_input.CloudHsmClusterId.is_Some: - output["CloudHsmClusterId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.CloudHsmClusterId.value - ).decode("utf-16-be") + output["CloudHsmClusterId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.CloudHsmClusterId.value).decode('utf-16-be') if dafny_input.XksProxyUriEndpoint.is_Some: - output["XksProxyUriEndpoint"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.XksProxyUriEndpoint.value - ).decode("utf-16-be") + output["XksProxyUriEndpoint"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.XksProxyUriEndpoint.value).decode('utf-16-be') if dafny_input.XksProxyUriPath.is_Some: - output["XksProxyUriPath"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.XksProxyUriPath.value - ).decode("utf-16-be") + output["XksProxyUriPath"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.XksProxyUriPath.value).decode('utf-16-be') if dafny_input.XksProxyVpcEndpointServiceName.is_Some: - output["XksProxyVpcEndpointServiceName"] = b"".join( - ord(c).to_bytes(2, "big") - for c in dafny_input.XksProxyVpcEndpointServiceName.value - ).decode("utf-16-be") + output["XksProxyVpcEndpointServiceName"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.XksProxyVpcEndpointServiceName.value).decode('utf-16-be') if dafny_input.XksProxyAuthenticationCredential.is_Some: - output["XksProxyAuthenticationCredential"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyAuthenticationCredentialType( - dafny_input.XksProxyAuthenticationCredential.value - ) - ) + output["XksProxyAuthenticationCredential"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyAuthenticationCredentialType(dafny_input.XksProxyAuthenticationCredential.value) if dafny_input.XksProxyConnectivity.is_Some: - output["XksProxyConnectivity"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConnectivityType( - dafny_input.XksProxyConnectivity.value - ) - ) + output["XksProxyConnectivity"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_XksProxyConnectivityType(dafny_input.XksProxyConnectivity.value) return output - def com_amazonaws_kms_UpdateCustomKeyStoreResponse(dafny_input): output = {} return output - def com_amazonaws_kms_UpdateKeyDescriptionRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["Description"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.Description - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["Description"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.Description).decode('utf-16-be') return output - def com_amazonaws_kms_UpdatePrimaryRegionRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["PrimaryRegion"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.PrimaryRegion - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["PrimaryRegion"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.PrimaryRegion).decode('utf-16-be') return output - def com_amazonaws_kms_VerifyRequest(dafny_input): output = {} - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') output["Message"] = bytes(dafny_input.Message) if dafny_input.MessageType.is_Some: - output["MessageType"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MessageType( - dafny_input.MessageType.value - ) - ) + output["MessageType"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MessageType(dafny_input.MessageType.value) output["Signature"] = bytes(dafny_input.Signature) - output["SigningAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec( - dafny_input.SigningAlgorithm - ) - ) + output["SigningAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec(dafny_input.SigningAlgorithm) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_VerifyResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.SignatureValid.is_Some: output["SignatureValid"] = dafny_input.SignatureValid.value if dafny_input.SigningAlgorithm.is_Some: - output["SigningAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec( - dafny_input.SigningAlgorithm.value - ) - ) + output["SigningAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SigningAlgorithmSpec(dafny_input.SigningAlgorithm.value) return output - def com_amazonaws_kms_VerifyMacRequest(dafny_input): output = {} output["Message"] = bytes(dafny_input.Message) - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId - ).decode("utf-16-be") - output["MacAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec( - dafny_input.MacAlgorithm - ) - ) + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId).decode('utf-16-be') + output["MacAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec(dafny_input.MacAlgorithm) output["Mac"] = bytes(dafny_input.Mac) if dafny_input.GrantTokens.is_Some: - output["GrantTokens"] = [ - b"".join(ord(c).to_bytes(2, "big") for c in list_element).decode( - "utf-16-be" - ) - for list_element in dafny_input.GrantTokens.value - ] + output["GrantTokens"] = [b''.join(ord(c).to_bytes(2, 'big') for c in list_element).decode('utf-16-be') for list_element in dafny_input.GrantTokens.value] if dafny_input.DryRun.is_Some: output["DryRun"] = dafny_input.DryRun.value return output - def com_amazonaws_kms_VerifyMacResponse(dafny_input): output = {} if dafny_input.KeyId.is_Some: - output["KeyId"] = b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.KeyId.value - ).decode("utf-16-be") + output["KeyId"] = b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.KeyId.value).decode('utf-16-be') if dafny_input.MacValid.is_Some: output["MacValid"] = dafny_input.MacValid.value if dafny_input.MacAlgorithm.is_Some: - output["MacAlgorithm"] = ( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec( - dafny_input.MacAlgorithm.value - ) - ) + output["MacAlgorithm"] = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_MacAlgorithmSpec(dafny_input.MacAlgorithm.value) return output diff --git a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/shim.py b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/shim.py index 862adbf90..cef0b2333 100644 --- a/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/shim.py +++ b/ComAmazonawsKms/runtimes/python/src/aws_cryptography_internal_kms/smithygenerated/com_amazonaws_kms/shim.py @@ -105,314 +105,192 @@ from botocore.exceptions import ClientError import aws_cryptography_internal_kms.internaldafny.generated.ComAmazonawsKmsTypes - def _sdk_error_to_dafny_error(e: ClientError): - """Converts the provided native Smithy-modelled error into the - corresponding Dafny error.""" - if e.response["Error"]["Code"] == "AlreadyExistsException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_AlreadyExistsException( - e.response - ) - - elif e.response["Error"]["Code"] == "CloudHsmClusterInUseException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterInUseException( - e.response - ) - - elif e.response["Error"]["Code"] == "CloudHsmClusterInvalidConfigurationException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException( - e.response - ) - - elif e.response["Error"]["Code"] == "CloudHsmClusterNotActiveException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterNotActiveException( - e.response - ) - - elif e.response["Error"]["Code"] == "CloudHsmClusterNotFoundException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterNotFoundException( - e.response - ) - - elif e.response["Error"]["Code"] == "CloudHsmClusterNotRelatedException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterNotRelatedException( - e.response - ) - - elif e.response["Error"]["Code"] == "ConflictException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConflictException( - e.response - ) - - elif e.response["Error"]["Code"] == "CustomKeyStoreHasCMKsException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreHasCMKsException( - e.response - ) - - elif e.response["Error"]["Code"] == "CustomKeyStoreInvalidStateException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreInvalidStateException( - e.response - ) - - elif e.response["Error"]["Code"] == "CustomKeyStoreNameInUseException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreNameInUseException( - e.response - ) - - elif e.response["Error"]["Code"] == "CustomKeyStoreNotFoundException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreNotFoundException( - e.response - ) - - elif e.response["Error"]["Code"] == "DependencyTimeoutException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DependencyTimeoutException( - e.response - ) - - elif e.response["Error"]["Code"] == "DisabledException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DisabledException( - e.response - ) - - elif e.response["Error"]["Code"] == "DryRunOperationException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DryRunOperationException( - e.response - ) - - elif e.response["Error"]["Code"] == "ExpiredImportTokenException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ExpiredImportTokenException( - e.response - ) - - elif e.response["Error"]["Code"] == "IncorrectKeyException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_IncorrectKeyException( - e.response - ) - - elif e.response["Error"]["Code"] == "IncorrectKeyMaterialException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_IncorrectKeyMaterialException( - e.response - ) - - elif e.response["Error"]["Code"] == "IncorrectTrustAnchorException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_IncorrectTrustAnchorException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidAliasNameException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidAliasNameException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidArnException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidArnException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidCiphertextException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidCiphertextException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidGrantIdException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidGrantIdException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidGrantTokenException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidGrantTokenException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidImportTokenException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidImportTokenException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidKeyUsageException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidKeyUsageException( - e.response - ) - - elif e.response["Error"]["Code"] == "InvalidMarkerException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidMarkerException( - e.response - ) - - elif e.response["Error"]["Code"] == "KeyUnavailableException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUnavailableException( - e.response - ) - - elif e.response["Error"]["Code"] == "KMSInternalException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInternalException( - e.response - ) - - elif e.response["Error"]["Code"] == "KMSInvalidMacException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInvalidMacException( - e.response - ) - - elif e.response["Error"]["Code"] == "KMSInvalidSignatureException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInvalidSignatureException( - e.response - ) - - elif e.response["Error"]["Code"] == "KMSInvalidStateException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInvalidStateException( - e.response - ) - - elif e.response["Error"]["Code"] == "LimitExceededException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_LimitExceededException( - e.response - ) - - elif e.response["Error"]["Code"] == "MalformedPolicyDocumentException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MalformedPolicyDocumentException( - e.response - ) - - elif e.response["Error"]["Code"] == "NotFoundException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_NotFoundException( - e.response - ) - - elif e.response["Error"]["Code"] == "TagException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_TagException( - e.response - ) - - elif e.response["Error"]["Code"] == "UnsupportedOperationException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_UnsupportedOperationException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksKeyAlreadyInUseException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyAlreadyInUseException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksKeyInvalidConfigurationException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyInvalidConfigurationException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksKeyNotFoundException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyNotFoundException( - e.response - ) - - elif ( - e.response["Error"]["Code"] - == "XksProxyIncorrectAuthenticationCredentialException" - ): - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksProxyInvalidConfigurationException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyInvalidConfigurationException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksProxyInvalidResponseException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyInvalidResponseException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksProxyUriEndpointInUseException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyUriEndpointInUseException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksProxyUriInUseException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyUriInUseException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksProxyUriUnreachableException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyUriUnreachableException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksProxyVpcEndpointServiceInUseException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException( - e.response - ) - - elif ( - e.response["Error"]["Code"] - == "XksProxyVpcEndpointServiceInvalidConfigurationException" - ): - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException( - e.response - ) - - elif e.response["Error"]["Code"] == "XksProxyVpcEndpointServiceNotFoundException": - return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException( - e.response - ) - - return aws_cryptography_internal_kms.internaldafny.generated.ComAmazonawsKmsTypes.Error_Opaque( - obj=e, - alt__text=_dafny.Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip(*[iter(repr(e).encode("utf-16-be"))] * 2) - ] + """ + Converts the provided native Smithy-modelled error + into the corresponding Dafny error. + """ + if e.response['Error']['Code'] == 'AlreadyExistsException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_AlreadyExistsException(e.response) + + elif e.response['Error']['Code'] == 'CloudHsmClusterInUseException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterInUseException(e.response) + + elif e.response['Error']['Code'] == 'CloudHsmClusterInvalidConfigurationException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterInvalidConfigurationException(e.response) + + elif e.response['Error']['Code'] == 'CloudHsmClusterNotActiveException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterNotActiveException(e.response) + + elif e.response['Error']['Code'] == 'CloudHsmClusterNotFoundException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterNotFoundException(e.response) + + elif e.response['Error']['Code'] == 'CloudHsmClusterNotRelatedException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CloudHsmClusterNotRelatedException(e.response) + + elif e.response['Error']['Code'] == 'ConflictException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConflictException(e.response) + + elif e.response['Error']['Code'] == 'CustomKeyStoreHasCMKsException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreHasCMKsException(e.response) + + elif e.response['Error']['Code'] == 'CustomKeyStoreInvalidStateException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreInvalidStateException(e.response) + + elif e.response['Error']['Code'] == 'CustomKeyStoreNameInUseException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreNameInUseException(e.response) + + elif e.response['Error']['Code'] == 'CustomKeyStoreNotFoundException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CustomKeyStoreNotFoundException(e.response) + + elif e.response['Error']['Code'] == 'DependencyTimeoutException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DependencyTimeoutException(e.response) + + elif e.response['Error']['Code'] == 'DisabledException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DisabledException(e.response) + + elif e.response['Error']['Code'] == 'DryRunOperationException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DryRunOperationException(e.response) + + elif e.response['Error']['Code'] == 'ExpiredImportTokenException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ExpiredImportTokenException(e.response) + + elif e.response['Error']['Code'] == 'IncorrectKeyException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_IncorrectKeyException(e.response) + + elif e.response['Error']['Code'] == 'IncorrectKeyMaterialException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_IncorrectKeyMaterialException(e.response) + + elif e.response['Error']['Code'] == 'IncorrectTrustAnchorException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_IncorrectTrustAnchorException(e.response) + + elif e.response['Error']['Code'] == 'InvalidAliasNameException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidAliasNameException(e.response) + + elif e.response['Error']['Code'] == 'InvalidArnException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidArnException(e.response) + + elif e.response['Error']['Code'] == 'InvalidCiphertextException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidCiphertextException(e.response) + + elif e.response['Error']['Code'] == 'InvalidGrantIdException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidGrantIdException(e.response) + + elif e.response['Error']['Code'] == 'InvalidGrantTokenException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidGrantTokenException(e.response) + + elif e.response['Error']['Code'] == 'InvalidImportTokenException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidImportTokenException(e.response) + + elif e.response['Error']['Code'] == 'InvalidKeyUsageException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidKeyUsageException(e.response) + + elif e.response['Error']['Code'] == 'InvalidMarkerException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_InvalidMarkerException(e.response) + + elif e.response['Error']['Code'] == 'KeyUnavailableException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KeyUnavailableException(e.response) + + elif e.response['Error']['Code'] == 'KMSInternalException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInternalException(e.response) + + elif e.response['Error']['Code'] == 'KMSInvalidMacException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInvalidMacException(e.response) + + elif e.response['Error']['Code'] == 'KMSInvalidSignatureException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInvalidSignatureException(e.response) + + elif e.response['Error']['Code'] == 'KMSInvalidStateException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_KMSInvalidStateException(e.response) + + elif e.response['Error']['Code'] == 'LimitExceededException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_LimitExceededException(e.response) + + elif e.response['Error']['Code'] == 'MalformedPolicyDocumentException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_MalformedPolicyDocumentException(e.response) + + elif e.response['Error']['Code'] == 'NotFoundException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_NotFoundException(e.response) + + elif e.response['Error']['Code'] == 'TagException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_TagException(e.response) + + elif e.response['Error']['Code'] == 'UnsupportedOperationException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_UnsupportedOperationException(e.response) + + elif e.response['Error']['Code'] == 'XksKeyAlreadyInUseException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyAlreadyInUseException(e.response) + + elif e.response['Error']['Code'] == 'XksKeyInvalidConfigurationException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyInvalidConfigurationException(e.response) + + elif e.response['Error']['Code'] == 'XksKeyNotFoundException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksKeyNotFoundException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyIncorrectAuthenticationCredentialException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyIncorrectAuthenticationCredentialException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyInvalidConfigurationException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyInvalidConfigurationException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyInvalidResponseException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyInvalidResponseException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyUriEndpointInUseException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyUriEndpointInUseException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyUriInUseException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyUriInUseException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyUriUnreachableException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyUriUnreachableException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyVpcEndpointServiceInUseException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyVpcEndpointServiceInUseException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyVpcEndpointServiceInvalidConfigurationException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyVpcEndpointServiceInvalidConfigurationException(e.response) + + elif e.response['Error']['Code'] == 'XksProxyVpcEndpointServiceNotFoundException': + return aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_XksProxyVpcEndpointServiceNotFoundException(e.response) + + return aws_cryptography_internal_kms.internaldafny.generated.ComAmazonawsKmsTypes.Error_Opaque(obj=e, alt__text= _dafny.Seq( + "".join( + [ + chr(int.from_bytes(pair, "big")) + for pair in zip( + *[iter(repr(e).encode("utf-16-be"))] * 2 + ) + ] + ) ) - ), ) - class KMSClientShim: def __init__(self, _impl, _region): self._impl = _impl self._region = _region - def CancelKeyDeletion( - self, input: DafnyCancelKeyDeletionRequest - ) -> DafnyCancelKeyDeletionResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CancelKeyDeletionRequest( - input - ) + def CancelKeyDeletion(self, input: DafnyCancelKeyDeletionRequest) -> DafnyCancelKeyDeletionResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CancelKeyDeletionRequest(input) try: boto_response_dict = self._impl.cancel_key_deletion(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CancelKeyDeletionResponse( - boto_response_dict - ) - ) - - def ConnectCustomKeyStore( - self, input: DafnyConnectCustomKeyStoreRequest - ) -> DafnyConnectCustomKeyStoreResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ConnectCustomKeyStoreRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CancelKeyDeletionResponse(boto_response_dict)) + + def ConnectCustomKeyStore(self, input: DafnyConnectCustomKeyStoreRequest) -> DafnyConnectCustomKeyStoreResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ConnectCustomKeyStoreRequest(input) try: - boto_response_dict = self._impl.connect_custom_key_store( - **boto_request_dict - ) + boto_response_dict = self._impl.connect_custom_key_store(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConnectCustomKeyStoreResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ConnectCustomKeyStoreResponse(boto_response_dict)) def CreateAlias(self, input: DafnyCreateAliasRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateAliasRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateAliasRequest(input) try: boto_response_dict = self._impl.create_alias(**boto_request_dict) except ClientError as e: @@ -420,72 +298,44 @@ def CreateAlias(self, input: DafnyCreateAliasRequest) -> None: return Wrappers.Result_Success(None) - def CreateCustomKeyStore( - self, input: DafnyCreateCustomKeyStoreRequest - ) -> DafnyCreateCustomKeyStoreResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateCustomKeyStoreRequest( - input - ) + def CreateCustomKeyStore(self, input: DafnyCreateCustomKeyStoreRequest) -> DafnyCreateCustomKeyStoreResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateCustomKeyStoreRequest(input) try: boto_response_dict = self._impl.create_custom_key_store(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CreateCustomKeyStoreResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CreateCustomKeyStoreResponse(boto_response_dict)) def CreateGrant(self, input: DafnyCreateGrantRequest) -> DafnyCreateGrantResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateGrantRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateGrantRequest(input) try: boto_response_dict = self._impl.create_grant(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CreateGrantResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CreateGrantResponse(boto_response_dict)) def CreateKey(self, input: DafnyCreateKeyRequest) -> DafnyCreateKeyResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateKeyRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_CreateKeyRequest(input) try: boto_response_dict = self._impl.create_key(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CreateKeyResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_CreateKeyResponse(boto_response_dict)) def Decrypt(self, input: DafnyDecryptRequest) -> DafnyDecryptResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DecryptRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DecryptRequest(input) try: boto_response_dict = self._impl.decrypt(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DecryptResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DecryptResponse(boto_response_dict)) def DeleteAlias(self, input: DafnyDeleteAliasRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeleteAliasRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeleteAliasRequest(input) try: boto_response_dict = self._impl.delete_alias(**boto_request_dict) except ClientError as e: @@ -493,93 +343,53 @@ def DeleteAlias(self, input: DafnyDeleteAliasRequest) -> None: return Wrappers.Result_Success(None) - def DeleteCustomKeyStore( - self, input: DafnyDeleteCustomKeyStoreRequest - ) -> DafnyDeleteCustomKeyStoreResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeleteCustomKeyStoreRequest( - input - ) + def DeleteCustomKeyStore(self, input: DafnyDeleteCustomKeyStoreRequest) -> DafnyDeleteCustomKeyStoreResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeleteCustomKeyStoreRequest(input) try: boto_response_dict = self._impl.delete_custom_key_store(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DeleteCustomKeyStoreResponse( - boto_response_dict - ) - ) - - def DeleteImportedKeyMaterial( - self, input: DafnyDeleteImportedKeyMaterialRequest - ) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeleteImportedKeyMaterialRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DeleteCustomKeyStoreResponse(boto_response_dict)) + + def DeleteImportedKeyMaterial(self, input: DafnyDeleteImportedKeyMaterialRequest) -> None: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeleteImportedKeyMaterialRequest(input) try: - boto_response_dict = self._impl.delete_imported_key_material( - **boto_request_dict - ) + boto_response_dict = self._impl.delete_imported_key_material(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) return Wrappers.Result_Success(None) - def DeriveSharedSecret( - self, input: DafnyDeriveSharedSecretRequest - ) -> DafnyDeriveSharedSecretResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeriveSharedSecretRequest( - input - ) + def DeriveSharedSecret(self, input: DafnyDeriveSharedSecretRequest) -> DafnyDeriveSharedSecretResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DeriveSharedSecretRequest(input) try: boto_response_dict = self._impl.derive_shared_secret(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DeriveSharedSecretResponse( - boto_response_dict - ) - ) - - def DescribeCustomKeyStores( - self, input: DafnyDescribeCustomKeyStoresRequest - ) -> DafnyDescribeCustomKeyStoresResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DescribeCustomKeyStoresRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DeriveSharedSecretResponse(boto_response_dict)) + + def DescribeCustomKeyStores(self, input: DafnyDescribeCustomKeyStoresRequest) -> DafnyDescribeCustomKeyStoresResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DescribeCustomKeyStoresRequest(input) try: - boto_response_dict = self._impl.describe_custom_key_stores( - **boto_request_dict - ) + boto_response_dict = self._impl.describe_custom_key_stores(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DescribeCustomKeyStoresResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DescribeCustomKeyStoresResponse(boto_response_dict)) def DescribeKey(self, input: DafnyDescribeKeyRequest) -> DafnyDescribeKeyResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DescribeKeyRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DescribeKeyRequest(input) try: boto_response_dict = self._impl.describe_key(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DescribeKeyResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DescribeKeyResponse(boto_response_dict)) def DisableKey(self, input: DafnyDisableKeyRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DisableKeyRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DisableKeyRequest(input) try: boto_response_dict = self._impl.disable_key(**boto_request_dict) except ClientError as e: @@ -588,9 +398,7 @@ def DisableKey(self, input: DafnyDisableKeyRequest) -> None: return Wrappers.Result_Success(None) def DisableKeyRotation(self, input: DafnyDisableKeyRotationRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DisableKeyRotationRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DisableKeyRotationRequest(input) try: boto_response_dict = self._impl.disable_key_rotation(**boto_request_dict) except ClientError as e: @@ -598,29 +406,17 @@ def DisableKeyRotation(self, input: DafnyDisableKeyRotationRequest) -> None: return Wrappers.Result_Success(None) - def DisconnectCustomKeyStore( - self, input: DafnyDisconnectCustomKeyStoreRequest - ) -> DafnyDisconnectCustomKeyStoreResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DisconnectCustomKeyStoreRequest( - input - ) + def DisconnectCustomKeyStore(self, input: DafnyDisconnectCustomKeyStoreRequest) -> DafnyDisconnectCustomKeyStoreResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_DisconnectCustomKeyStoreRequest(input) try: - boto_response_dict = self._impl.disconnect_custom_key_store( - **boto_request_dict - ) + boto_response_dict = self._impl.disconnect_custom_key_store(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DisconnectCustomKeyStoreResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_DisconnectCustomKeyStoreResponse(boto_response_dict)) def EnableKey(self, input: DafnyEnableKeyRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EnableKeyRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EnableKeyRequest(input) try: boto_response_dict = self._impl.enable_key(**boto_request_dict) except ClientError as e: @@ -629,9 +425,7 @@ def EnableKey(self, input: DafnyEnableKeyRequest) -> None: return Wrappers.Result_Success(None) def EnableKeyRotation(self, input: DafnyEnableKeyRotationRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EnableKeyRotationRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EnableKeyRotationRequest(input) try: boto_response_dict = self._impl.enable_key_rotation(**boto_request_dict) except ClientError as e: @@ -640,311 +434,169 @@ def EnableKeyRotation(self, input: DafnyEnableKeyRotationRequest) -> None: return Wrappers.Result_Success(None) def Encrypt(self, input: DafnyEncryptRequest) -> DafnyEncryptResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptRequest(input) try: boto_response_dict = self._impl.encrypt(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptResponse( - boto_response_dict - ) - ) - - def GenerateDataKey( - self, input: DafnyGenerateDataKeyRequest - ) -> DafnyGenerateDataKeyResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptResponse(boto_response_dict)) + + def GenerateDataKey(self, input: DafnyGenerateDataKeyRequest) -> DafnyGenerateDataKeyResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyRequest(input) try: boto_response_dict = self._impl.generate_data_key(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyResponse( - boto_response_dict - ) - ) - - def GenerateDataKeyPair( - self, input: DafnyGenerateDataKeyPairRequest - ) -> DafnyGenerateDataKeyPairResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyPairRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyResponse(boto_response_dict)) + + def GenerateDataKeyPair(self, input: DafnyGenerateDataKeyPairRequest) -> DafnyGenerateDataKeyPairResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyPairRequest(input) try: boto_response_dict = self._impl.generate_data_key_pair(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyPairResponse( - boto_response_dict - ) - ) - - def GenerateDataKeyPairWithoutPlaintext( - self, input: DafnyGenerateDataKeyPairWithoutPlaintextRequest - ) -> DafnyGenerateDataKeyPairWithoutPlaintextResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyPairResponse(boto_response_dict)) + + def GenerateDataKeyPairWithoutPlaintext(self, input: DafnyGenerateDataKeyPairWithoutPlaintextRequest) -> DafnyGenerateDataKeyPairWithoutPlaintextResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextRequest(input) try: - boto_response_dict = self._impl.generate_data_key_pair_without_plaintext( - **boto_request_dict - ) + boto_response_dict = self._impl.generate_data_key_pair_without_plaintext(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse( - boto_response_dict - ) - ) - - def GenerateDataKeyWithoutPlaintext( - self, input: DafnyGenerateDataKeyWithoutPlaintextRequest - ) -> DafnyGenerateDataKeyWithoutPlaintextResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyPairWithoutPlaintextResponse(boto_response_dict)) + + def GenerateDataKeyWithoutPlaintext(self, input: DafnyGenerateDataKeyWithoutPlaintextRequest) -> DafnyGenerateDataKeyWithoutPlaintextResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateDataKeyWithoutPlaintextRequest(input) try: - boto_response_dict = self._impl.generate_data_key_without_plaintext( - **boto_request_dict - ) + boto_response_dict = self._impl.generate_data_key_without_plaintext(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateDataKeyWithoutPlaintextResponse(boto_response_dict)) def GenerateMac(self, input: DafnyGenerateMacRequest) -> DafnyGenerateMacResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateMacRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateMacRequest(input) try: boto_response_dict = self._impl.generate_mac(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateMacResponse( - boto_response_dict - ) - ) - - def GenerateRandom( - self, input: DafnyGenerateRandomRequest - ) -> DafnyGenerateRandomResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateRandomRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateMacResponse(boto_response_dict)) + + def GenerateRandom(self, input: DafnyGenerateRandomRequest) -> DafnyGenerateRandomResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GenerateRandomRequest(input) try: boto_response_dict = self._impl.generate_random(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateRandomResponse( - boto_response_dict - ) - ) - - def GetKeyPolicy( - self, input: DafnyGetKeyPolicyRequest - ) -> DafnyGetKeyPolicyResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetKeyPolicyRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GenerateRandomResponse(boto_response_dict)) + + def GetKeyPolicy(self, input: DafnyGetKeyPolicyRequest) -> DafnyGetKeyPolicyResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetKeyPolicyRequest(input) try: boto_response_dict = self._impl.get_key_policy(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetKeyPolicyResponse( - boto_response_dict - ) - ) - - def GetKeyRotationStatus( - self, input: DafnyGetKeyRotationStatusRequest - ) -> DafnyGetKeyRotationStatusResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetKeyRotationStatusRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetKeyPolicyResponse(boto_response_dict)) + + def GetKeyRotationStatus(self, input: DafnyGetKeyRotationStatusRequest) -> DafnyGetKeyRotationStatusResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetKeyRotationStatusRequest(input) try: boto_response_dict = self._impl.get_key_rotation_status(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetKeyRotationStatusResponse( - boto_response_dict - ) - ) - - def GetParametersForImport( - self, input: DafnyGetParametersForImportRequest - ) -> DafnyGetParametersForImportResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetParametersForImportRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetKeyRotationStatusResponse(boto_response_dict)) + + def GetParametersForImport(self, input: DafnyGetParametersForImportRequest) -> DafnyGetParametersForImportResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetParametersForImportRequest(input) try: - boto_response_dict = self._impl.get_parameters_for_import( - **boto_request_dict - ) + boto_response_dict = self._impl.get_parameters_for_import(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetParametersForImportResponse( - boto_response_dict - ) - ) - - def GetPublicKey( - self, input: DafnyGetPublicKeyRequest - ) -> DafnyGetPublicKeyResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetPublicKeyRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetParametersForImportResponse(boto_response_dict)) + + def GetPublicKey(self, input: DafnyGetPublicKeyRequest) -> DafnyGetPublicKeyResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_GetPublicKeyRequest(input) try: boto_response_dict = self._impl.get_public_key(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetPublicKeyResponse( - boto_response_dict - ) - ) - - def ImportKeyMaterial( - self, input: DafnyImportKeyMaterialRequest - ) -> DafnyImportKeyMaterialResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ImportKeyMaterialRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_GetPublicKeyResponse(boto_response_dict)) + + def ImportKeyMaterial(self, input: DafnyImportKeyMaterialRequest) -> DafnyImportKeyMaterialResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ImportKeyMaterialRequest(input) try: boto_response_dict = self._impl.import_key_material(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ImportKeyMaterialResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ImportKeyMaterialResponse(boto_response_dict)) def ListAliases(self, input: DafnyListAliasesRequest) -> DafnyListAliasesResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListAliasesRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListAliasesRequest(input) try: boto_response_dict = self._impl.list_aliases(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListAliasesResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListAliasesResponse(boto_response_dict)) def ListGrants(self, input: DafnyListGrantsRequest) -> DafnyListGrantsResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListGrantsRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListGrantsRequest(input) try: boto_response_dict = self._impl.list_grants(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListGrantsResponse( - boto_response_dict - ) - ) - - def ListKeyPolicies( - self, input: DafnyListKeyPoliciesRequest - ) -> DafnyListKeyPoliciesResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListKeyPoliciesRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListGrantsResponse(boto_response_dict)) + + def ListKeyPolicies(self, input: DafnyListKeyPoliciesRequest) -> DafnyListKeyPoliciesResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListKeyPoliciesRequest(input) try: boto_response_dict = self._impl.list_key_policies(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListKeyPoliciesResponse( - boto_response_dict - ) - ) - - def ListKeyRotations( - self, input: DafnyListKeyRotationsRequest - ) -> DafnyListKeyRotationsResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListKeyRotationsRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListKeyPoliciesResponse(boto_response_dict)) + + def ListKeyRotations(self, input: DafnyListKeyRotationsRequest) -> DafnyListKeyRotationsResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListKeyRotationsRequest(input) try: boto_response_dict = self._impl.list_key_rotations(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListKeyRotationsResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListKeyRotationsResponse(boto_response_dict)) def ListKeys(self, input: DafnyListKeysRequest) -> DafnyListKeysResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListKeysRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListKeysRequest(input) try: boto_response_dict = self._impl.list_keys(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListKeysResponse( - boto_response_dict - ) - ) - - def ListResourceTags( - self, input: DafnyListResourceTagsRequest - ) -> DafnyListResourceTagsResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListResourceTagsRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListKeysResponse(boto_response_dict)) + + def ListResourceTags(self, input: DafnyListResourceTagsRequest) -> DafnyListResourceTagsResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ListResourceTagsRequest(input) try: boto_response_dict = self._impl.list_resource_tags(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListResourceTagsResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ListResourceTagsResponse(boto_response_dict)) def PutKeyPolicy(self, input: DafnyPutKeyPolicyRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_PutKeyPolicyRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_PutKeyPolicyRequest(input) try: boto_response_dict = self._impl.put_key_policy(**boto_request_dict) except ClientError as e: @@ -953,41 +605,25 @@ def PutKeyPolicy(self, input: DafnyPutKeyPolicyRequest) -> None: return Wrappers.Result_Success(None) def ReEncrypt(self, input: DafnyReEncryptRequest) -> DafnyReEncryptResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ReEncryptRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ReEncryptRequest(input) try: boto_response_dict = self._impl.re_encrypt(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ReEncryptResponse( - boto_response_dict - ) - ) - - def ReplicateKey( - self, input: DafnyReplicateKeyRequest - ) -> DafnyReplicateKeyResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ReplicateKeyRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ReEncryptResponse(boto_response_dict)) + + def ReplicateKey(self, input: DafnyReplicateKeyRequest) -> DafnyReplicateKeyResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ReplicateKeyRequest(input) try: boto_response_dict = self._impl.replicate_key(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ReplicateKeyResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ReplicateKeyResponse(boto_response_dict)) def RetireGrant(self, input: DafnyRetireGrantRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RetireGrantRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RetireGrantRequest(input) try: boto_response_dict = self._impl.retire_grant(**boto_request_dict) except ClientError as e: @@ -996,9 +632,7 @@ def RetireGrant(self, input: DafnyRetireGrantRequest) -> None: return Wrappers.Result_Success(None) def RevokeGrant(self, input: DafnyRevokeGrantRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RevokeGrantRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RevokeGrantRequest(input) try: boto_response_dict = self._impl.revoke_grant(**boto_request_dict) except ClientError as e: @@ -1006,59 +640,35 @@ def RevokeGrant(self, input: DafnyRevokeGrantRequest) -> None: return Wrappers.Result_Success(None) - def RotateKeyOnDemand( - self, input: DafnyRotateKeyOnDemandRequest - ) -> DafnyRotateKeyOnDemandResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RotateKeyOnDemandRequest( - input - ) + def RotateKeyOnDemand(self, input: DafnyRotateKeyOnDemandRequest) -> DafnyRotateKeyOnDemandResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_RotateKeyOnDemandRequest(input) try: boto_response_dict = self._impl.rotate_key_on_demand(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RotateKeyOnDemandResponse( - boto_response_dict - ) - ) - - def ScheduleKeyDeletion( - self, input: DafnyScheduleKeyDeletionRequest - ) -> DafnyScheduleKeyDeletionResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ScheduleKeyDeletionRequest( - input - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_RotateKeyOnDemandResponse(boto_response_dict)) + + def ScheduleKeyDeletion(self, input: DafnyScheduleKeyDeletionRequest) -> DafnyScheduleKeyDeletionResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_ScheduleKeyDeletionRequest(input) try: boto_response_dict = self._impl.schedule_key_deletion(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ScheduleKeyDeletionResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_ScheduleKeyDeletionResponse(boto_response_dict)) def Sign(self, input: DafnySignRequest) -> DafnySignResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SignRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_SignRequest(input) try: boto_response_dict = self._impl.sign(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SignResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_SignResponse(boto_response_dict)) def TagResource(self, input: DafnyTagResourceRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_TagResourceRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_TagResourceRequest(input) try: boto_response_dict = self._impl.tag_resource(**boto_request_dict) except ClientError as e: @@ -1067,9 +677,7 @@ def TagResource(self, input: DafnyTagResourceRequest) -> None: return Wrappers.Result_Success(None) def UntagResource(self, input: DafnyUntagResourceRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UntagResourceRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UntagResourceRequest(input) try: boto_response_dict = self._impl.untag_resource(**boto_request_dict) except ClientError as e: @@ -1078,9 +686,7 @@ def UntagResource(self, input: DafnyUntagResourceRequest) -> None: return Wrappers.Result_Success(None) def UpdateAlias(self, input: DafnyUpdateAliasRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdateAliasRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdateAliasRequest(input) try: boto_response_dict = self._impl.update_alias(**boto_request_dict) except ClientError as e: @@ -1088,27 +694,17 @@ def UpdateAlias(self, input: DafnyUpdateAliasRequest) -> None: return Wrappers.Result_Success(None) - def UpdateCustomKeyStore( - self, input: DafnyUpdateCustomKeyStoreRequest - ) -> DafnyUpdateCustomKeyStoreResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdateCustomKeyStoreRequest( - input - ) + def UpdateCustomKeyStore(self, input: DafnyUpdateCustomKeyStoreRequest) -> DafnyUpdateCustomKeyStoreResponse: + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdateCustomKeyStoreRequest(input) try: boto_response_dict = self._impl.update_custom_key_store(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_UpdateCustomKeyStoreResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_UpdateCustomKeyStoreResponse(boto_response_dict)) def UpdateKeyDescription(self, input: DafnyUpdateKeyDescriptionRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdateKeyDescriptionRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdateKeyDescriptionRequest(input) try: boto_response_dict = self._impl.update_key_description(**boto_request_dict) except ClientError as e: @@ -1117,9 +713,7 @@ def UpdateKeyDescription(self, input: DafnyUpdateKeyDescriptionRequest) -> None: return Wrappers.Result_Success(None) def UpdatePrimaryRegion(self, input: DafnyUpdatePrimaryRegionRequest) -> None: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdatePrimaryRegionRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_UpdatePrimaryRegionRequest(input) try: boto_response_dict = self._impl.update_primary_region(**boto_request_dict) except ClientError as e: @@ -1128,31 +722,19 @@ def UpdatePrimaryRegion(self, input: DafnyUpdatePrimaryRegionRequest) -> None: return Wrappers.Result_Success(None) def Verify(self, input: DafnyVerifyRequest) -> DafnyVerifyResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_VerifyRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_VerifyRequest(input) try: boto_response_dict = self._impl.verify(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_VerifyResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_VerifyResponse(boto_response_dict)) def VerifyMac(self, input: DafnyVerifyMacRequest) -> DafnyVerifyMacResponse: - boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_VerifyMacRequest( - input - ) + boto_request_dict = aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_VerifyMacRequest(input) try: boto_response_dict = self._impl.verify_mac(**boto_request_dict) except ClientError as e: return Wrappers.Result_Failure(_sdk_error_to_dafny_error(e)) - return Wrappers.Result_Success( - aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_VerifyMacResponse( - boto_response_dict - ) - ) + return Wrappers.Result_Success(aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_VerifyMacResponse(boto_response_dict)) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/__init__.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/__init__.py index 09be6133b..89d64801a 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/__init__.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/__init__.py @@ -1,3 +1,4 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. + diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/shim.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/shim.py index 50dc98f42..6cae7ebd5 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/shim.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviders/shim.py @@ -50,511 +50,238 @@ import aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes import aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.client as client_impl - -class MaterialProvidersShim( - aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IAwsCryptographicMaterialProvidersClient -): - def __init__(self, _impl: client_impl): +class MaterialProvidersShim(aws_cryptographic_material_providers.internaldafny.generated.AwsCryptographyMaterialProvidersTypes.IAwsCryptographicMaterialProvidersClient): + def __init__(self, _impl: client_impl) : self._impl = _impl def CreateAwsKmsKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsDiscoveryKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsDiscoveryKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_discovery_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsDiscoveryKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_discovery_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsMultiKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMultiKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMultiKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_multi_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMultiKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMultiKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_multi_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsDiscoveryMultiKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsDiscoveryMultiKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_discovery_multi_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsDiscoveryMultiKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsDiscoveryMultiKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_discovery_multi_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsMrkKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_mrk_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_mrk_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsMrkMultiKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkMultiKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkMultiKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_mrk_multi_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkMultiKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkMultiKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_mrk_multi_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsMrkDiscoveryKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkDiscoveryKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_mrk_discovery_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkDiscoveryKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_mrk_discovery_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsMrkDiscoveryMultiKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkDiscoveryMultiKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput( - input - ) - smithy_client_response = ( - self._impl.create_aws_kms_mrk_discovery_multi_keyring( - smithy_client_request - ) - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsMrkDiscoveryMultiKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsMrkDiscoveryMultiKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_mrk_discovery_multi_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsHierarchicalKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsHierarchicalKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_hierarchical_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsHierarchicalKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsHierarchicalKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_hierarchical_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsRsaKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsRsaKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsRsaKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_rsa_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsRsaKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsRsaKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_rsa_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateAwsKmsEcdhKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsEcdhKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsEcdhKeyringInput( - input - ) - smithy_client_response = self._impl.create_aws_kms_ecdh_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateAwsKmsEcdhKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateAwsKmsEcdhKeyringInput(input) + smithy_client_response = self._impl.create_aws_kms_ecdh_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateMultiKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateMultiKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateMultiKeyringInput( - input - ) - smithy_client_response = self._impl.create_multi_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateMultiKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateMultiKeyringInput(input) + smithy_client_response = self._impl.create_multi_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateRawAesKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawAesKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRawAesKeyringInput( - input - ) - smithy_client_response = self._impl.create_raw_aes_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawAesKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRawAesKeyringInput(input) + smithy_client_response = self._impl.create_raw_aes_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateRawRsaKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawRsaKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRawRsaKeyringInput( - input - ) - smithy_client_response = self._impl.create_raw_rsa_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawRsaKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRawRsaKeyringInput(input) + smithy_client_response = self._impl.create_raw_rsa_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateRawEcdhKeyring(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawEcdhKeyringInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRawEcdhKeyringInput( - input - ) - smithy_client_response = self._impl.create_raw_ecdh_keyring( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRawEcdhKeyringInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRawEcdhKeyringInput(input) + smithy_client_response = self._impl.create_raw_ecdh_keyring(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateKeyringOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateDefaultCryptographicMaterialsManager(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateDefaultCryptographicMaterialsManagerInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput( - input - ) - smithy_client_response = ( - self._impl.create_default_cryptographic_materials_manager( - smithy_client_request - ) - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateDefaultCryptographicMaterialsManagerInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateDefaultCryptographicMaterialsManagerInput(input) + smithy_client_response = self._impl.create_default_cryptographic_materials_manager(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateCryptographicMaterialsManagerOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateRequiredEncryptionContextCMM(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRequiredEncryptionContextCMMInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput( - input - ) - smithy_client_response = self._impl.create_required_encryption_context_cmm( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateRequiredEncryptionContextCMMInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMInput(input) + smithy_client_response = self._impl.create_required_encryption_context_cmm(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateRequiredEncryptionContextCMMOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateCryptographicMaterialsCache(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateCryptographicMaterialsCacheInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput( - input - ) - smithy_client_response = self._impl.create_cryptographic_materials_cache( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateCryptographicMaterialsCacheInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheInput(input) + smithy_client_response = self._impl.create_cryptographic_materials_cache(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateCryptographicMaterialsCacheOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def CreateDefaultClientSupplier(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateDefaultClientSupplierInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateDefaultClientSupplierInput( - input - ) - smithy_client_response = self._impl.create_default_client_supplier( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateDefaultClientSupplierOutput( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.CreateDefaultClientSupplierInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateDefaultClientSupplierInput(input) + smithy_client_response = self._impl.create_default_client_supplier(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CreateDefaultClientSupplierOutput(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def InitializeEncryptionMaterials(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.InitializeEncryptionMaterialsInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_InitializeEncryptionMaterialsInput( - input - ) - smithy_client_response = self._impl.initialize_encryption_materials( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.InitializeEncryptionMaterialsInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_InitializeEncryptionMaterialsInput(input) + smithy_client_response = self._impl.initialize_encryption_materials(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_EncryptionMaterials(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def InitializeDecryptionMaterials(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.InitializeDecryptionMaterialsInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_InitializeDecryptionMaterialsInput( - input - ) - smithy_client_response = self._impl.initialize_decryption_materials( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.InitializeDecryptionMaterialsInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_InitializeDecryptionMaterialsInput(input) + smithy_client_response = self._impl.initialize_decryption_materials(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DecryptionMaterials(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def ValidEncryptionMaterialsTransition(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidEncryptionMaterialsTransitionInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput( - input - ) - smithy_client_response = self._impl.valid_encryption_materials_transition( - smithy_client_request - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidEncryptionMaterialsTransitionInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidEncryptionMaterialsTransitionInput(input) + smithy_client_response = self._impl.valid_encryption_materials_transition(smithy_client_request) return Wrappers.Result_Success(None) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def ValidDecryptionMaterialsTransition(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidDecryptionMaterialsTransitionInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput( - input - ) - smithy_client_response = self._impl.valid_decryption_materials_transition( - smithy_client_request - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidDecryptionMaterialsTransitionInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidDecryptionMaterialsTransitionInput(input) + smithy_client_response = self._impl.valid_decryption_materials_transition(smithy_client_request) return Wrappers.Result_Success(None) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def EncryptionMaterialsHasPlaintextDataKey(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptionMaterials - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials( - input - ) - smithy_client_response = ( - self._impl.encryption_materials_has_plaintext_data_key( - smithy_client_request - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.EncryptionMaterials = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_EncryptionMaterials(input) + smithy_client_response = self._impl.encryption_materials_has_plaintext_data_key(smithy_client_request) return Wrappers.Result_Success(None) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def DecryptionMaterialsWithPlaintextDataKey(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptionMaterials - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials( - input - ) - smithy_client_response = ( - self._impl.decryption_materials_with_plaintext_data_key( - smithy_client_request - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.DecryptionMaterials = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DecryptionMaterials(input) + smithy_client_response = self._impl.decryption_materials_with_plaintext_data_key(smithy_client_request) return Wrappers.Result_Success(None) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def GetAlgorithmSuiteInfo(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetAlgorithmSuiteInfoInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetAlgorithmSuiteInfoInput( - input - ) - smithy_client_response = self._impl.get_algorithm_suite_info( - smithy_client_request - ) - return Wrappers.Result_Success( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - smithy_client_response - ) - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.GetAlgorithmSuiteInfoInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_GetAlgorithmSuiteInfoInput(input) + smithy_client_response = self._impl.get_algorithm_suite_info(smithy_client_request) + return Wrappers.Result_Success(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_AlgorithmSuiteInfo(smithy_client_response)) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def ValidAlgorithmSuiteInfo(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteInfo - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo( - input - ) - smithy_client_response = self._impl.valid_algorithm_suite_info( - smithy_client_request - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.AlgorithmSuiteInfo = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_AlgorithmSuiteInfo(input) + smithy_client_response = self._impl.valid_algorithm_suite_info(smithy_client_request) return Wrappers.Result_Success(None) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def ValidateCommitmentPolicyOnEncrypt(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidateCommitmentPolicyOnEncryptInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput( - input - ) - smithy_client_response = self._impl.validate_commitment_policy_on_encrypt( - smithy_client_request - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidateCommitmentPolicyOnEncryptInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnEncryptInput(input) + smithy_client_response = self._impl.validate_commitment_policy_on_encrypt(smithy_client_request) return Wrappers.Result_Success(None) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) def ValidateCommitmentPolicyOnDecrypt(self, input): try: - smithy_client_request: ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidateCommitmentPolicyOnDecryptInput - ) = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput( - input - ) - smithy_client_response = self._impl.validate_commitment_policy_on_decrypt( - smithy_client_request - ) + smithy_client_request: aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.models.ValidateCommitmentPolicyOnDecryptInput = aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_ValidateCommitmentPolicyOnDecryptInput(input) + smithy_client_response = self._impl.validate_commitment_policy_on_decrypt(smithy_client_request) return Wrappers.Result_Success(None) except Exception as e: return Wrappers.Result_Failure(_smithy_error_to_dafny_error(e)) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/__init__.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/__init__.py index 09be6133b..89d64801a 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/__init__.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/__init__.py @@ -1,3 +1,4 @@ # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. + diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/client.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/client.py index 1506f200b..7793f7378 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/client.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/client.py @@ -44,17 +44,15 @@ Input = TypeVar("Input") Output = TypeVar("Output") - class KeyVectors: - """Client for KeyVectors. + """Client for KeyVectors :param config: Configuration for the client. """ - def __init__( self, config: KeyVectorsConfig | None = None, - dafny_client: IKeyVectorsClient | None = None, + dafny_client: IKeyVectorsClient | None = None ): if config is None: self._config = Config() @@ -71,9 +69,7 @@ def __init__( if dafny_client is not None: self._config.dafnyImplInterface.impl = dafny_client - def create_test_vector_keyring( - self, input: TestVectorKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": + def create_test_vector_keyring(self, input: TestVectorKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': """Invokes the CreateTestVectorKeyring operation. :param input: The operation's input. @@ -87,9 +83,7 @@ def create_test_vector_keyring( operation_name="CreateTestVectorKeyring", ) - def create_wrapped_test_vector_keyring( - self, input: TestVectorKeyringInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring": + def create_wrapped_test_vector_keyring(self, input: TestVectorKeyringInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.Keyring': """Invokes the CreateWrappedTestVectorKeyring operation. :param input: The operation's input. @@ -103,9 +97,7 @@ def create_wrapped_test_vector_keyring( operation_name="CreateWrappedTestVectorKeyring", ) - def create_wrapped_test_vector_cmm( - self, input: TestVectorCmmInput - ) -> "aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager": + def create_wrapped_test_vector_cmm(self, input: TestVectorCmmInput) -> 'aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.references.CryptographicMaterialsManager': """Invokes the CreateWrappedTestVectorCmm operation. :param input: The operation's input. @@ -119,9 +111,7 @@ def create_wrapped_test_vector_cmm( operation_name="CreateWrappedTestVectorCmm", ) - def get_key_description( - self, input: GetKeyDescriptionInput - ) -> GetKeyDescriptionOutput: + def get_key_description(self, input: GetKeyDescriptionInput) -> GetKeyDescriptionOutput: """Invokes the GetKeyDescription operation. :param input: The operation's input. @@ -135,9 +125,7 @@ def get_key_description( operation_name="GetKeyDescription", ) - def serialize_key_description( - self, input: SerializeKeyDescriptionInput - ) -> SerializeKeyDescriptionOutput: + def serialize_key_description(self, input: SerializeKeyDescriptionInput) -> SerializeKeyDescriptionOutput: """Invokes the SerializeKeyDescription operation. :param input: The operation's input. @@ -188,8 +176,7 @@ def _handle_execution( ) _client_interceptors = config.interceptors client_interceptors = cast( - list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - _client_interceptors, + list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], _client_interceptors ) interceptors = client_interceptors @@ -272,7 +259,7 @@ def _handle_execution( error_info=RetryErrorInfo( # TODO: Determine the error type. error_type=RetryErrorType.CLIENT_ERROR, - ), + ) ) except SmithyRetryException: raise context_with_response.response @@ -287,10 +274,7 @@ def _handle_execution( # The response will be set either with the modeled output or an exception. The # transport_request and transport_response may be set or None. execution_context = cast( - InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], - context, + InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], context ) return self._finalize_execution(interceptors, execution_context) @@ -315,10 +299,8 @@ def _handle_attempt( InterceptorContext[Input, None, DafnyRequest, DafnyResponse], context ) - context_with_response._transport_response = ( - config.dafnyImplInterface.handle_request( - input=context_with_response.transport_request - ) + context_with_response._transport_response = config.dafnyImplInterface.handle_request( + input=context_with_response.transport_request ) # Step 7n: Invoke read_after_transmit @@ -355,8 +337,7 @@ def _handle_attempt( # None. This will also be true after _finalize_attempt because there is no opportunity # there to set the transport_response. attempt_context = cast( - InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], - context, + InterceptorContext[Input, Output, DafnyRequest, DafnyResponse | None], context ) return self._finalize_attempt(interceptors, attempt_context) @@ -386,9 +367,7 @@ def _finalize_attempt( def _finalize_execution( self, interceptors: list[Interceptor[Input, Output, DafnyRequest, DafnyResponse]], - context: InterceptorContext[ - Input, Output, DafnyRequest | None, DafnyResponse | None - ], + context: InterceptorContext[Input, Output, DafnyRequest | None, DafnyResponse | None], ) -> Output: try: # Step 9: Invoke modify_before_completion diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/config.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/config.py index 07df185ba..77ee5f6e3 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/config.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/config.py @@ -17,8 +17,6 @@ _ServiceInterceptor = Any - - @dataclass(init=False) class Config: """Configuration for KeyVectors.""" @@ -36,42 +34,47 @@ def __init__( ): """Constructor. - :param interceptors: The list of interceptors, which are hooks - that are called during the execution of a request. - :param retry_strategy: The retry strategy for issuing retry - tokens and computing retry delays. + :param interceptors: The list of interceptors, which are hooks that are called + during the execution of a request. + + :param retry_strategy: The retry strategy for issuing retry tokens and computing + retry delays. + :param dafnyImplInterface: """ self.interceptors = interceptors or [] self.retry_strategy = retry_strategy or SimpleRetryStrategy() self.dafnyImplInterface = dafnyImplInterface - # A callable that allows customizing the config object on each request. Plugin: TypeAlias = Callable[[Config], None] - class KeyVectorsConfig(Config): key_manifest_path: str - def __init__( self, *, key_manifest_path: str, ): - """Constructor for KeyVectorsConfig.""" + """Constructor for KeyVectorsConfig + + """ super().__init__() self.key_manifest_path = key_manifest_path def as_dict(self) -> Dict[str, Any]: - """Converts the KeyVectorsConfig to a dictionary.""" + """Converts the KeyVectorsConfig to a dictionary. + + """ return { "key_manifest_path": self.key_manifest_path, } @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyVectorsConfig": - """Creates a KeyVectorsConfig from a dictionary.""" + """Creates a KeyVectorsConfig from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_manifest_path": d["key_manifest_path"], } @@ -88,23 +91,22 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KeyVectorsConfig): return False - attributes: list[str] = [ - "key_manifest_path", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_manifest_path',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) def dafny_config_to_smithy_config(dafny_config) -> KeyVectorsConfig: - """Converts the provided Dafny shape for this localService's config into - the corresponding Smithy-modelled shape.""" - return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyVectorsConfig( - dafny_config - ) - + """ + Converts the provided Dafny shape for this localService's config + into the corresponding Smithy-modelled shape. + """ + return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyVectorsConfig(dafny_config) def smithy_config_to_dafny_config(smithy_config) -> DafnyKeyVectorsConfig: - """Converts the provided Smithy-modelled shape for this localService's - config into the corresponding Dafny shape.""" - return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyVectorsConfig( - smithy_config - ) + """ + Converts the provided Smithy-modelled shape for this localService's config + into the corresponding Dafny shape. + """ + return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyVectorsConfig(smithy_config) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafnyImplInterface.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafnyImplInterface.py index afbc226f0..dc3c8b393 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafnyImplInterface.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafnyImplInterface.py @@ -2,12 +2,9 @@ # SPDX-License-Identifier: Apache-2.0 # Do not modify this file. This file is machine generated, and any changes to it will be overwritten. -from aws_cryptography_materialproviders_test_vectors.internaldafny.generated.KeyVectors import ( - KeyVectorsClient, -) +from aws_cryptography_materialproviders_test_vectors.internaldafny.generated.KeyVectors import KeyVectorsClient from .dafny_protocol import DafnyRequest - class DafnyImplInterface: impl: KeyVectorsClient | None = None @@ -28,9 +25,9 @@ def handle_request(self, input: DafnyRequest): "SerializeKeyDescription": self.impl.SerializeKeyDescription, } - # This logic is where a typical Smithy client would expect the "server" to be. - # This code can be thought of as logic our Dafny "server" uses - # to route incoming client requests to the correct request handler code. + # This logic is where a typical Smithy client would expect the "server" to be. + # This code can be thought of as logic our Dafny "server" uses + # to route incoming client requests to the correct request handler code. if input.dafny_operation_input is None: return self.operation_map[input.operation_name]() else: diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_protocol.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_protocol.py index 036d42a86..e484e190e 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_protocol.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_protocol.py @@ -14,7 +14,6 @@ import smithy_dafny_standard_library.internaldafny.generated.Wrappers as Wrappers from typing import Union - class DafnyRequest: operation_name: str @@ -31,7 +30,6 @@ def __init__(self, operation_name, dafny_operation_input): self.operation_name = operation_name self.dafny_operation_input = dafny_operation_input - class DafnyResponse(Wrappers.Result): def __init__(self): super().__init__(self) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_to_smithy.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_to_smithy.py index 0c3f6c847..6207879c3 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_to_smithy.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/dafny_to_smithy.py @@ -28,336 +28,160 @@ def aws_cryptography_materialproviderstestvectorkeys_KeyDescription(dafny_input): # Convert KeyDescription if isinstance(dafny_input, KeyDescription_Kms): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKms( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KMSInfo( - dafny_input.Kms - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKms(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KMSInfo(dafny_input.Kms)) elif isinstance(dafny_input, KeyDescription_KmsMrk): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrk( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAware( - dafny_input.KmsMrk - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrk(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAware(dafny_input.KmsMrk)) elif isinstance(dafny_input, KeyDescription_KmsMrkDiscovery): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrkDiscovery( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAwareDiscovery( - dafny_input.KmsMrkDiscovery - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrkDiscovery(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAwareDiscovery(dafny_input.KmsMrkDiscovery)) elif isinstance(dafny_input, KeyDescription_RSA): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRSA( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RawRSA( - dafny_input.RSA - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRSA(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RawRSA(dafny_input.RSA)) elif isinstance(dafny_input, KeyDescription_AES): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionAES( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RawAES( - dafny_input.AES - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionAES(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RawAES(dafny_input.AES)) elif isinstance(dafny_input, KeyDescription_ECDH): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionECDH( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RawEcdh( - dafny_input.ECDH - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionECDH(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RawEcdh(dafny_input.ECDH)) elif isinstance(dafny_input, KeyDescription_Static): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionStatic( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_StaticKeyring( - dafny_input.Static - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionStatic(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_StaticKeyring(dafny_input.Static)) elif isinstance(dafny_input, KeyDescription_KmsRsa): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsRsa( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsRsaKeyring( - dafny_input.KmsRsa - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsRsa(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsRsaKeyring(dafny_input.KmsRsa)) elif isinstance(dafny_input, KeyDescription_KmsECDH): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsECDH( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsEcdhKeyring( - dafny_input.KmsECDH - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsECDH(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KmsEcdhKeyring(dafny_input.KmsECDH)) elif isinstance(dafny_input, KeyDescription_Hierarchy): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionHierarchy( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_HierarchyKeyring( - dafny_input.Hierarchy - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionHierarchy(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_HierarchyKeyring(dafny_input.Hierarchy)) elif isinstance(dafny_input, KeyDescription_Multi): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionMulti( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_MultiKeyring( - dafny_input.Multi - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionMulti(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_MultiKeyring(dafny_input.Multi)) elif isinstance(dafny_input, KeyDescription_RequiredEncryptionContext): - KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRequiredEncryptionContext( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM( - dafny_input.RequiredEncryptionContext - ) - ) + KeyDescription_union_value = aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRequiredEncryptionContext(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM(dafny_input.RequiredEncryptionContext)) else: raise ValueError("No recognized union value in union type: " + str(dafny_input)) return KeyDescription_union_value - def aws_cryptography_materialproviderstestvectorkeys_KMSInfo(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KMSInfo( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsMrkAware(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KmsMrkAware( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsMrkAwareDiscovery(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KmsMrkAwareDiscovery( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), - default_mrk_region=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.defaultMrkRegion - ).decode("utf-16-be"), - aws_kms_discovery_filter=( - ( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter( - dafny_input.awsKmsDiscoveryFilter.value - ) - ) - if (dafny_input.awsKmsDiscoveryFilter.is_Some) - else None - ), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), + default_mrk_region=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.defaultMrkRegion).decode('utf-16-be'), + aws_kms_discovery_filter=(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_DiscoveryFilter(dafny_input.awsKmsDiscoveryFilter.value)) if (dafny_input.awsKmsDiscoveryFilter.is_Some) else None, ) - def aws_cryptography_materialproviderstestvectorkeys_RawRSA(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.RawRSA( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), - provider_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.providerId - ).decode("utf-16-be"), - padding=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_PaddingScheme( - dafny_input.padding - ), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), + provider_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.providerId).decode('utf-16-be'), + padding=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_PaddingScheme(dafny_input.padding), ) - def aws_cryptography_materialproviderstestvectorkeys_RawAES(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.RawAES( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), - provider_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.providerId - ).decode("utf-16-be"), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), + provider_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.providerId).decode('utf-16-be'), ) - def aws_cryptography_materialproviderstestvectorkeys_RawEcdh(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.RawEcdh( - sender_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.senderKeyId - ).decode("utf-16-be"), - recipient_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.recipientKeyId - ).decode("utf-16-be"), - sender_public_key=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.senderPublicKey - ).decode("utf-16-be"), - recipient_public_key=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.recipientPublicKey - ).decode("utf-16-be"), - provider_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.providerId - ).decode("utf-16-be"), - curve_spec=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.curveSpec - ).decode("utf-16-be"), - key_agreement_scheme=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyAgreementScheme - ).decode("utf-16-be"), + sender_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.senderKeyId).decode('utf-16-be'), + recipient_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.recipientKeyId).decode('utf-16-be'), + sender_public_key=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.senderPublicKey).decode('utf-16-be'), + recipient_public_key=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.recipientPublicKey).decode('utf-16-be'), + provider_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.providerId).decode('utf-16-be'), + curve_spec=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.curveSpec).decode('utf-16-be'), + key_agreement_scheme=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyAgreementScheme).decode('utf-16-be'), ) - def aws_cryptography_materialproviderstestvectorkeys_StaticKeyring(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.StaticKeyring( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsRsaKeyring(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KmsRsaKeyring( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), - encryption_algorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec( - dafny_input.encryptionAlgorithm - ), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), + encryption_algorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.dafny_to_aws_sdk.com_amazonaws_kms_EncryptionAlgorithmSpec(dafny_input.encryptionAlgorithm), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsEcdhKeyring(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KmsEcdhKeyring( - sender_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.senderKeyId - ).decode("utf-16-be"), - recipient_key_id=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.recipientKeyId - ).decode("utf-16-be"), - sender_public_key=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.senderPublicKey - ).decode("utf-16-be"), - recipient_public_key=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.recipientPublicKey - ).decode("utf-16-be"), - curve_spec=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.curveSpec - ).decode("utf-16-be"), - key_agreement_scheme=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyAgreementScheme - ).decode("utf-16-be"), + sender_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.senderKeyId).decode('utf-16-be'), + recipient_key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.recipientKeyId).decode('utf-16-be'), + sender_public_key=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.senderPublicKey).decode('utf-16-be'), + recipient_public_key=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.recipientPublicKey).decode('utf-16-be'), + curve_spec=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.curveSpec).decode('utf-16-be'), + key_agreement_scheme=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyAgreementScheme).decode('utf-16-be'), ) - def aws_cryptography_materialproviderstestvectorkeys_HierarchyKeyring(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.HierarchyKeyring( - key_id=b"".join(ord(c).to_bytes(2, "big") for c in dafny_input.keyId).decode( - "utf-16-be" - ), + key_id=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyId).decode('utf-16-be'), ) - def aws_cryptography_materialproviderstestvectorkeys_MultiKeyring(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.MultiKeyring( - generator=( - ( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - dafny_input.generator.value - ) - ) - if (dafny_input.generator.is_Some) - else None - ), - child_keyrings=[ - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - list_element - ) - for list_element in dafny_input.childKeyrings - ], + generator=(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(dafny_input.generator.value)) if (dafny_input.generator.is_Some) else None, + child_keyrings=[aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(list_element) for list_element in dafny_input.childKeyrings], ) - -def aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM( - dafny_input, -): +def aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.RequiredEncryptionContextCMM( - underlying=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - dafny_input.underlying - ), - required_encryption_context_keys=[ - bytes(list_element.Elements).decode("utf-8") - for list_element in dafny_input.requiredEncryptionContextKeys - ], + underlying=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(dafny_input.underlying), + required_encryption_context_keys=[bytes(list_element.Elements).decode('utf-8') for list_element in dafny_input.requiredEncryptionContextKeys], ) - -def aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput( - dafny_input, -): +def aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.TestVectorKeyringInput( - key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - dafny_input.keyDescription - ), + key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(dafny_input.keyDescription), ) - def aws_cryptography_materialproviderstestvectorkeys_CmmOperation(dafny_input): if isinstance(dafny_input, CmmOperation_ENCRYPT): - return "ENCRYPT" + return 'ENCRYPT' elif isinstance(dafny_input, CmmOperation_DECRYPT): - return "DECRYPT" + return 'DECRYPT' else: - raise ValueError(f"No recognized enum value in enum type: {dafny_input=}") - + raise ValueError(f'No recognized enum value in enum type: {dafny_input=}') def aws_cryptography_materialproviderstestvectorkeys_TestVectorCmmInput(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.TestVectorCmmInput( - key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - dafny_input.keyDescription - ), - for_operation=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_CmmOperation( - dafny_input.forOperation - ), + key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(dafny_input.keyDescription), + for_operation=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_CmmOperation(dafny_input.forOperation), ) - -def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionInput( - dafny_input, -): +def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionInput(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.GetKeyDescriptionInput( json=bytes(dafny_input.json), ) - -def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionInput( - dafny_input, -): +def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionInput(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.SerializeKeyDescriptionInput( - key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - dafny_input.keyDescription - ), + key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(dafny_input.keyDescription), ) +def aws_cryptography_materialproviderstestvectorkeys_CreateWrappedTestVectorCmmOutput(dafny_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(dafny_input) -def aws_cryptography_materialproviderstestvectorkeys_CreateWrappedTestVectorCmmOutput( - dafny_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - dafny_input - ) - - -def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionOutput( - dafny_input, -): +def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionOutput(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.GetKeyDescriptionOutput( - key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - dafny_input.keyDescription - ), + key_description=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(dafny_input.keyDescription), ) - -def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionOutput( - dafny_input, -): +def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionOutput(dafny_input): return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.SerializeKeyDescriptionOutput( json=bytes(dafny_input.json), ) - def aws_cryptography_materialproviderstestvectorkeys_KeyVectorsConfig(dafny_input): # Deferred import of .config to avoid circular dependency import aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.config - return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.config.KeyVectorsConfig( - key_manifest_path=b"".join( - ord(c).to_bytes(2, "big") for c in dafny_input.keyManifestPath - ).decode("utf-16-be"), + key_manifest_path=b''.join(ord(c).to_bytes(2, 'big') for c in dafny_input.keyManifestPath).decode('utf-16-be'), ) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/deserialize.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/deserialize.py index 05c4672da..75e78973a 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/deserialize.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/deserialize.py @@ -22,50 +22,33 @@ def _deserialize_create_test_vector_keyring(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) +def _deserialize_create_wrapped_test_vector_keyring(input: DafnyResponse, config: Config): -def _deserialize_create_wrapped_test_vector_keyring( - input: DafnyResponse, config: Config -): - - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.dafny_to_smithy.aws_cryptography_materialproviders_CreateKeyringOutput(input.value) def _deserialize_create_wrapped_test_vector_cmm(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_CreateWrappedTestVectorCmmOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_CreateWrappedTestVectorCmmOutput(input.value) def _deserialize_get_key_description(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionOutput(input.value) def _deserialize_serialize_key_description(input: DafnyResponse, config: Config): - if input.IsFailure(): - return _deserialize_error(input.error) - return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionOutput( - input.value - ) - + if input.IsFailure(): + return _deserialize_error(input.error) + return aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.dafny_to_smithy.aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionOutput(input.value) def _deserialize_error(error: Error) -> ServiceError: if error.is_Opaque: @@ -76,6 +59,6 @@ def _deserialize_error(error: Error) -> ServiceError: list=[_deserialize_error(dafny_e) for dafny_e in error.list], ) elif error.is_KeyVectorException: - return KeyVectorException(message=_dafny.string_of(error.message)) + return KeyVectorException(message=_dafny.string_of(error.message)) else: return OpaqueError(obj=error, alt_text=repr(error)) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/errors.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/errors.py index 8df37c867..905467256 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/errors.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/errors.py @@ -10,34 +10,27 @@ class ServiceError(Exception): - """Base error for all errors in the service.""" - + """Base error for all errors in the service. + """ pass - -T = TypeVar("T") - - +T = TypeVar('T') class ApiError(ServiceError, Generic[T]): - """Base error for all api errors in the service.""" - + """Base error for all api errors in the service. + """ code: T - def __init__(self, message: str): super().__init__(message) self.message = message - -class UnknownApiError(ApiError[Literal["Unknown"]]): - """Error representing any unknown api errors.""" - - code: Literal["Unknown"] = "Unknown" - +class UnknownApiError(ApiError[Literal['Unknown']]): + """Error representing any unknown api errors + """ + code: Literal['Unknown'] = 'Unknown' class KeyVectorException(ApiError[Literal["KeyVectorException"]]): code: Literal["KeyVectorException"] = "KeyVectorException" message: str - def __init__( self, *, @@ -46,17 +39,21 @@ def __init__( super().__init__(message) def as_dict(self) -> Dict[str, Any]: - """Converts the KeyVectorException to a dictionary.""" + """Converts the KeyVectorException to a dictionary. + + """ return { - "message": self.message, - "code": self.code, + 'message': self.message, + 'code': self.code, } @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyVectorException": - """Creates a KeyVectorException from a dictionary.""" + """Creates a KeyVectorException from a dictionary. + + """ kwargs: Dict[str, Any] = { - "message": d["message"], + 'message': d['message'], } return KeyVectorException(**kwargs) @@ -71,57 +68,62 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KeyVectorException): return False - attributes: list[str] = [ - "message", - "message", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KeyVectorException(ApiError[Literal["KeyVectorException"]]): code: Literal["KeyVectorException"] = "KeyVectorException" message: str - class CollectionOfErrors(ApiError[Literal["CollectionOfErrors"]]): code: Literal["CollectionOfErrors"] = "CollectionOfErrors" message: str list: List[ServiceError] - def __init__(self, *, message: str, list): + def __init__( + self, + *, + message: str, + list + ): super().__init__(message) self.list = list def as_dict(self) -> Dict[str, Any]: """Converts the CollectionOfErrors to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "list": self.list, + 'message': self.message, + 'code': self.code, + 'list': self.list, } @staticmethod def from_dict(d: Dict[str, Any]) -> "CollectionOfErrors": """Creates a CollectionOfErrors from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ - kwargs: Dict[str, Any] = {"message": d["message"], "list": d["list"]} + kwargs: Dict[str, Any] = { + 'message': d['message'], + 'list': d['list'] + } return CollectionOfErrors(**kwargs) def __repr__(self) -> str: result = "CollectionOfErrors(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"list={self.list}" + result += f'list={self.list}' result += ")" return result @@ -130,15 +132,22 @@ def __eq__(self, other: Any) -> bool: return False if not (self.list == other.list): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class OpaqueError(ApiError[Literal["OpaqueError"]]): code: Literal["OpaqueError"] = "OpaqueError" obj: Any # As an OpaqueError, type of obj is unknown - def __init__(self, *, obj, alt_text): + def __init__( + self, + *, + obj, + alt_text + ): super().__init__("") self.obj = obj self.alt_text = alt_text @@ -146,38 +155,37 @@ def __init__(self, *, obj, alt_text): def as_dict(self) -> Dict[str, Any]: """Converts the OpaqueError to a dictionary. - The dictionary uses the modeled shape names rather than the - parameter names as keys to be mostly compatible with boto3. + The dictionary uses the modeled shape names rather than the parameter names as + keys to be mostly compatible with boto3. """ return { - "message": self.message, - "code": self.code, - "obj": self.obj, - "alt_text": self.alt_text, + 'message': self.message, + 'code': self.code, + 'obj': self.obj, + 'alt_text': self.alt_text, } @staticmethod def from_dict(d: Dict[str, Any]) -> "OpaqueError": """Creates a OpaqueError from a dictionary. - The dictionary is expected to use the modeled shape names rather - than the parameter names as keys to be mostly compatible with - boto3. + The dictionary is expected to use the modeled shape names rather than the + parameter names as keys to be mostly compatible with boto3. """ kwargs: Dict[str, Any] = { - "message": d["message"], - "obj": d["obj"], - "alt_text": d["alt_text"], + 'message': d['message'], + 'obj': d['obj'], + 'alt_text': d['alt_text'] } return OpaqueError(**kwargs) def __repr__(self) -> str: result = "OpaqueError(" - result += f"message={self.message}," + result += f'message={self.message},' if self.message is not None: result += f"message={repr(self.message)}" - result += f"obj={self.alt_text}" + result += f'obj={self.alt_text}' result += ")" return result @@ -186,43 +194,36 @@ def __eq__(self, other: Any) -> bool: return False if not (self.obj == other.obj): return False - attributes: list[str] = ["message", "message"] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['message','message'] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) def _smithy_error_to_dafny_error(e: ServiceError): - """Converts the provided native Smithy-modeled error into the corresponding - Dafny error.""" - if isinstance( - e, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.errors.KeyVectorException, - ): - return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_KeyVectorException( - message=_dafny.Seq(e.message) - ) + """ + Converts the provided native Smithy-modeled error + into the corresponding Dafny error. + """ + if isinstance(e, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.errors.KeyVectorException): + return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_KeyVectorException(message=_dafny.Seq(e.message)) if isinstance(e, CollectionOfErrors): - return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_CollectionOfErrors( - message=_dafny.Seq(e.message), - list=_dafny.Seq( - _smithy_error_to_dafny_error(native_err) for native_err in e.list - ), - ) + return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_CollectionOfErrors(message=_dafny.Seq(e.message), list=_dafny.Seq( + _smithy_error_to_dafny_error(native_err) for native_err in e.list + )) if isinstance(e, OpaqueError): - return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_Opaque( - obj=e.obj, alt__text=e.alt_text - ) + return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_Opaque(obj=e.obj, alt__text=e.alt_text) else: - return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_Opaque( - obj=e, - alt__text=_dafny.Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip(*[iter(repr(e).encode("utf-16-be"))] * 2) - ] - ) - ), - ) + return aws_cryptography_materialproviders_test_vectors.internaldafny.generated.AwsCryptographyMaterialProvidersTestVectorKeysTypes.Error_Opaque(obj=e, alt__text=_dafny.Seq( + "".join( + [ + chr(int.from_bytes(pair, "big")) + for pair in zip( + *[iter(repr(e).encode("utf-16-be"))] * 2 + ) + ] + ) + )) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/models.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/models.py index 7faf1161f..4fc8c89ac 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/models.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/models.py @@ -18,11 +18,9 @@ class CmmOperation: # values may be added in the future. values = frozenset({"ENCRYPT", "DECRYPT"}) - class RawAES: key_id: str provider_id: str - def __init__( self, *, @@ -33,7 +31,9 @@ def __init__( self.provider_id = provider_id def as_dict(self) -> Dict[str, Any]: - """Converts the RawAES to a dictionary.""" + """Converts the RawAES to a dictionary. + + """ return { "key_id": self.key_id, "provider_id": self.provider_id, @@ -41,7 +41,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RawAES": - """Creates a RawAES from a dictionary.""" + """Creates a RawAES from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], "provider_id": d["provider_id"], @@ -62,12 +64,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RawAES): return False - attributes: list[str] = [ - "key_id", - "provider_id", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id','provider_id',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class RawEcdh: sender_key_id: str @@ -77,7 +78,6 @@ class RawEcdh: provider_id: str curve_spec: str key_agreement_scheme: str - def __init__( self, *, @@ -98,7 +98,9 @@ def __init__( self.key_agreement_scheme = key_agreement_scheme def as_dict(self) -> Dict[str, Any]: - """Converts the RawEcdh to a dictionary.""" + """Converts the RawEcdh to a dictionary. + + """ return { "sender_key_id": self.sender_key_id, "recipient_key_id": self.recipient_key_id, @@ -111,7 +113,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RawEcdh": - """Creates a RawEcdh from a dictionary.""" + """Creates a RawEcdh from a dictionary. + + """ kwargs: Dict[str, Any] = { "sender_key_id": d["sender_key_id"], "recipient_key_id": d["recipient_key_id"], @@ -152,21 +156,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RawEcdh): return False - attributes: list[str] = [ - "sender_key_id", - "recipient_key_id", - "sender_public_key", - "recipient_public_key", - "provider_id", - "curve_spec", - "key_agreement_scheme", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['sender_key_id','recipient_key_id','sender_public_key','recipient_public_key','provider_id','curve_spec','key_agreement_scheme',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class HierarchyKeyring: key_id: str - def __init__( self, *, @@ -175,14 +172,18 @@ def __init__( self.key_id = key_id def as_dict(self) -> Dict[str, Any]: - """Converts the HierarchyKeyring to a dictionary.""" + """Converts the HierarchyKeyring to a dictionary. + + """ return { "key_id": self.key_id, } @staticmethod def from_dict(d: Dict[str, Any]) -> "HierarchyKeyring": - """Creates a HierarchyKeyring from a dictionary.""" + """Creates a HierarchyKeyring from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], } @@ -199,15 +200,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, HierarchyKeyring): return False - attributes: list[str] = [ - "key_id", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KMSInfo: key_id: str - def __init__( self, *, @@ -216,14 +216,18 @@ def __init__( self.key_id = key_id def as_dict(self) -> Dict[str, Any]: - """Converts the KMSInfo to a dictionary.""" + """Converts the KMSInfo to a dictionary. + + """ return { "key_id": self.key_id, } @staticmethod def from_dict(d: Dict[str, Any]) -> "KMSInfo": - """Creates a KMSInfo from a dictionary.""" + """Creates a KMSInfo from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], } @@ -240,11 +244,11 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KMSInfo): return False - attributes: list[str] = [ - "key_id", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KmsEcdhKeyring: sender_key_id: str @@ -253,7 +257,6 @@ class KmsEcdhKeyring: recipient_public_key: str curve_spec: str key_agreement_scheme: str - def __init__( self, *, @@ -272,7 +275,9 @@ def __init__( self.key_agreement_scheme = key_agreement_scheme def as_dict(self) -> Dict[str, Any]: - """Converts the KmsEcdhKeyring to a dictionary.""" + """Converts the KmsEcdhKeyring to a dictionary. + + """ return { "sender_key_id": self.sender_key_id, "recipient_key_id": self.recipient_key_id, @@ -284,7 +289,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KmsEcdhKeyring": - """Creates a KmsEcdhKeyring from a dictionary.""" + """Creates a KmsEcdhKeyring from a dictionary. + + """ kwargs: Dict[str, Any] = { "sender_key_id": d["sender_key_id"], "recipient_key_id": d["recipient_key_id"], @@ -321,20 +328,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KmsEcdhKeyring): return False - attributes: list[str] = [ - "sender_key_id", - "recipient_key_id", - "sender_public_key", - "recipient_public_key", - "curve_spec", - "key_agreement_scheme", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['sender_key_id','recipient_key_id','sender_public_key','recipient_public_key','curve_spec','key_agreement_scheme',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KmsMrkAware: key_id: str - def __init__( self, *, @@ -343,14 +344,18 @@ def __init__( self.key_id = key_id def as_dict(self) -> Dict[str, Any]: - """Converts the KmsMrkAware to a dictionary.""" + """Converts the KmsMrkAware to a dictionary. + + """ return { "key_id": self.key_id, } @staticmethod def from_dict(d: Dict[str, Any]) -> "KmsMrkAware": - """Creates a KmsMrkAware from a dictionary.""" + """Creates a KmsMrkAware from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], } @@ -367,17 +372,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KmsMrkAware): return False - attributes: list[str] = [ - "key_id", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KmsMrkAwareDiscovery: key_id: str default_mrk_region: str aws_kms_discovery_filter: Optional[DiscoveryFilter] - def __init__( self, *, @@ -395,7 +399,9 @@ def __init__( self.aws_kms_discovery_filter = aws_kms_discovery_filter def as_dict(self) -> Dict[str, Any]: - """Converts the KmsMrkAwareDiscovery to a dictionary.""" + """Converts the KmsMrkAwareDiscovery to a dictionary. + + """ d: Dict[str, Any] = { "key_id": self.key_id, "default_mrk_region": self.default_mrk_region, @@ -408,16 +414,16 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KmsMrkAwareDiscovery": - """Creates a KmsMrkAwareDiscovery from a dictionary.""" + """Creates a KmsMrkAwareDiscovery from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], "default_mrk_region": d["default_mrk_region"], } if "aws_kms_discovery_filter" in d: - kwargs["aws_kms_discovery_filter"] = DiscoveryFilter.from_dict( - d["aws_kms_discovery_filter"] - ) + kwargs["aws_kms_discovery_filter"] = DiscoveryFilter.from_dict(d["aws_kms_discovery_filter"]) return KmsMrkAwareDiscovery(**kwargs) @@ -437,18 +443,15 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KmsMrkAwareDiscovery): return False - attributes: list[str] = [ - "key_id", - "default_mrk_region", - "aws_kms_discovery_filter", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id','default_mrk_region','aws_kms_discovery_filter',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class KmsRsaKeyring: key_id: str encryption_algorithm: str - def __init__( self, *, @@ -459,7 +462,9 @@ def __init__( self.encryption_algorithm = encryption_algorithm def as_dict(self) -> Dict[str, Any]: - """Converts the KmsRsaKeyring to a dictionary.""" + """Converts the KmsRsaKeyring to a dictionary. + + """ return { "key_id": self.key_id, "encryption_algorithm": self.encryption_algorithm, @@ -467,7 +472,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KmsRsaKeyring": - """Creates a KmsRsaKeyring from a dictionary.""" + """Creates a KmsRsaKeyring from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], "encryption_algorithm": d["encryption_algorithm"], @@ -488,18 +495,16 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, KmsRsaKeyring): return False - attributes: list[str] = [ - "key_id", - "encryption_algorithm", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id','encryption_algorithm',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class RawRSA: key_id: str provider_id: str padding: str - def __init__( self, *, @@ -512,7 +517,9 @@ def __init__( self.padding = padding def as_dict(self) -> Dict[str, Any]: - """Converts the RawRSA to a dictionary.""" + """Converts the RawRSA to a dictionary. + + """ return { "key_id": self.key_id, "provider_id": self.provider_id, @@ -521,7 +528,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RawRSA": - """Creates a RawRSA from a dictionary.""" + """Creates a RawRSA from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], "provider_id": d["provider_id"], @@ -546,17 +555,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RawRSA): return False - attributes: list[str] = [ - "key_id", - "provider_id", - "padding", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id','provider_id','padding',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class StaticKeyring: key_id: str - def __init__( self, *, @@ -565,14 +571,18 @@ def __init__( self.key_id = key_id def as_dict(self) -> Dict[str, Any]: - """Converts the StaticKeyring to a dictionary.""" + """Converts the StaticKeyring to a dictionary. + + """ return { "key_id": self.key_id, } @staticmethod def from_dict(d: Dict[str, Any]) -> "StaticKeyring": - """Creates a StaticKeyring from a dictionary.""" + """Creates a StaticKeyring from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_id": d["key_id"], } @@ -589,15 +599,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, StaticKeyring): return False - attributes: list[str] = [ - "key_id", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_id',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetKeyDescriptionInput: json: bytes | bytearray - def __init__( self, *, @@ -606,14 +615,18 @@ def __init__( self.json = json def as_dict(self) -> Dict[str, Any]: - """Converts the GetKeyDescriptionInput to a dictionary.""" + """Converts the GetKeyDescriptionInput to a dictionary. + + """ return { "json": self.json, } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetKeyDescriptionInput": - """Creates a GetKeyDescriptionInput from a dictionary.""" + """Creates a GetKeyDescriptionInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "json": d["json"], } @@ -630,15 +643,14 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetKeyDescriptionInput): return False - attributes: list[str] = [ - "json", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['json',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class SerializeKeyDescriptionOutput: json: bytes | bytearray - def __init__( self, *, @@ -647,14 +659,18 @@ def __init__( self.json = json def as_dict(self) -> Dict[str, Any]: - """Converts the SerializeKeyDescriptionOutput to a dictionary.""" + """Converts the SerializeKeyDescriptionOutput to a dictionary. + + """ return { "json": self.json, } @staticmethod def from_dict(d: Dict[str, Any]) -> "SerializeKeyDescriptionOutput": - """Creates a SerializeKeyDescriptionOutput from a dictionary.""" + """Creates a SerializeKeyDescriptionOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "json": d["json"], } @@ -671,13 +687,13 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, SerializeKeyDescriptionOutput): return False - attributes: list[str] = [ - "json", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['json',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) -class KeyDescriptionKms: +class KeyDescriptionKms(): def __init__(self, value: KMSInfo): self.value = value @@ -686,7 +702,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionKms": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionKms(KMSInfo.from_dict(d["Kms"])) @@ -699,8 +715,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionKmsMrk: +class KeyDescriptionKmsMrk(): def __init__(self, value: KmsMrkAware): self.value = value @@ -709,7 +724,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionKmsMrk": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionKmsMrk(KmsMrkAware.from_dict(d["KmsMrk"])) @@ -722,8 +737,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionKmsMrkDiscovery: +class KeyDescriptionKmsMrkDiscovery(): def __init__(self, value: KmsMrkAwareDiscovery): self.value = value @@ -732,12 +746,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionKmsMrkDiscovery": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return KeyDescriptionKmsMrkDiscovery( - KmsMrkAwareDiscovery.from_dict(d["KmsMrkDiscovery"]) - ) + return KeyDescriptionKmsMrkDiscovery(KmsMrkAwareDiscovery.from_dict(d["KmsMrkDiscovery"])) def __repr__(self) -> str: return f"KeyDescriptionKmsMrkDiscovery(value=repr(self.value))" @@ -747,8 +759,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionRSA: +class KeyDescriptionRSA(): def __init__(self, value: RawRSA): self.value = value @@ -757,7 +768,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionRSA": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionRSA(RawRSA.from_dict(d["RSA"])) @@ -770,8 +781,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionAES: +class KeyDescriptionAES(): def __init__(self, value: RawAES): self.value = value @@ -780,7 +790,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionAES": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionAES(RawAES.from_dict(d["AES"])) @@ -793,8 +803,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionECDH: +class KeyDescriptionECDH(): def __init__(self, value: RawEcdh): self.value = value @@ -803,7 +812,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionECDH": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionECDH(RawEcdh.from_dict(d["ECDH"])) @@ -816,8 +825,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionStatic: +class KeyDescriptionStatic(): def __init__(self, value: StaticKeyring): self.value = value @@ -826,7 +834,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionStatic": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionStatic(StaticKeyring.from_dict(d["Static"])) @@ -839,8 +847,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionKmsRsa: +class KeyDescriptionKmsRsa(): def __init__(self, value: KmsRsaKeyring): self.value = value @@ -849,7 +856,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionKmsRsa": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionKmsRsa(KmsRsaKeyring.from_dict(d["KmsRsa"])) @@ -862,8 +869,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionKmsECDH: +class KeyDescriptionKmsECDH(): def __init__(self, value: KmsEcdhKeyring): self.value = value @@ -872,7 +878,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionKmsECDH": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionKmsECDH(KmsEcdhKeyring.from_dict(d["KmsECDH"])) @@ -885,8 +891,7 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionHierarchy: +class KeyDescriptionHierarchy(): def __init__(self, value: HierarchyKeyring): self.value = value @@ -895,7 +900,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionHierarchy": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionHierarchy(HierarchyKeyring.from_dict(d["Hierarchy"])) @@ -908,9 +913,8 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionMulti: - def __init__(self, value: "MultiKeyring"): +class KeyDescriptionMulti(): + def __init__(self, value: 'MultiKeyring'): self.value = value def as_dict(self) -> Dict[str, Any]: @@ -918,7 +922,7 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionMulti": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionMulti(MultiKeyring.from_dict(d["Multi"])) @@ -931,9 +935,8 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionRequiredEncryptionContext: - def __init__(self, value: "RequiredEncryptionContextCMM"): +class KeyDescriptionRequiredEncryptionContext(): + def __init__(self, value: 'RequiredEncryptionContextCMM'): self.value = value def as_dict(self) -> Dict[str, Any]: @@ -941,12 +944,10 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionRequiredEncryptionContext": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - return KeyDescriptionRequiredEncryptionContext( - RequiredEncryptionContextCMM.from_dict(d["RequiredEncryptionContext"]) - ) + return KeyDescriptionRequiredEncryptionContext(RequiredEncryptionContextCMM.from_dict(d["RequiredEncryptionContext"])) def __repr__(self) -> str: return f"KeyDescriptionRequiredEncryptionContext(value=repr(self.value))" @@ -956,12 +957,11 @@ def __eq__(self, other: Any) -> bool: return False return self.value == other.value - -class KeyDescriptionUnknown: +class KeyDescriptionUnknown(): """Represents an unknown variant. - If you receive this value, you will need to update your library to - receive the parsed value. + If you receive this value, you will need to update your library to receive the + parsed value. This value may not be deliberately sent. """ @@ -974,31 +974,14 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "KeyDescriptionUnknown": - if len(d) != 1: + if (len(d) != 1): raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") return KeyDescriptionUnknown(d["SDK_UNKNOWN_MEMBER"]["name"]) def __repr__(self) -> str: return f"KeyDescriptionUnknown(tag={self.tag})" - -KeyDescription = Union[ - KeyDescriptionKms, - KeyDescriptionKmsMrk, - KeyDescriptionKmsMrkDiscovery, - KeyDescriptionRSA, - KeyDescriptionAES, - KeyDescriptionECDH, - KeyDescriptionStatic, - KeyDescriptionKmsRsa, - KeyDescriptionKmsECDH, - KeyDescriptionHierarchy, - KeyDescriptionMulti, - KeyDescriptionRequiredEncryptionContext, - KeyDescriptionUnknown, -] - - +KeyDescription = Union[KeyDescriptionKms, KeyDescriptionKmsMrk, KeyDescriptionKmsMrkDiscovery, KeyDescriptionRSA, KeyDescriptionAES, KeyDescriptionECDH, KeyDescriptionStatic, KeyDescriptionKmsRsa, KeyDescriptionKmsECDH, KeyDescriptionHierarchy, KeyDescriptionMulti, KeyDescriptionRequiredEncryptionContext, KeyDescriptionUnknown] def _key_description_from_dict(d: Dict[str, Any]) -> KeyDescription: if "Kms" in d: return KeyDescriptionKms.from_dict(d) @@ -1036,24 +1019,24 @@ def _key_description_from_dict(d: Dict[str, Any]) -> KeyDescription: if "RequiredEncryptionContext" in d: return KeyDescriptionRequiredEncryptionContext.from_dict(d) - raise TypeError(f"Unions may have exactly 1 value, but found {len(d)}") - + raise TypeError(f'Unions may have exactly 1 value, but found {len(d)}') class RequiredEncryptionContextCMM: - underlying: "KeyDescription" + underlying: 'KeyDescription' required_encryption_context_keys: list[str] - def __init__( self, *, - underlying: "KeyDescription", + underlying: 'KeyDescription', required_encryption_context_keys: list[str], ): self.underlying = underlying self.required_encryption_context_keys = required_encryption_context_keys def as_dict(self) -> Dict[str, Any]: - """Converts the RequiredEncryptionContextCMM to a dictionary.""" + """Converts the RequiredEncryptionContextCMM to a dictionary. + + """ return { "underlying": self.underlying.as_dict(), "required_encryption_context_keys": self.required_encryption_context_keys, @@ -1061,7 +1044,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "RequiredEncryptionContextCMM": - """Creates a RequiredEncryptionContextCMM from a dictionary.""" + """Creates a RequiredEncryptionContextCMM from a dictionary. + + """ kwargs: Dict[str, Any] = { "underlying": _key_description_from_dict(d["underlying"]), "required_encryption_context_keys": d["required_encryption_context_keys"], @@ -1082,32 +1067,34 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, RequiredEncryptionContextCMM): return False - attributes: list[str] = [ - "underlying", - "required_encryption_context_keys", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['underlying','required_encryption_context_keys',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class GetKeyDescriptionOutput: - key_description: "KeyDescription" - + key_description: 'KeyDescription' def __init__( self, *, - key_description: "KeyDescription", + key_description: 'KeyDescription', ): self.key_description = key_description def as_dict(self) -> Dict[str, Any]: - """Converts the GetKeyDescriptionOutput to a dictionary.""" + """Converts the GetKeyDescriptionOutput to a dictionary. + + """ return { "key_description": self.key_description.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "GetKeyDescriptionOutput": - """Creates a GetKeyDescriptionOutput from a dictionary.""" + """Creates a GetKeyDescriptionOutput from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_description": _key_description_from_dict(d["key_description"]), } @@ -1124,31 +1111,34 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, GetKeyDescriptionOutput): return False - attributes: list[str] = [ - "key_description", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_description',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class SerializeKeyDescriptionInput: - key_description: "KeyDescription" - + key_description: 'KeyDescription' def __init__( self, *, - key_description: "KeyDescription", + key_description: 'KeyDescription', ): self.key_description = key_description def as_dict(self) -> Dict[str, Any]: - """Converts the SerializeKeyDescriptionInput to a dictionary.""" + """Converts the SerializeKeyDescriptionInput to a dictionary. + + """ return { "key_description": self.key_description.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "SerializeKeyDescriptionInput": - """Creates a SerializeKeyDescriptionInput from a dictionary.""" + """Creates a SerializeKeyDescriptionInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_description": _key_description_from_dict(d["key_description"]), } @@ -1165,27 +1155,28 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, SerializeKeyDescriptionInput): return False - attributes: list[str] = [ - "key_description", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_description',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class TestVectorCmmInput: - key_description: "KeyDescription" + key_description: 'KeyDescription' for_operation: str - def __init__( self, *, - key_description: "KeyDescription", + key_description: 'KeyDescription', for_operation: str, ): self.key_description = key_description self.for_operation = for_operation def as_dict(self) -> Dict[str, Any]: - """Converts the TestVectorCmmInput to a dictionary.""" + """Converts the TestVectorCmmInput to a dictionary. + + """ return { "key_description": self.key_description.as_dict(), "for_operation": self.for_operation, @@ -1193,7 +1184,9 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "TestVectorCmmInput": - """Creates a TestVectorCmmInput from a dictionary.""" + """Creates a TestVectorCmmInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_description": _key_description_from_dict(d["key_description"]), "for_operation": d["for_operation"], @@ -1214,32 +1207,34 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, TestVectorCmmInput): return False - attributes: list[str] = [ - "key_description", - "for_operation", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_description','for_operation',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class TestVectorKeyringInput: - key_description: "KeyDescription" - + key_description: 'KeyDescription' def __init__( self, *, - key_description: "KeyDescription", + key_description: 'KeyDescription', ): self.key_description = key_description def as_dict(self) -> Dict[str, Any]: - """Converts the TestVectorKeyringInput to a dictionary.""" + """Converts the TestVectorKeyringInput to a dictionary. + + """ return { "key_description": self.key_description.as_dict(), } @staticmethod def from_dict(d: Dict[str, Any]) -> "TestVectorKeyringInput": - """Creates a TestVectorKeyringInput from a dictionary.""" + """Creates a TestVectorKeyringInput from a dictionary. + + """ kwargs: Dict[str, Any] = { "key_description": _key_description_from_dict(d["key_description"]), } @@ -1256,27 +1251,28 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, TestVectorKeyringInput): return False - attributes: list[str] = [ - "key_description", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['key_description',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) class MultiKeyring: - generator: Optional["KeyDescription"] - child_keyrings: "list[KeyDescription]" - + generator: Optional['KeyDescription'] + child_keyrings: 'list[KeyDescription]' def __init__( self, *, - child_keyrings: "list[KeyDescription]", - generator: Optional["KeyDescription"] = None, + child_keyrings: 'list[KeyDescription]', + generator: Optional['KeyDescription'] = None, ): self.child_keyrings = child_keyrings self.generator = generator def as_dict(self) -> Dict[str, Any]: - """Converts the MultiKeyring to a dictionary.""" + """Converts the MultiKeyring to a dictionary. + + """ d: Dict[str, Any] = { "child_keyrings": _key_description_list_as_dict(self.child_keyrings), } @@ -1288,13 +1284,15 @@ def as_dict(self) -> Dict[str, Any]: @staticmethod def from_dict(d: Dict[str, Any]) -> "MultiKeyring": - """Creates a MultiKeyring from a dictionary.""" + """Creates a MultiKeyring from a dictionary. + + """ kwargs: Dict[str, Any] = { "child_keyrings": _key_description_list_from_dict(d["child_keyrings"]), } if "generator" in d: - kwargs["generator"] = (_key_description_from_dict(d["generator"]),) + kwargs["generator"] = _key_description_from_dict(d["generator"]), return MultiKeyring(**kwargs) @@ -1311,20 +1309,17 @@ def __repr__(self) -> str: def __eq__(self, other: Any) -> bool: if not isinstance(other, MultiKeyring): return False - attributes: list[str] = [ - "generator", - "child_keyrings", - ] - return all(getattr(self, a) == getattr(other, a) for a in attributes) - + attributes: list[str] = ['generator','child_keyrings',] + return all( + getattr(self, a) == getattr(other, a) + for a in attributes + ) def _key_description_list_as_dict(given: list[KeyDescription]) -> List[Any]: return [v.as_dict() for v in given] - def _key_description_list_from_dict(given: List[Any]) -> list[KeyDescription]: return [KeyDescription.from_dict(v) for v in given] - class Unit: pass diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/plugin.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/plugin.py index 5e5c15b4d..38c43d50a 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/plugin.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/plugin.py @@ -7,37 +7,29 @@ from smithy_python.exceptions import SmithyRetryException from .dafnyImplInterface import DafnyImplInterface - def set_config_impl(config: Config): - """Set the Dafny-compiled implementation in the Smithy-Python client Config - and load our custom NoRetriesStrategy.""" + """ + Set the Dafny-compiled implementation in the Smithy-Python client Config + and load our custom NoRetriesStrategy. + """ config.dafnyImplInterface = DafnyImplInterface() if isinstance(config, KeyVectorsConfig): - from aws_cryptography_materialproviders_test_vectors.internaldafny.generated.KeyVectors import ( - default__, - ) - - config.dafnyImplInterface.impl = default__.KeyVectors( - smithy_config_to_dafny_config(config) - ).value + from aws_cryptography_materialproviders_test_vectors.internaldafny.generated.KeyVectors import default__ + config.dafnyImplInterface.impl = default__.KeyVectors(smithy_config_to_dafny_config(config)).value config.retry_strategy = NoRetriesStrategy() - class ZeroRetryDelayToken: - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not wait to retry. """ - retry_delay = 0 - class NoRetriesStrategy(RetryStrategy): - """Placeholder class required by Smithy-Python client implementation. - + """ + Placeholder class required by Smithy-Python client implementation. Do not retry calling Dafny code. """ - def acquire_initial_retry_token(self): return ZeroRetryDelayToken() diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/serialize.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/serialize.py index 9efdef9ad..332d682ed 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/serialize.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/serialize.py @@ -10,47 +10,16 @@ def _serialize_create_test_vector_keyring(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateTestVectorKeyring", - dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput( - input - ), - ) - - -def _serialize_create_wrapped_test_vector_keyring( - input, config: Config -) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateWrappedTestVectorKeyring", - dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput( - input - ), - ) + return DafnyRequest(operation_name="CreateTestVectorKeyring", dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput(input)) +def _serialize_create_wrapped_test_vector_keyring(input, config: Config) -> DafnyRequest: + return DafnyRequest(operation_name="CreateWrappedTestVectorKeyring", dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput(input)) def _serialize_create_wrapped_test_vector_cmm(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="CreateWrappedTestVectorCmm", - dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_TestVectorCmmInput( - input - ), - ) - + return DafnyRequest(operation_name="CreateWrappedTestVectorCmm", dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_TestVectorCmmInput(input)) def _serialize_get_key_description(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="GetKeyDescription", - dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionInput( - input - ), - ) - + return DafnyRequest(operation_name="GetKeyDescription", dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionInput(input)) def _serialize_serialize_key_description(input, config: Config) -> DafnyRequest: - return DafnyRequest( - operation_name="SerializeKeyDescription", - dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionInput( - input - ), - ) + return DafnyRequest(operation_name="SerializeKeyDescription", dafny_operation_input=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionInput(input)) diff --git a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/smithy_to_dafny.py b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/smithy_to_dafny.py index 928672dec..45c870be2 100644 --- a/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/smithy_to_dafny.py +++ b/TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/smithy_to_dafny.py @@ -49,560 +49,160 @@ ) -def aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput( - native_input, -): +def aws_cryptography_materialproviderstestvectorkeys_TestVectorKeyringInput(native_input): return DafnyTestVectorKeyringInput( - keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - native_input.key_description - ), + keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(native_input.key_description), ) - def aws_cryptography_materialproviderstestvectorkeys_KeyDescription(native_input): - if isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKms, - ): - KeyDescription_union_value = KeyDescription_Kms( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KMSInfo( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrk, - ): - KeyDescription_union_value = KeyDescription_KmsMrk( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAware( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrkDiscovery, - ): - KeyDescription_union_value = KeyDescription_KmsMrkDiscovery( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAwareDiscovery( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRSA, - ): - KeyDescription_union_value = KeyDescription_RSA( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RawRSA( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionAES, - ): - KeyDescription_union_value = KeyDescription_AES( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RawAES( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionECDH, - ): - KeyDescription_union_value = KeyDescription_ECDH( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RawEcdh( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionStatic, - ): - KeyDescription_union_value = KeyDescription_Static( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_StaticKeyring( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsRsa, - ): - KeyDescription_union_value = KeyDescription_KmsRsa( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsRsaKeyring( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsECDH, - ): - KeyDescription_union_value = KeyDescription_KmsECDH( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsEcdhKeyring( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionHierarchy, - ): - KeyDescription_union_value = KeyDescription_Hierarchy( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_HierarchyKeyring( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionMulti, - ): - KeyDescription_union_value = KeyDescription_Multi( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_MultiKeyring( - native_input.value - ) - ) - elif isinstance( - native_input, - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRequiredEncryptionContext, - ): - KeyDescription_union_value = KeyDescription_RequiredEncryptionContext( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM( - native_input.value - ) - ) + if isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKms): + KeyDescription_union_value = KeyDescription_Kms(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KMSInfo(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrk): + KeyDescription_union_value = KeyDescription_KmsMrk(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAware(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsMrkDiscovery): + KeyDescription_union_value = KeyDescription_KmsMrkDiscovery(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsMrkAwareDiscovery(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRSA): + KeyDescription_union_value = KeyDescription_RSA(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RawRSA(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionAES): + KeyDescription_union_value = KeyDescription_AES(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RawAES(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionECDH): + KeyDescription_union_value = KeyDescription_ECDH(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RawEcdh(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionStatic): + KeyDescription_union_value = KeyDescription_Static(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_StaticKeyring(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsRsa): + KeyDescription_union_value = KeyDescription_KmsRsa(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsRsaKeyring(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionKmsECDH): + KeyDescription_union_value = KeyDescription_KmsECDH(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KmsEcdhKeyring(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionHierarchy): + KeyDescription_union_value = KeyDescription_Hierarchy(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_HierarchyKeyring(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionMulti): + KeyDescription_union_value = KeyDescription_Multi(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_MultiKeyring(native_input.value)) + elif isinstance(native_input, aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.models.KeyDescriptionRequiredEncryptionContext): + KeyDescription_union_value = KeyDescription_RequiredEncryptionContext(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM(native_input.value)) else: - raise ValueError( - "No recognized union value in union type: " + str(native_input) - ) + raise ValueError("No recognized union value in union type: " + str(native_input)) return KeyDescription_union_value - def aws_cryptography_materialproviderstestvectorkeys_KMSInfo(native_input): return DafnyKMSInfo( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsMrkAware(native_input): return DafnyKmsMrkAware( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsMrkAwareDiscovery(native_input): return DafnyKmsMrkAwareDiscovery( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - defaultMrkRegion=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.default_mrk_region.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - awsKmsDiscoveryFilter=( - ( - Option_Some( - aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter( - native_input.aws_kms_discovery_filter - ) - ) - ) - if (native_input.aws_kms_discovery_filter is not None) - else (Option_None()) - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), + defaultMrkRegion=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.default_mrk_region.encode('utf-16-be'))]*2)])), + awsKmsDiscoveryFilter=((Option_Some(aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_DiscoveryFilter(native_input.aws_kms_discovery_filter))) if (native_input.aws_kms_discovery_filter is not None) else (Option_None())), ) - def aws_cryptography_materialproviderstestvectorkeys_RawRSA(native_input): return DafnyRawRSA( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - providerId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.provider_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - padding=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PaddingScheme( - native_input.padding - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), + providerId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.provider_id.encode('utf-16-be'))]*2)])), + padding=aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_PaddingScheme(native_input.padding), ) - def aws_cryptography_materialproviderstestvectorkeys_RawAES(native_input): return DafnyRawAES( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - providerId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.provider_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), + providerId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.provider_id.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviderstestvectorkeys_RawEcdh(native_input): return DafnyRawEcdh( - senderKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.sender_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - recipientKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.recipient_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - senderPublicKey=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.sender_public_key.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - recipientPublicKey=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.recipient_public_key.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - providerId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.provider_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - curveSpec=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.curve_spec.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - keyAgreementScheme=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_agreement_scheme.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + senderKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.sender_key_id.encode('utf-16-be'))]*2)])), + recipientKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.recipient_key_id.encode('utf-16-be'))]*2)])), + senderPublicKey=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.sender_public_key.encode('utf-16-be'))]*2)])), + recipientPublicKey=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.recipient_public_key.encode('utf-16-be'))]*2)])), + providerId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.provider_id.encode('utf-16-be'))]*2)])), + curveSpec=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.curve_spec.encode('utf-16-be'))]*2)])), + keyAgreementScheme=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_agreement_scheme.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviderstestvectorkeys_StaticKeyring(native_input): return DafnyStaticKeyring( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsRsaKeyring(native_input): return DafnyKmsRsaKeyring( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - encryptionAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec( - native_input.encryption_algorithm - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), + encryptionAlgorithm=aws_cryptography_internal_kms.smithygenerated.com_amazonaws_kms.aws_sdk_to_dafny.com_amazonaws_kms_EncryptionAlgorithmSpec(native_input.encryption_algorithm), ) - def aws_cryptography_materialproviderstestvectorkeys_KmsEcdhKeyring(native_input): return DafnyKmsEcdhKeyring( - senderKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.sender_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - recipientKeyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.recipient_key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - senderPublicKey=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.sender_public_key.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - recipientPublicKey=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.recipient_public_key.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), - curveSpec=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.curve_spec.encode("utf-16-be"))] * 2 - ) - ] - ) - ), - keyAgreementScheme=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_agreement_scheme.encode("utf-16-be"))] - * 2 - ) - ] - ) - ), + senderKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.sender_key_id.encode('utf-16-be'))]*2)])), + recipientKeyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.recipient_key_id.encode('utf-16-be'))]*2)])), + senderPublicKey=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.sender_public_key.encode('utf-16-be'))]*2)])), + recipientPublicKey=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.recipient_public_key.encode('utf-16-be'))]*2)])), + curveSpec=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.curve_spec.encode('utf-16-be'))]*2)])), + keyAgreementScheme=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_agreement_scheme.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviderstestvectorkeys_HierarchyKeyring(native_input): return DafnyHierarchyKeyring( - keyId=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_id.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + keyId=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_id.encode('utf-16-be'))]*2)])), ) - def aws_cryptography_materialproviderstestvectorkeys_MultiKeyring(native_input): return DafnyMultiKeyring( - generator=( - ( - Option_Some( - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - native_input.generator - ) - ) - ) - if (native_input.generator is not None) - else (Option_None()) - ), - childKeyrings=Seq( - [ - aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - list_element - ) - for list_element in native_input.child_keyrings - ] - ), + generator=((Option_Some(aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(native_input.generator))) if (native_input.generator is not None) else (Option_None())), + childKeyrings=Seq([aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(list_element) for list_element in native_input.child_keyrings]), ) - -def aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM( - native_input, -): +def aws_cryptography_materialproviderstestvectorkeys_RequiredEncryptionContextCMM(native_input): return DafnyRequiredEncryptionContextCMM( - underlying=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - native_input.underlying - ), - requiredEncryptionContextKeys=Seq( - [ - Seq(list_element.encode("utf-8")) - for list_element in native_input.required_encryption_context_keys - ] - ), + underlying=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(native_input.underlying), + requiredEncryptionContextKeys=Seq([Seq(list_element.encode('utf-8')) for list_element in native_input.required_encryption_context_keys]), ) - def aws_cryptography_materialproviderstestvectorkeys_TestVectorCmmInput(native_input): return DafnyTestVectorCmmInput( - keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - native_input.key_description - ), - forOperation=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_CmmOperation( - native_input.for_operation - ), + keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(native_input.key_description), + forOperation=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_CmmOperation(native_input.for_operation), ) - def aws_cryptography_materialproviderstestvectorkeys_CmmOperation(native_input): - if native_input == "ENCRYPT": + if native_input == 'ENCRYPT': return CmmOperation_ENCRYPT() - elif native_input == "DECRYPT": + elif native_input == 'DECRYPT': return CmmOperation_DECRYPT() else: - raise ValueError(f"No recognized enum value in enum type: {native_input=}") - + raise ValueError(f'No recognized enum value in enum type: {native_input=}') -def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionInput( - native_input, -): +def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionInput(native_input): return DafnyGetKeyDescriptionInput( json=Seq(native_input.json), ) - -def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionInput( - native_input, -): +def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionInput(native_input): return DafnySerializeKeyDescriptionInput( - keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - native_input.key_description - ), + keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(native_input.key_description), ) +def aws_cryptography_materialproviderstestvectorkeys_CreateWrappedTestVectorCmmOutput(native_input): + return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference(native_input) -def aws_cryptography_materialproviderstestvectorkeys_CreateWrappedTestVectorCmmOutput( - native_input, -): - return aws_cryptographic_material_providers.smithygenerated.aws_cryptography_materialproviders.smithy_to_dafny.aws_cryptography_materialproviders_CryptographicMaterialsManagerReference( - native_input - ) - - -def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionOutput( - native_input, -): +def aws_cryptography_materialproviderstestvectorkeys_GetKeyDescriptionOutput(native_input): return DafnyGetKeyDescriptionOutput( - keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription( - native_input.key_description - ), + keyDescription=aws_cryptography_materialproviders_test_vectors.smithygenerated.aws_cryptography_materialproviderstestvectorkeys.smithy_to_dafny.aws_cryptography_materialproviderstestvectorkeys_KeyDescription(native_input.key_description), ) - -def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionOutput( - native_input, -): +def aws_cryptography_materialproviderstestvectorkeys_SerializeKeyDescriptionOutput(native_input): return DafnySerializeKeyDescriptionOutput( json=Seq(native_input.json), ) - def aws_cryptography_materialproviderstestvectorkeys_KeyVectorsConfig(native_input): return DafnyKeyVectorsConfig( - keyManifestPath=Seq( - "".join( - [ - chr(int.from_bytes(pair, "big")) - for pair in zip( - *[iter(native_input.key_manifest_path.encode("utf-16-be"))] * 2 - ) - ] - ) - ), + keyManifestPath=Seq(''.join([chr(int.from_bytes(pair, 'big')) for pair in zip(*[iter(native_input.key_manifest_path.encode('utf-16-be'))]*2)])), )