in TestVectorsAwsCryptographicMaterialProviders/runtimes/python/src/aws_cryptography_materialproviders_test_vectors/smithygenerated/aws_cryptography_materialproviderstestvectorkeys/smithy_to_dafny.py [0:0]
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
)
)
else:
raise ValueError(
"No recognized union value in union type: " + str(native_input)
)
return KeyDescription_union_value