def _deserialize_error()

in AwsEncryptionSDK/runtimes/python/src/aws_encryption_sdk_dafny/smithygenerated/aws_cryptography_encryptionsdk/deserialize.py [0:0]


def _deserialize_error(error: Error) -> ServiceError:
    if error.is_Opaque:
        return OpaqueError(obj=error.obj)
    elif error.is_OpaqueWithText:
        return OpaqueErrorWithText(obj=error.obj, obj_message=error.objMessage)
    elif error.is_CollectionOfErrors:
        return CollectionOfErrors(
            message=_dafny.string_of(error.message),
            list=[_deserialize_error(dafny_e) for dafny_e in error.list],
        )
    elif error.is_AwsEncryptionSdkException:
        return AwsEncryptionSdkException(message=_dafny.string_of(error.message))
    elif error.is_AwsCryptographyPrimitives:
        return AwsCryptographicPrimitives(
            aws_cryptography_primitives_deserialize_error(
                error.AwsCryptographyPrimitives
            )
        )
    elif error.is_AwsCryptographyMaterialProviders:
        return AwsCryptographicMaterialProviders(
            aws_cryptography_materialproviders_deserialize_error(
                error.AwsCryptographyMaterialProviders
            )
        )
    else:
        return OpaqueError(obj=error)